This project provides a full-stack application for project and task management, Pro Tasker. This API is the engine that powers the entire application, handling user accounts, project management, and individual tasks. It provides a real-world, secure, and functional RESTful API with user-level authentication and authorization to keep information private.
The API provides secure row-level authenticated endpoints to allow clients to:
Manage Users:
- POST /api/users/register
- Register to create a new user, ensuring the password gets hashed securely.
- POST /api/users/login
- Login to find a user by their email, compare the provided password with the stored hash, and, if successful, generate and return a signed JSON Web Token (JWT).
Manage Projects:
- POST /api/projects
- Create a new project assigned as owned by the current user.
- POST /api/projects/:id/tasks
- Create a new task for a project.
- GET /api/projects
- Get all projects owned by the currently logged-in user.
- GET /api/projects/:id
- Get a single project by its ID.
- GET /api/projects/:id/tasks
- Get all tasks for a project.
- PUT /api/projects/:id
- Update a project.
- DELETE /api/projects/:id
- Delete a project.
Manage Tasks:
- POST /api/tasks
- Create a new task for a specific project.
- GET /api/tasks
- Get all tasks for the user.
- GET /api/tasks/:id
- Get a single task.
- PUT /api/tasks/:taskId
- Update a single task.
- DELETE /api/tasks/:taskId
- Delete a single task.
- Live Site URL: (https://fiel.us/pro-tasker/)
- Node.js & Express: Server setup, modular routing, middleware implementation, and RESTful API design.
- MongoDB & Mongoose: Complex schema design with relationships (ref), data validation, and advanced Mongoose queries for CRUD operations.
- Authentication & Authorization: JWT-based user authentication (registration and login), password hashing with bcrypt, and multi-layered, ownership-based authorization rules.
- TSC transpiling and bundling
This API required several chained Mongoose database queries in order to pull and verify ids and ownership before making changes to the data. This can be done in multiple ways, so it was good to explore these options and choose better performing queries that don't require full collection pulls to work.
David Fiel
- Website - David Fiel
- Thanks to Per Scholas!