Skip to content

KelvinCYDev/marvelous_todo_kelvin_backend

Repository files navigation

Issues MIT License LinkedIn


Logo

Marvelous V2.0 To-Do Backend

A simple To-Do app!

· Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Combined with https://github.com/KelvinCYDev/marvelous_todo_kelvin_frontend, this is a simple full-stack todo app with the following features:

  • User can create, update, and delete each To Do tasks.
  • Both lists are alphabetically sorted
  • User can check and uncheck tasks. The tasks will appear in the corresponding columns ('To Do', 'Done')
  • The 'To Do' list is unlimited
  • The 'Done' list only shows 10 most recently completed tasks
  • Users can select the auto syncing period for the ToDo list (5 sec, 15 seconds, 30 seconds, 1 minute)
  • As the user enters text in the search box, both columns are filtered to display only tasks matching the text entered thus far
  • User can delete all the tasks at once by pressing 'Delete all tasks'

(back to top)

Built With

  • Nodejs
  • Expressjs
  • MongoDB

(back to top)

Getting Started

To get a local copy up and running, please follow the following steps.

Prerequisites

  • Docker and Docker Compose

    Please refer to https://docs.docker.com/get-docker/
  • yarn

    npm install npm@latest -g
    npm install --global yarn

Installation

  1. Clone the repo

    git clone https://github.com/KelvinCYDev/marvelous_todo_kelvin_backend.git
  2. Copy .env file from .env.example and make changes if needed

    cp .env.example .env
  3. Docker compose up. Both the API server and MongoDB will be ready

     docker compose up -d
  4. To test the project with mocha and chai

    yarn test
  5. This is just the backend, the frontend part is here:

    https://github.com/KelvinCYDev/marvelous_todo_kelvin_frontend

(back to top)

Usage

The REST API usage is described below.

Get a list of To-Do tasks

'GET /'
 {
    "todo": [
        {
            "_id": "64c62615ff3bf83770958fad",
            "text": "Task 1",
            "done": false,
            "createdAt": "2023-07-30T08:57:57.526Z",
            "updatedAt": "2023-07-30T08:57:57.526Z",
            "__v": 0
        }
    ],
    "todoDone": [
        {
            "_id": "64c62617ff3bf83770958fb0",
            "text": "Task 2",
            "done": true,
            "createdAt": "2023-07-30T08:57:59.523Z",
            "updatedAt": "2023-07-30T08:58:03.567Z",
            "__v": 0
        }
    ]
}

Save a new To-Do task

'POST /save'

{
   "text": "Task B"
}
{
    "_id": "64c603d76a157c1e54f45039",
    "text": "Task B",
    "done": false,
    "createdAt": "2023-07-30T06:31:51.229Z",
    "updatedAt": "2023-07-30T06:40:51.885Z",
    "__v": 0
}

Update a To-Do task

'PUT /save'

{
   "_id": "64c603d76a157c1e54f45039",
   "text": "Task B",
    "done": false
}
{
    "_id": "64c603d76a157c1e54f45039",
    "text": "Task B",
    "done": false,
    "createdAt": "2023-07-30T06:31:51.229Z",
    "updatedAt": "2023-07-30T06:40:51.885Z",
    "__v": 0
}

Delete a To-Do task

'POST /delete'

{
   "_id": "64c603d76a157c1e54f45039",
}

Delete all To-Do tasks

'DELETE /delete'

(back to top)

Roadmap

  • Connect a local docker MongoDB database with Mongoose
  • Develop CRUD APIs for ToDo tasks
  • Dockerize the API server with MongoDB
  • Unit test using mocha and chai

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Kelvin - kelvincyca@gmail.com

Project Link: https://github.com/KelvinCYDev/marvelous_todo_kelvin_backend

(back to top)

Acknowledgments

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published