Skip to content

lakshaybxt/Task-Tracking-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Task Tracking App Backend πŸš€

This project is the backend part of the Task Tracking App, built with Spring Boot, PostgreSQL, and Docker. The application allows users to manage task lists and individual tasks, including creating, updating, deleting, and viewing tasks. The frontend code is located in the task-fe repository (developed by others), while this repository handles the backend logic in task-be.

Features ✨

  • Task Lists πŸ“‹: Create, update, delete, and retrieve task lists.
  • Tasks βœ…: Manage tasks with details like title, description, priority, and status.
  • Error Handling ⚠️: Global exception handling to return meaningful error responses.
  • Database πŸ—„οΈ: Uses PostgreSQL for data storage.
  • DTOs & Mappers πŸ”„: Data Transfer Objects (DTOs) for API responses and request handling. Custom mappers for conversion between entities and DTOs.

Tech Stack πŸ’»

  • Spring Boot: Java-based framework for building the backend.
  • PostgreSQL: Relational database for storing task lists and tasks.
  • Docker: For containerization of the application.
  • Maven: Dependency management and build tool.
  • Lombok: Java library to reduce boilerplate code (e.g., getters, setters).

Project Structure πŸ—οΈ

  • Controllers: Handle HTTP requests and responses.

    • TaskController: Manages tasks in a task list.
    • TaskListController: Manages task lists.
    • GlobalExceptionHandler: Handles global exceptions for error responses.
  • Services: Contains business logic.

    • TaskService: Handles task operations.
    • TaskListService: Handles task list operations.
  • Repositories: Interact with the database using Spring Data JPA.

    • TaskRepository: CRUD operations for tasks.
    • TaskListRepository: CRUD operations for task lists.
  • DTOs: Data Transfer Objects for tasks and task lists.

    • TaskDto: Represents task data.
    • TaskListDto: Represents task list data.
    • ErrorResponse: Represents error details in case of failure.
  • Mappers: Convert between entities and DTOs.

    • TaskMapper: Maps task entities to DTOs and vice versa.
    • TaskListMapper: Maps task list entities to DTOs and vice versa.

Installation πŸ› οΈ

  1. Clone the repository:
git clone https://github.com/yourusername/Task-Tracking-App.git
  1. Navigate to the project directory:
cd Task-Tracking-App/task-be
  1. Set up your PostgreSQL database (either locally or using Docker).

  2. Update application.properties (in src/main/resources/application.properties) with your database configuration.

  3. Build the application:

mvn clean install
  1. Run the application:
mvn spring-boot:run

Docker Setup 🐳

Alternatively, you can use Docker to run the application with the database.

  1. Build the Docker image:
docker build -t task-tracking-app-backend .
  1. Run the Docker container:
docker run -p 8080:8080 task-tracking-app-backend.

API Endpoints πŸ“‘

Task Lists

  • GET /task-lists: Get all task lists.
  • POST /task-lists: Create a new task list.
  • GET /task-lists/{task_list_id}: Get a task list by ID.
  • PUT /task-lists/{task_list_id}: Update a task list by ID.
  • DELETE /task-lists/{task_list_id}: Delete a task list by ID.

Tasks

  • GET /task-lists/{task_list_id}/tasks: Get all tasks in a task list.
  • POST /task-lists/{task_list_id}/tasks: Create a new task in a task list.
  • GET /task-lists/{task_list_id}/tasks/{task_id}: Get a task by ID.
  • PUT /task-lists/{task_list_id}/tasks/{task_id}: Update a task by ID.
  • DELETE /task-lists/{task_list_id}/tasks/{task_id}: Delete a task by ID.

Error Handling ⚑

Global exception handling is implemented with

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published