Lightweight task management API (TO-DO), designed as a flexible foundation for building more complex TODO applications.
- Dependencies
- Main Features
- Technologies Used
- Installation
- Documentation
- License
- Contributing
- Contact
This project relies on two fully auditable Rust-based dependencies:
- User management with defined statuses (Active, Inactive, Blocked, Deleted) and roles with associated permissions.
- Full CRUD for tasks, subtasks, categories, tags, milestones, and comments.
- Status and priority control for tasks and subtasks.
- Many-to-many relationships between tasks/subtasks and tags, comments, and attachments.
- Support for attachments with metadata, linked to tasks and subtasks.
- Scheduled notification system associated with tasks.
- Detailed history log for auditing with JSON data.
- User-specific limits configuration including max tasks, tasks per milestone, tags, categories, subtasks per task, comments, milestones, and attachment storage.
- Backend: NestJS, TypeORM, TypeScript
- Database: PostgreSQL
- Cache: Redis
- Authentication: JWT, bcrypt for password hashing
- File Storage: gRPC communication with a Rust-based file storage service (r-filestorage)
- Permissions: Bitmask-based system using r-perms to calculate permissions
- Validation: class-validator, class-transformer
- Real-time: WebSockets via socket.io (for comments and notifications)
- Infrastructure: Docker & Docker Compose
- Support Services: Rust binaries (r-backups for DB management, r-perms for permissions)
- Docker installed
- PostgreSQL database
- Redis service
- r-filestorage service (Repository) (Optional if you modify
src/modules/attchmentsaccordingly)
cp .env.template .env
cp .docker/.env.template .env
cp r-backups.json.template r-backups.jsonConfigure all environment variables correctly.
cd .docker/
docker compose up -d- Manually create the database using the files in
src/database/in the following order:types.sql: Contains custom types required.init.sql: Contains all tables used by the API.functions.sql: Functions required by the database.triggers.sql: Contains automatic update triggers forcreated_atandupdated_atfields.indexs.sql: Contains necessary indexes for performance.
- Alternatively, use the provided binary to set up the database automatically:
- Ensure
r-backups.jsonis configured based onr-backups.json.template. - Enter the active container:
- Ensure
docker exec -it app-tasks-api bash- Run:
npm run db:createdocker exec -it app-tasks-api bashThen run:
npm ci
npm run devGenerate a password hash:
npm run gen:pass YourStrongPassword@123Update the user in the database:
update users
set password = '<hash>' -- Replace <hash> with the generated hash
where id = 1;Visit localhost at the port configured in .docker/.env (APP_PORT), e.g., https://localhost:3000. You will receive a JSON response with API status, name, and version.
Send a POST request to http://localhost/auth/login with the following JSON body:
{
"email": "admin@admin.com",
"password": "YourStrongPassword@123"
}The response will return the token:
{
"token": "JWT_TOKEN"
}Use this token in the Authorization header for all API requests.
Once the project is running in development mode, the documentation is available at /docs following the OpenAPI (Swagger) standard.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! You can open issues to report bugs or suggest improvements, and submit pull requests for new features, documentation updates, or fixes. Please follow best practices and maintain code consistency.
For questions, suggestions, or any inquiries about this project, contact me at: hormigadev7@gmail.com
