/To-Do-Backend

Awesomity Backend Challenge

Primary LanguageJavaScript

Awesomity Backend Challenge ✈️

Awesomity Backend Challenge is a challenge to create a todo BAckend api where the user can Create, Read, Update and Delete.

Badges

CircleCI Reviewed by Hound Coverage Status

Technologies ⚖️ 💻

  • Es6+ Javascript The project was written with ES6 syntax and above.
  • Node/Express A JavaScript runtime built on Chrome's V8 JavaScript engine.
  • PostgreSQL The World's Most Advanced Open Source Relational Database.
  • Pivotal Tracker A project management tool used to manage the app.
  • Npm Used as the package manager for the app. A fast, reliable, and secure dependency management system.
  • Sequelize ORM A powerful library in Javascript that makes it easy to manage a SQL database
  • Swagger-UI For documenting the APis

REST API Docs :clap: :clap:

The Api documentation is done using swagger. View Todo App Documentation

JWT Authentication 🙌 🙌

The API endpoints are being authenticated using JWT(Json Web Token).

Api Features

_____________________________________________________________
METHOD| PATH                     | DESCRIPTIONS              | 
______|__________________________|___________________________|
POST  | /api/auth/signup         | Create a new Auth account |
______|__________________________|___________________________|
POST  | /api/auth/login          | login with email& password|
______|__________________________|___________________________|
PATCH | /api/auth/activate?token | Activate created User     |
______|__________________________|___________________________|
GET   | /api/todo/:id            | get todo by paramId       |
______|__________________________|___________________________|
POST  | /api/todo                |  create a new todo        |
______|__________________________|___________________________|
GET   | /api/todos               | get all todos             |
______|__________________________|___________________________|
GET   | /api/search?q={keyword}  | Search todos              |
______|__________________________|___________________________|
PATCH | /api/todo/:id            | Edit todo item by id      |
______|__________________________|___________________________|
DELETE| /api/todo/:id            | Delete todo item by id    |
______|__________________________|___________________________|
DELETE| /api/todos               | Delete all todos          |
______|__________________________|___________________________|

Installation and Running the Application 💥 💥

  • Before cloning the application you need to have these requirements below

    Prerequisities
  • Node.js installed in your machine it can be downloaded here Install Node

  • Postman installed in your machine it can be downloaded here Install Postman

  • Postgresql installed in your machine it can be downloaded here Install Postgresql

  • Sendgrid Api and it can be got here Sendgrid APi

  • And of course a cup of tea or coffee I prefer coffee

    How to run the project
  • Clone the repository using: git clone https://github.com/tigthor/To-Do-Backend.git

  • Run npm install To install the project dependencies

  • Use .env.examples to set your keys specifically

  • Run npm run statDev To start the application

  • Then access the server on localhost:3000

  • Then Use swagger docs for testing the application

  • Run npm test to run test

  • Build Docker image

    • cd to project folder
    • Run this command docker build -t <image-name>:version .
    • Example: docker build -t to-do-api:latest .

    Run container

    • Run this command docker run --name <container-name> -d -p <any-port-of-your-choice>:4000 <image-name>:<version>
    • Example: docker run --name to-do -d -p 4000:4000 to-do-api:latest

    Using docker compose

    • Make sure you have docker-compose installed
    • cd to the project directory
    • Run docker-compose up build
    • Run docker-compose up

Contributor 🤩 🤩 ❣️

License

[MIT]

© Copyright 2021 Thierry BYIRINGIRO
Byiringiro T.
tigthor