🚀 A NestJS-based API developed for my portfolio, showcasing a task management system with essential features and modern practices.
This project demonstrates the following functionalities:
- 📝 CRUD for tasks (Controllers, Decorators, Services, Modules)
- ✅ DTO Validation with
class-validator
- 🔧 Environment Variables with
ConfigService
- 🔒 Authentication (JWT Service, App Guard)
- 🔑 Password Hashing
- 📦 Database Integration
- ⚙️ TypeORM Integration
- 🛡️ Global Guards (App Guard)
Ensure you have the following installed on your system:
- Clone the repository:
git clone https://github.com/Adao-Angelo/task-management-api.git
- Navigate to the project directory:
cd task-management-api
- Install dependencies:
pnpm install
- Copy the
.env.example
file and rename it to.env
. Populate all required variables. - Start the database container using Docker:
docker-compose up -d
- Run migrations to set up the database schema:
npm run migration:run
-
Create a migration:
npm run migration:create -name=your-migration-name
-
Run migrations:
npm run migration:run
-
Revert migrations:
npm run migration:revert
The API provides endpoints for managing tasks and users, including authentication and task CRUD operations.
Create a user:
curl --request POST --url http://localhost:3000/users --header 'Content-Type: application/json' --data '{
"username": "username",
"password": "password"
}'
Authenticate a user:
curl --request POST --url http://localhost:3000/auth/login --header 'Content-Type: application/json' --data '{
"username": "username",
"password": "password"
}'
-
Create a Task:
curl --request POST --url http://localhost:3000/task --header 'Authorization: Bearer token' --header 'Content-Type: application/json' --data '{ "title": "title", "description": "description", "expirationDate": "2024-01-01" }'
-
Update a Task:
curl --request PUT --url http://localhost:3000/task --header 'Authorization: Bearer token' --header 'Content-Type: application/json' --data '{ "id": "uuid here", "title": "updated title", "description": "updated description", "status": "IN_PROGRESS", "expirationDate": "2024-01-04" }'
-
Find Task by ID:
curl --request GET --url http://localhost:3000/task/1 --header 'Authorization: Bearer token'
-
Search Tasks with Filters:
curl --request GET --url 'http://localhost:3000/task?title=task%203&status=IN_PROGRESS' --header 'Authorization: Bearer token'
-
Delete a Task:
curl --request DELETE --url http://localhost:3000/task/uuid-here --header 'Authorization: Bearer token'
This project is licensed under the MIT License. Feel free to use and modify it for your purposes!
(Add relevant screenshots here if available to showcase API functionality or example results.)
Happy coding! 💻✨