Skip to content

Latest commit

 

History

53 Commits

Folders and files

Repository files navigation

Task Management Application

A full-stack task management application built with Next.js, Spring Boot, and PostgreSQL.

The application allows users to securely manage tasks with authentication, pagination, searching, sorting, task attachments, editing, and deletion features.


Live Demo

Frontend

https://task-management-app-wine-delta.vercel.app

Backend

https://task-management-app-production-a07b.up.railway.app


Demo Test User

You can log in using the following demo credentials to test the application without creating a new account:

Email: aryan@test.com
Password: password123

Architecture

Architecture


Tech Stack

Frontend

  • Next.js
  • TypeScript
  • Tailwind CSS
  • Axios
  • React Hook Form
  • React Hot Toast
  • Lucide React Icons

Backend

  • Java
  • Spring Boot
  • Spring Security
  • JWT Authentication
  • Spring Data JPA
  • PostgreSQL
  • Maven

Storage

  • Railway Object Storage
  • AWS S3 SDK

Deployment

  • Frontend: Vercel
  • Backend: Railway
  • Database: PostgreSQL (Railway)
  • File Storage: Railway Object Storage

Features

Authentication & Authorization

  • User Signup
  • User Login
  • JWT-based Authentication
  • Protected Routes
  • Persistent Login State
  • User-specific Task Access

Task Management

  • Create Tasks

  • View Tasks

  • Update Tasks

  • Delete Tasks

  • Search Tasks by Title

  • Sort Tasks by:

    • Recently Created
    • Due Date
    • Priority
  • Pagination Support


File Attachments

  • Upload Attachments to Tasks
  • Cloud Object Storage Integration
  • Attachment URL Persistence
  • Automatic File Cleanup on Task Deletion

Frontend Features

  • Responsive Dashboard
  • Dynamic User Dashboard
  • Loading States
  • Empty States
  • Toast Notifications
  • Confirmation Dialog for Delete
  • Mobile-Friendly UI
  • Responsive Modal Forms

API Endpoints

Authentication APIs

Method Endpoint Description
POST /auth/signup Register a new user
POST /auth/login Authenticate user and return JWT token
GET /auth/me Fetch currently logged-in user

Task APIs

Method Endpoint Description
POST /tasks Create a new task
GET /tasks Fetch paginated tasks
GET /tasks/{id} Fetch a task by ID
PATCH /tasks/{id} Update an existing task
DELETE /tasks/{id} Delete a task

File Upload APIs

Method Endpoint Description
POST /api/files/upload Upload task file

Example Query Parameters

Pagination

GET /tasks?page=0&size=6

Search

GET /tasks?search=spring

Sorting

GET /tasks?sortBy=createdAt

Supported sorting fields:

  • createdAt
  • dueDate
  • priority

Authentication Header

Protected APIs require JWT token in request headers:

Authorization: Bearer your_jwt_token

Environment Variables

Backend Environment Variables

ALLOWED_ORIGINS="your_frontend_url"

PGDATABASE="your_database_name"
PGHOST="your_database_host"
PGPASSWORD="your_database_password"
PGPORT="your_database_port"
PGUSER="your_database_username"

SPRING_PROFILES_ACTIVE="prod"

JWT_SECRET="your_jwt_secret"

AWS_ACCESS_KEY_ID="your_access_key"
AWS_SECRET_ACCESS_KEY="your_secret_key"
AWS_DEFAULT_REGION="auto"
AWS_ENDPOINT_URL="your_storage_endpoint"
AWS_S3_BUCKET_NAME="your_bucket_name"

Spring Profiles

The backend uses separate Spring profiles for development and production environments.

Development Profile

Used for local development configuration.

spring.profiles.active=dev

Production Profile

Used for deployed production configuration on Railway.

spring.profiles.active=prod

Separate profile files:

application-dev.properties
application-prod.properties

This helps maintain different:

  • database configurations
  • CORS origins
  • environment variables
  • storage credentials
  • deployment settings

for local and production environments.


Frontend (.env.local)

NEXT_PUBLIC_API_URL=http://localhost:5454

Local Setup

Local PostgreSQL Setup

Install PostgreSQL locally and create a database for the application.

Example database:

CREATE DATABASE task_management;

Update your local application-dev.properties file:

spring.datasource.url=jdbc:postgresql://localhost:5432/task_management
spring.datasource.username=your_postgres_username
spring.datasource.password=your_postgres_password

spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true

Make sure PostgreSQL is running locally before starting the backend server.

The backend uses the dev Spring profile during local development.


Clone Repository

git clone https://github.com/gsharma101/task-management-app

Backend Setup

cd backend

Run:

mvn spring-boot:run

Backend runs on:

http://localhost:5454

Frontend Setup

cd frontend

Install dependencies:

npm install

Run development server:

npm run dev

Frontend runs on:

http://localhost:3000

Docker Setup

The entire application can be started using Docker Compose.

This setup includes:

  • Next.js frontend
  • Spring Boot backend
  • PostgreSQL database

Prerequisites

Make sure Docker Desktop is installed and running.


Run Full Application

From the project root directory:

docker-compose up --build

This command will:

  • build frontend and backend Docker images
  • start PostgreSQL container
  • start Spring Boot backend container
  • start Next.js frontend container

Application URLs

Frontend

http://localhost:3000

Backend

http://localhost:5454

Dockerized Services

Frontend

  • Containerized using Node.js
  • Runs Next.js application

Backend

  • Containerized using Eclipse Temurin Java 21
  • Runs Spring Boot application

Database

  • PostgreSQL 16 container
  • Persistent Docker volume for database storage

Stop Containers

docker-compose down

Rebuild Containers

docker-compose up --build

Running Tests

mvn test

Implemented service layer tests for:

  • Task creation
  • Fetching task by ID
  • Task deletion

Folder Structure

backend/
 ├── controller
 ├── service
 ├── repository
 ├── entity
 ├── dto
 ├── security
 ├── config

frontend/
 ├── app
 ├── components
 ├── services

Future Improvements

  • Role-based access
  • Real-time updates
  • Activity logs
  • CI/CD pipeline
  • Presigned URL uploads
  • Multiple file attachments
  • Drag and drop uploads
  • File previews

Author

Gaurav Sharma

GitHub: https://github.com/gsharma101

Releases

Packages

Contributors

Languages