david30-maker / task-management-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Task Management System

πŸ“— Table of Contents

πŸ“– [task-management-app]

The task management API provides a RESTful interface for managing tasks within an application. Users can perform various operations on tasks, including creating, reading, updating, and deleting tasks. The API supports user authentication using JWT tokens to ensure secure access to task data. Tasks are stored in a database, and input data is validated to maintain data integrity and security. The API facilitates seamless integration with client applications, enabling users to efficiently organize and track their tasks.

πŸ›  Built With

Client
  • Ruby on Rails:

Tech Stack

Ruby on Rails

Key Features

  • [user authentication]
  • [api for student information]

(back to top)

πŸ’» Getting Started

Before you begin, ensure you have the following:

Prerequisites

  • Ruby (version 3.1.1)
  • Ruby on Rails (version 7.1)
  • PostgreSQL
  • Git
  • Postman

Install

Follow these steps to install and configure the student_dashboard_api Rails App:

Clone this repository to your local machine:

Navigate to the project directory:

  • cd task-management-api

Install the required Ruby gems:

  • bundle install

Create and configure your database:

  • rails db:create
  • rails db:migrate
  • rails db:seed

Start the Rails server:

  • rails server

Check Swagger for Restful API Documentation

πŸ‘₯ Author

πŸ‘€ David Igbo

(back to top)

πŸ”­ Future Features

  • Department Api

(back to top)

🀝 Contributing

Contributions, issues, and feature requests are welcome!

(back to top)

⭐️ Show your support

Give a start ⭐️ If you like this project...

(back to top)

πŸ™ Acknowledgments

Special thanks to Niyo Group for this opportunity

(back to top)

πŸ“ License

This project is MIT licensed.

(back to top)

πŸ“ Api Documentation

Now the server is running you can start to query the API endpoints.

To Sign up a user, send a POST request to the following endpoint;

http://localhost:3000/signup

The body of the Json will be

    {
    "user": {
        "email": "david@gmail.com",
        "password": "1234567",
        "name": "Dave"
    }
}

If you do this right , you will get a response of the created user

    {
    "status": {
        "code": 200,
        "message": "Signed up successfully."
    },
    "data": {
        "id": 6,
        "email": "david@gmail.com",
        "name": "Dave"
    }
        "token": "eyJhbG*********************************************************nRVvhI" 
    }

If you do this wrong , you will get an error message:

    { 
        "error": "User couldn't be created successfully" 
    }

After signing up;

    Copy the token in the response body of the previous successful request

Send a GET request to the following endpoint to get details on the signed up user
`http://localhost:3000/signup`

On the headers for the request add  `Authorization` using the keyword `Bearer` , followed by the token you got upon signing up
The Authorization Header should look like this
```json
    "Authorization": "Bearer eyJhbG*********************************************************nRVvhI"  

We will get this as the response body  

     {
    "status": {
        "code": 200,
        "message": "Signed up successfully."
    },
    "data": {
        "id": 6,
        "email": "david@gmail.com",
        "name": "Dave"
    }
}

To handle login , send a POST request to the following endpoint

http://localhost:3000/login

and the body below

   {
    "user": {
        "email": "david@gmail.com",
        "password": "1234567"
    }
}

We get this as the response body

    {
    "status": {
        "code": 200,
        "message": "Logged in successfully.",
        "data": {
            "user": {
                "id": 6,
                "email": "david@gmail.com",
                "name": "Dave"
            }
        }
    }
            "token": "eyJhbG*********************************************************nRVvhI"  
    }

If you do this wrong , you will get an error message:

    { 
        "error": "Logged in was not successfully" 
    }

To handle task api, send a POST request to the following endpoint

http://localhost:3000/api/v1/tasks and the body below

{
    "task": {
        "title": "Relationships matter",
        "description": "It is an awesome book on relationship",
        "status": "in_progress"
    }
}

We get this as the response body

   {
    "id": 17,
    "title": "Relationships matter",
    "description": "It is an awesome book on relationships",
    "status": "in_progress",
    "completed": false,
    "user_id": 6,
    "created_at": "2024-05-20T06:34:31.777Z",
    "updated_at": "2024-05-20T06:34:31.777Z"
}

If you do this wrong, you will get an error message:

    { 
        "error": "Task was not created" 
    }

About

License:MIT License


Languages

Language:Ruby 96.5%Language:Dockerfile 2.8%Language:HTML 0.4%Language:Shell 0.3%