Giter Site home page Giter Site logo

fozzmarc / taskmanager Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 33 KB

TaskManager is a task management system built with Node.js and Express, designed to help developers quickly set up a task management API server.

License: MIT License

JavaScript 100.00%

taskmanager's Introduction

TaskManager

TaskManager is a task management system built with Node.js and Express, designed to help developers quickly set up a task management API server.

Features

  • User registration
  • User login
  • Create, read, update, and delete tasks

Installation and Running

  1. Clone the project:

    git clone https://github.com/fozzmarc/TaskManager.git
    cd TaskManager
  2. Install dependencies:

    npm install
  3. Configure environment variables: Create a .env file in the project root directory and add the following content:

    PORT=3000
    DB_NAME=taskmanager
    DB_USER=root
    DB_PASS=your_password
    DB_HOST=localhost
    JWT_SECRET=your_jwt_secret
    
  4. Run the server:

    npm start

API Documentation

User Registration

  • URL: /api/users/register
  • Method: POST
  • Request Body:
    {
        "username": "your_username",
        "password": "your_password"
    }
  • Response:
    {
        "message": "User created successfully"
    }

User Login

  • URL: /api/users/login
  • Method: POST
  • Request Body:
    {
        "username": "your_username",
        "password": "your_password"
    }
  • Response:
    {
        "token": "your_jwt_token"
    }

Get Current User Information

  • URL: /api/users/me
  • Method: GET
  • Header:
    {
        "Authorization": "Bearer your_jwt_token"
    }
  • Response:
    {
        "id": "user_id",
        "username": "your_username",
        "createdAt": "timestamp",
        "updatedAt": "timestamp"
    }

Create Task

  • URL: /api/tasks
  • Method: POST
  • Header:
    {
        "Authorization": "Bearer your_jwt_token"
    }
  • Request Body:
    {
        "title": "task_title",
        "description": "task_description"
    }
  • Response:
    {
        "id": "task_id",
        "title": "task_title",
        "description": "task_description",
        "status": "pending",
        "userId": "user_id",
        "createdAt": "timestamp",
        "updatedAt": "timestamp"
    }

Get All Tasks

  • URL: /api/tasks
  • Method: GET
  • Header:
    {
        "Authorization": "Bearer your_jwt_token"
    }
  • Response:
    [
        {
            "id": "task_id",
            "title": "task_title",
            "description": "task_description",
            "status": "pending",
            "userId": "user_id",
            "createdAt": "timestamp",
            "updatedAt": "timestamp"
        },
        ...
    ]

Update Task

  • URL: /api/tasks/:id
  • Method: PUT
  • Header:
    {
        "Authorization": "Bearer your_jwt_token"
    }
  • Request Body:
    {
        "title": "updated_title",
        "description": "updated_description",
        "status": "updated_status"
    }
  • Response:
    {
        "id": "task_id",
        "title": "updated_title",
        "description": "updated_description",
        "status": "updated_status",
        "userId": "user_id",
        "createdAt": "timestamp",
        "updatedAt": "timestamp"
    }

Delete Task

  • URL: /api/tasks/:id
  • Method: DELETE
  • Header:
    {
        "Authorization": "Bearer your_jwt_token"
    }
  • Response:
    {}

Contribution

Contributions of any kind are welcome! Please fork this repository and submit a pull request.

License

MIT

taskmanager's People

Contributors

fozzmarc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.