Skip to content

JasMehta08/To_Do_app

Repository files navigation

To-Do App

A collaborative task management application built with TypeScript, Node.js, and Express. This application helps teams track and manage tasks for small-scale projects, ensuring accountability and clear communication among team members.

Motivation / Problem Statement

My motivation for starting with this was that I wanted to create an application that can help people communicate tasks on a small scale project like course projects or personal projects. I have worked on projects and noticed a problem of finding it hard to hold people accountable when they are not doing the job assigned to them. This app would allow for the whole group to be aware about what is going on with the project and allow for clear communication.

Features

  • User registration and login with JWT authentication
  • Task creation and management (CRUD)
  • Due date tracking
  • Status updates
  • Team collaboration
  • PostgreSQL database integration
  • Input validation
  • Error handling
  • RESTful API endpoints

Tech Stack

  • TypeScript
  • Node.js
  • Express
  • PostgreSQL
  • TypeORM
  • Class Validator
  • JWT (jsonwebtoken)
  • bcrypt

API Documentation

Authentication

Register a new user

POST /api/auth/register

  • Body:
{
  "username": "string",
  "email": "string",
  "password": "string"
}
  • Response: { message, token, user }

Login

POST /api/auth/login

  • Body:
{
  "email": "string",
  "password": "string"
}
  • Response: { message, token, user }

Task Routes (Require Authentication)

All requests must include:

Authorization: Bearer <token>

Get all tasks

GET /api/tasks

Get task by ID

GET /api/tasks/id/:id

Get task by name

GET /api/tasks/name/:name

Get tasks by due date

GET /api/tasks/duedate/:duedate

Get all pending tasks

GET /api/tasks/Pending

Create a new task

POST /api/tasks/new

  • Body:
{
  "name": "string",
  "description": "string",
  "dueDate": "YYYY-MM-DD",
  "status": "Pending|Completed|..."
}

Update a task

PUT /api/tasks/update/:id

  • Body: (same as create)

Delete a task

DELETE /api/tasks/delete/:id


Usage

  1. Install dependencies:
    npm install
  2. Set up your .env file:
    DB_HOST=localhost
    DB_PORT=5432
    DB_USERNAME=your_username
    DB_PASSWORD=your_password
    DB_NAME=your_database_name
    JWT_SECRET=your-super-secret-jwt-key
  3. Start the server:
    npm run dev
  4. Test the API:
    • Use Postman, cURL, or the provided test scripts (test-api.sh, test-with-token.sh)

Authentication Flow

  • Register or login to receive a JWT token.
  • Include the token in the Authorization header for all protected routes.
  • Example:
    curl -X GET http://localhost:3000/api/tasks \
      -H "Authorization: Bearer <your_token_here>"

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published