Tasky is a robust, full-stack task management application engineered for system reliability and security. This project serves as an architectural case study, demonstrating proficiency in asynchronous processing (BullMQ/Redis) and the implementation of data-layer Role-Based Access Control (RBAC) within a Node.js/Express environment.
The platform enforces a three-tiered hierarchy: Admin, Manager, and Employee. π‘οΈ 1. Admin Capabilities
Admins have full system-wide visibility and control. They represent the top tier of the hierarchy.
Admin Can: β View all tasks created in the entire application β Assign tasks to Managers β View all Manager & Employee data, including: Personal details (name, email, department, salary, lastlogin) Employment data (salary, role) β Manage user accounts (CRUD operations, role assignments) β Access system-level analytics & monitoring β View background job logs (queue status, failures, retries) Admin cannot: β Directly assign tasks to Employees (must go through Managers)
π¨βπΌ 2. Manager Capabilities Managers operate as mid-level leaders who oversee Employees. Manager Can: β Work on tasks assigned by Admins β Assign tasks to Employees β View Employee data including: (name, email, department, salary, lastlogin) β Track task progress of their department/team β Approve or reject work submissions (if implemented) Manager cannot: β View Adminsβ private data β View employees from other managers' departments β Assign tasks directly to other Managers or Admins
π· 3. Employee Capabilities Employees are the task executors inside the system. Employee Can: β View only the tasks assigned to them by their Manager β Execute tasks and submit task updates β Update task progress (Pending β In Progress β Completed) Employee cannot: β Assign tasks to anyone β View data of other employees β Access admin/manager dashboards β View tasks not assigned to them
The application decouples long-running operations from the main HTTP thread using a BullMQ job queue managed by a high-performance Redis store.
- Job Types: Supports both Time-Triggered Jobs .
- Resilience: Features automatic retry logic and failure handling, ensuring background processes are fault-tolerant.
Security constraints are enforced at the point of data access, utilizing the authenticated user's role to scope query results.
- Access Control: The service layer augments the request with token payload data and dynamically constructs the query's
WHEREclause to enforce granular RBAC.
- Transactional Guarantees: All multi-step database operations are wrapped in Sequelize Transactions to ensure atomic commits and maintain data consistency.
- Scalable Data Retrieval: Implemented advanced server-side techniques for Pagination, Filtering, and Dynamic Sorting to uphold stringent NFRs for response latency.
| Category | Technology | Role in System |
|---|---|---|
| Backend Core | Node.js, Express.js | Foundation for the scalable API layer. |
| Concurrency | BullMQ, Redis | Decoupled processing engine for background task reliability. |
| Database/ORM | PostgreSQL, Sequelize | Relational persistence and object-relational mapping. |
| Language | TypeScript | Ensures type safety and enhances code quality. |
- Node.js (v18+)
- PostgreSQL Server (Running)
- Redis Server (Critical for BullMQ operation)
Install required packages in both the backend and frontend directories:
# Backend dependencies
cd tasky-backend
npm install
# Frontend dependencies
cd ../tasky-frontend
npm installCreate a .env file in the root directory (or the designated backend location) and configure the following variables:
PG_HOST=localhost
PG_USER=postgres
PG_PASSWORD=your_password
PG_DATABASE=tasky_db
PG_PORT=5432
JWT_SECRET=your_jwt_secret_key
REDIS_HOST=localhost
REDIS_PORT=6379
PORT=5000Run database migrations to set up the schema:
npx sequelize-cli db:migrateTo run the application, you must start three separate processes (Redis server, Backend API, and Worker process).
The Redis server is essential for the BullMQ queue:
# SSH into WSL/Linux environment
sudo service redis-server start
# Test the connection:
redis-cli pingThis process handles all incoming HTTP requests:
# Must be in the tasky-backend directory
npm run devThis process is critical for executing all scheduled and background jobs (notifications, cron tasks):
# Must be in the tasky-backend directory
npm run worker:devThis process serves the client application:
# Must be in the tasky-frontend directory
npm run dev