A Go backend for managing tasks, organizations, and team collaborations. This system features real-time background processing for email notifications, secure JWT-based authentication, and a scalable architecture.
The Task Manager API is designed to handle high-concurrency task tracking with a strong focus on reliability and user notification. It doesn't just store tasks; it ensures that your team stays informed through a dedicated background worker system that tracks deadlines and assignments.
- Multi-Tenancy: Organize tasks within specific Organizations with member roles.
- Secure Auth: JWT access/refresh token rotation with OTP-verified signup.
- Intelligent Notifications: Automated "Due Soon" and "Overdue" email alerts.
- Reliable Workers: Notification tracking in the DB to prevent duplicate emails and handle retries.
- Performance Monitoring: Built-in Prometheus metrics and health checks.
- Rate Limiting: Redis-backed rate limiting to protect API resources.
The project follows a clean architecture pattern, separating concerns into Handlers, Services, and Repositories.
- Task Assigned: Triggered immediately upon task creation or reassignment.
- Due Soon: Scanned by
ReminderWorkerevery minute (checks for tasks due within 24h). - Overdue: Scanned by
ReminderWorkerfor tasks past their deadline. - Tracking: All notifications are logged in the
task_notificationstable to ensure we never spam users on server restarts.
- Go 1.22+ (if running locally)
- Docker & Docker Compose
- Make
The make file is overengineered 😅, i just learned Making Makefile so i use my all knowledge and implement everything here it may have some bugs, but i dont think so coz its working in my machine
The easiest way to get the environment up is using Docker Compose:
git clone https://github.com/aminshahid573/taskmanager.git
cd taskmanager
make docker-rebuild
# The API will be available at http://localhost:8080If you prefer running the Go binary locally:
make depsWe use YAML for configuration. production.yaml is the master template. local.yaml is ignored by git, so you should create it for your local settings.
cp config/production.yaml config/local.yamlMake sure you have Postgres running, then run migrations:
make migrate-upStart with hot-reload (requires 'air' installed)
make devAll API requests (except public/auth) require an Authorization: Bearer <token> header.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/auth/signup |
Register a new user |
POST |
/api/v1/auth/verify-otp |
Verify email via OTP |
POST |
/api/v1/auth/login |
Login and get access/refresh tokens |
POST |
/api/v1/auth/refresh |
Get new access token |
POST |
/api/v1/auth/logout |
Invalidate current session |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/users/me |
Get your current profile |
GET |
/api/v1/users/{id} |
Get another user's public info |
PATCH |
/api/v1/users/me |
Update your profile details |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/organizations |
Create an organization |
GET |
/api/v1/organizations |
List organizations you belong to |
GET |
/api/v1/organizations/{id} |
Get organization details |
POST |
/api/v1/organizations/{id}/members |
Add user to organization |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/organizations/{orgId}/tasks |
Create a new task |
GET |
/api/v1/organizations/{orgId}/tasks |
Filter and list tasks |
GET |
/api/v1/organizations/{orgId}/tasks/{id} |
Get specific task details |
PUT |
/api/v1/organizations/{orgId}/tasks/{id} |
Update task content/status |
DELETE |
/api/v1/organizations/{orgId}/tasks/{id} |
Soft delete a task |
PUT |
/api/v1/organizations/{orgId}/tasks/{id}/assign |
Assign task to a user |
- Health Check:
GET /health - Prometheus Metrics:
GET /metrics - Rate Limit Stats:
GET /admin/ratelimit/stats(Admin only)
├── cmd/api/ # Entry point for the application
├── api-tests/
├── internal/
│ ├── app/ # App initialization and dependency injection
│ ├── domain/ # Core models and domain interfaces
│ ├── handler/ # HTTP request handlers
│ ├── service/ # Business logic layer
│ ├── repository/ # Database and cache persistence
│ ├── worker/ # Background notification workers
│ └── middleware/ # Auth, logging, recovery, rate-limiting
└── migrations/ # SQL migration files
We have a dedicated suite of interactive shell scripts for testing all API endpoints manually. These scripts are located in the api-tests/ directory and use curl and jq.
I use my understanding of shell scripting in
api-testsso kindly take a look
# Run the test scripts (requires bash and jq)
bash api-tests/auth/signup.sh
bash api-tests/task/list.shFor detailed instructions on authentication flows and automatic token management, check out the API Tests README.
Copy .env.example to .env and configure accordingly:
DB_HOST: Database hostJWT_ACCESS_SECRET: Secret for signing access tokensEMAIL_SMTP_HOST: SMTP server for notificationsRATE_LIMIT_ENABLED: Set totrueto enable Redis rate limiting
- Check existing issues or open a new one.
- Fork the repo and create your feature branch.
- Ensure code passes
make lintandmake test. - Submit a Pull Request.