A professional task management API built with Go, Gin, and GORM.
- Categories: Organize tasks into categories (Work, Personal, etc.).
- CUID for IDs: Enhanced security and collision resistance using string-based CUIDs for all records.
- RESTful API: Full CRUD operations for both categories and tasks.
- Database: PostgreSQL integration with GORM ORM and auto-migrations.
- Environment Configuration: Uses
.envfor easy configuration. - CORS Support: Ready for frontend integration.
- Clean Architecture: Organized structure for scalability and maintainability.
- Go (1.24+)
- PostgreSQL
- Clone the repository.
- Install dependencies:
go mod tidy
- Configure your database in
.env:DB_HOST=localhost DB_USER=postgres DB_PASSWORD=5432 DB_NAME=daily_tracking_db DB_PORT=5432
- Run the server:
go run cmd/server/main.go
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/categories |
Create a new category |
| GET | /api/v1/categories |
List all categories (preloads tasks) |
| GET | /api/v1/categories/:id |
Get details of a specific category |
| PUT | /api/v1/categories/:id |
Update a category's information |
| DELETE | /api/v1/categories/:id |
Delete a category |
| POST | /api/v1/tasks |
Create a new task (can assign category_id) |
| GET | /api/v1/tasks |
List all tasks |
| GET | /api/v1/tasks/:id |
Get details of a specific task |
| PUT | /api/v1/tasks/:id |
Update a task's information |
| DELETE | /api/v1/tasks/:id |
Delete a task |