A full-stack Node.js and Express application designed to streamline workflows between management and interns. The system utilizes role-based access control (RBAC) to serve completely isolated UIs for public visitors, supervisors, and interns from a single backend.
- Role-Based Access Control: Distinct workflows and interfaces for
supervisorandinternroles. - Isolated Frontend Architecture: Express static routing securely serves distinct
public/directories based on the authenticated user's role. - Secure Authentication: Implements
bcryptfor password hashing andexpress-sessionfor secure, server-side memory sessions. - Dynamic Dashboards: Utilizes PostgreSQL aggregation queries to generate real-time performance metrics for both supervisors and interns.
- Task Lifecycle Management: Supervisors assign and delete tasks; interns update statuses (Pending → In Progress → Completed).
- Backend: Node.js, Express.js
- Frontend: Native HTML, CSS, Vanilla JavaScript (Fetch API)
- Database: PostgreSQL (
pgdriver) - Security:
bcrypt,express-session,dotenv
task-manager/
├── public/ # Isolated frontend interfaces
│ ├── main/ # Landing page & authentication forms
│ ├── supervisor/ # Protected management dashboard
│ └── intern/ # Protected execution queue
├── src/ # Backend architecture (MVC)
│ ├── config/ # Database connection pool
│ ├── controllers/ # Business logic and request handling
│ ├── middleware/ # Session and role-validation checks
│ ├── models/ # Database queries and aggregations
│ ├── routes/ # API endpoint definitions
│ └── app.js # Server boot and middleware orchestration
├── .env # Environment variables (not tracked in git)
└── migration.sql # PostgreSQL database schema
- Node.js installed
- PostgreSQL installed and running
Clone the repository and install the required dependencies:
npm install
Execute the migration script to build the schema. From the project root, run:
psql -U postgres -f migration.sql
Create a .env file in the root directory and configure your specific database credentials and session secret:
DB_USER=postgres
DB_HOST=localhost
DB_NAME=task_manager_db
DB_PASS=your_password
DB_PORT=5432
SESSION_SECRET=your_secure_random_string
Start the Express server:
node src/app.js
The application will be available at http://localhost:3000. Navigate to the root URL to register a new supervisor or intern account.