Simple REST API for task management with AI integration. Built with FastAPI.
JWT tokens with cookie/header support:
# Get token
curl -X POST "https://sprintsync-production-9d7f.up.railway.app/auth/login" \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "admin123"}'
# Use token
curl -H "Authorization: Bearer <token>" \
"https://sprintsync-production-9d7f.up.railway.app/tasks/"POST /auth/signup # Register user
POST /auth/login # Login, get JWT token
GET /auth/users # List users (admin only)
GET /auth/admin/stats # System stats (admin only)
GET /tasks/ # List user tasks
POST /tasks/ # Create task
GET /tasks/{id} # Get task
PUT /tasks/{id} # Update task
DELETE /tasks/{id} # Delete task
POST /tasks/{id}/status # Update status (HTMX)
POST /ai/suggest # Generate task descriptions (draft) or daily plans (plan)
GET /metrics # Prometheus metrics
GET /health # Health check
curl -X POST "https://sprintsync-production-9d7f.up.railway.app/tasks/" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"title": "Implement authentication",
"description": "Add JWT auth",
"status": "todo",
"total_minutes": 120
}'curl -X POST "https://sprintsync-production-9d7f.up.railway.app/ai/suggest" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"title": "Build a chatbot",
"mode": "draft"
}'curl -X POST "https://sprintsync-production-9d7f.up.railway.app/ai/suggest" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"mode": "plan"
}'All errors return:
{
"detail": "Error message"
}Common status codes:
401- Not authenticated403- Admin access required404- Resource not found422- Validation error
{
"id": 1,
"title": "Task title",
"description": "Description",
"status": "todo|in_progress|done",
"total_minutes": 120,
"user_id": 1,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}{
"id": 1,
"username": "admin",
"is_admin": true,
"created_at": "2024-01-15T10:30:00Z"
}- Admin:
admin/admin123 - Users:
user1,user2,user3/password123
The /ai/suggest endpoint includes timeout handling and error recovery. For production use with high traffic, consider implementing rate limiting and request caching.
Interactive Swagger UI available at: https://sprintsync-production-9d7f.up.railway.app/docs