Skip to content

A secure and scalable REST API for managing DSM tasks, built with Java , Spring Boot, JWT authentication, and MongoDB, deployed using Docker.

Notifications You must be signed in to change notification settings

ayan-dhiman/DSMTaskTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSMTASKTRACKER REST API

DSMTaskTracker is a RESTful API built using Java 17 and Spring Boot, designed to manage DSM tasks efficiently. It features secure JWT authentication, task management, activity logs, team collaboration, and more. The API is containerized using Docker for easy deployment.

Table of Contents

Installation

Prerequisites

  • Java
  • Maven
  • Docker

Setup

  1. Clone the repository:
    git clone https://github.com/yourusername/dsmtasktracker.git
    cd dsmtasktracker
  2. Build the project using Maven:
    mvn clean install
  3. Configure your environment variables for email services:
    • EMAIL_SERVICE_USERNAME
    • EMAIL_SERVICE_PASSWORD
  4. Run the application locally:
    mvn spring-boot:run

Usage

You can use tools like Postman or curl to interact with the API. Below are some of the main API endpoints.

API Endpoints

Authentication

  • Login:
    POST /auth/login
    Request Body: LoginRequest
  • Register:
    POST /auth/register
    Request Body: User
  • Verify Email:
    GET /auth/verifyemail?email={email}
  • Generate OTP:
    POST /auth/generateOTP?email={email}
  • Validate OTP:
    POST /auth/validateOTP?email={email}&OTP={OTP}
  • Reset Password:
    POST /auth/resetPassword
    Request Body: ResetPasswordBody

Activities

  • Get Activities by User ID:
    GET /api/activities/{userId}
  • Delete Activities by User ID:
    DELETE /api/activities/{userId}

Tasks

  • Add New Task:
    POST /api/tasks
    Request Body: Task
  • Get All Tasks by User ID:
    GET /api/tasks/{userId}
  • Get Tasks by User ID and Date:
    GET /api/tasks/date/{userId}?date={date}
  • Update Task by Task ID:
    PUT /api/tasks/{taskId}
    Request Body: Task
  • Delete Task by Task ID:
    DELETE /api/tasks/{taskId}

Teams

  • Add New Team:
    POST /api/teams
    Request Body: Team
  • Get All Teams by User ID:
    GET /api/teams/{userId}
  • Update Team by Team ID:
    PUT /api/teams/{teamId}
    Request Body: Team
  • Delete Team by Team ID:
    DELETE /api/teams/{teamId}
  • Delete Multiple Teams:
    DELETE /api/teams
    Request Body: List<String>

Users

  • Get User by ID:
    GET /api/users/{userId}
  • Get User by Email:
    GET /api/users/email/{email}
  • Delete User by ID:
    DELETE /api/users/{userId}
  • Update User by ID:
    PUT /api/users/{userId}
    Request Body: User
  • Update User by Email:
    PUT /api/users/email/{email}
    Request Body: User

Testing

To run the unit tests, use the following command:

mvn test

Deployment

To deploy the API using Docker:

  1. Build the Docker image:
    docker build -t dsmtasktracker .
  2. Run the Docker container:
    docker run -p 8080:8080 dsmtasktracker

The application is now accessible at http://localhost:8080.

Live Demo

The live version of the API is hosted here.

Note: Since the API is deployed on a shared server, the initial response may take a few minutes, but subsequent requests should be faster.

Contributing

Contributions are welcome! Please fork this repository and submit a pull request for any improvements or new features.

About

A secure and scalable REST API for managing DSM tasks, built with Java , Spring Boot, JWT authentication, and MongoDB, deployed using Docker.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published