ArseneMerci / Todo-App-Backend

Todo App Backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Awesomity-Todo-App-Backend

Build Status Coverage Status Maintainability

An app that helps you to keep track of your day-to-day tasks.

Docs

API Endpoints included

  • POST /api/auth/signup: Create an account
  • POST /api/auth/login: Log into your account
  • POST /api/todos/: Create a new task
  • DELETE /api/todos/: Delete all tasks
  • GET /todos/:todoId: Get a single task
  • GET /api/todos: Get all tasks
  • GET /api/todos?s='search_query': Search through tasks
  • GET /api/todos?exp: Download tasks to a csv file
  • PATCH /todos/completed Update all tasks' completed statuses
  • PATCH /todos/:todoId: Update a task
  • DELETE /todos/:todoId: Delete a task
  • GET /api/logs/:key: Download logs
  • GET /api/docs Documentation

Installation and Environment Setup

Clone the repository from Github.

( You will need Git for this, Get it HERE )

git clone https://github.com/gitego-brian/Awesomity-Todo-App-Backend.git

Running the app normally

Pre-Requisites

  • PostgreSQL installed
  • Database todoapp created
  • Rename the .env.example file to .env after filling in your custom variables

To Install all dependencies:

npm install

To run the tests:

npm test

To run the app:

npm run dev

Running the app through docker

  • Install Docker from HERE, then check if you have docker-compose installed by running docker-compose -v in the terminal, if that doesn't print out its version, first install it from HERE.

  • After cloning the application from Github. Switch to the main app where there's the Dockerfile and the docker-compose.yml file

  • Create a .env file and copy .env.example and fill out all the variables with your own.

  • If you have postgres installed on your computer, stop any server instance of it that may be running. Do this by running sudo systemctl stop postgresql if you are on a Linux OS.

  • Run docker-compose up (Prefix this with sudo if you are running a Linux OS). Make sure port 5000 is not taken, if so customise the port in .env file by adding the PORT variable.

Test the endpoints on http://localhost:5000/api/docs or with your favorite API client, I strongly recommend Postman though 👌

Sample Request

Request body for sign up

{
    "firstName": "Charles",
    "lastName": "Rudahigwa",
    "username": "crudahigwa",
    "password": "Password"
}

Response body for signup

{
    "status": 201,
    "message": "Signup successful"
}

Tools used

  • Server-Side Framework: Node/Express
  • Testing framework: Mocha/Chai
  • Database engine: Postgres
  • ORM: Sequelize

Other Tools

Deployments

Contribute

If you ever have an idea on how you might help improve the app, you are welcome to contribute your changes to the repository, Just follow the steps below:

Assumming you have the repo cloned on your PC,

  • Pull the latest changes from the remote repo by running:
git pull origin develop

NB: You need to be on the develop branch when you do this

  • Create & switch to the new branch where you will add your changes by running:
git checkout -b yournewbranchname
  • After adding your changes, commit and push them to create a pull request against the develop branch. I will review and merge them if they are helpful.

Author:

About

Todo App Backend


Languages

Language:JavaScript 99.3%Language:Dockerfile 0.4%Language:Shell 0.3%