Smart Task Planner is a RESTful backend service built with Go, Echo v5, GORM, and PostgreSQL. It provides JWT-based authentication and task management functionality, allowing users to securely create, retrieve, update, and delete tasks.
- Go (Golang)
- Echo v5 (HTTP Framework)
- GORM (ORM)
- PostgreSQL
- JWT (Authentication)
- User registration
- User login with JWT token generation
- Protected task routes
- Create task
- Get all tasks (user-specific)
- Update task (partial updates supported)
- Delete task
- Ownership protection (users can access only their tasks)
Create a .env file or configure environment variables:
PORT=3000
DB_DSN=host=your_host user=your_user password=your_password dbname=your_db port=5432 sslmode=require TimeZone=UTC
JWT_KEY=your_secret_key
git clone https://github.com/JagTheFriend/Smart-Task-Planner-App.git
cd smart-task-planner
go mod tidy
go run main.go
Server will start on:
http://localhost:3000
Base path:
/api/v1
POST /api/v1/auth/signup
Request Body:
{
"name": "John Doe",
"email": "john@example.com",
"password": "password123"
}POST /api/v1/auth/login
Request Body:
{
"email": "john@example.com",
"password": "password123"
}Response:
{
"message": "<JWT_TOKEN>"
}All task routes require:
Authorization: Bearer <JWT_TOKEN>
POST /api/v1/task
Request Body:
{
"title": "Complete API",
"description": "Implement CRUD operations",
"deadline": "2026-02-20T18:00:00Z"
}GET /api/v1/task
Returns all tasks belonging to the authenticated user.
PUT /api/v1/task
Request Body:
{
"id": 1,
"title": "Updated Title",
"completed": true
}Only id is required. Other fields are optional.
DELETE /api/v1/task?id=1
- JWT-based authentication
- Route protection using middleware
- User-specific task isolation
- Secure password handling (recommended: hash before storing)
- Structured error responses
- Proper HTTP status codes
- Panic recovery middleware enabled