Coder Social home page Coder Social logo

asts-todo-app-backend's Introduction

ASTS-ToDo-App-BackEnd

It's a simple todo list backend API application made with nest js for ASTS candidate selection task, it has all the basic features which a normal todo backend api usually have.

Prerequisite to run this App

  1. Node JS need to be installed.
  2. PostgresSql should be installed and the database server should be running locally
  3. Git is optional.

How to run this app locally

  1. Git clone this repo to your local system - git clone https://github.com/victorpunkd/asts-todo-app-backend.git, if you dont have Git you can just download the entire repo.
  2. Open this project root folder in your local system in cmd or visual studio code terminal and run npm install to install all the dependencies.
  3. Create a new file in the root folder called .env and copy the entire content of ./.env.sample to this file and update the variables accordingly, you need your database name, local port number where the postgres db is running user name and password.
  4. Open this project root folder in your local system in cmd or visual studio code terminal and run npm install to install all the dependencies.
  5. Once the installation is done run npm run start:dev to run the project in dev environment.
  6. By Default the project will start at port no 8080, if you need to change it the update it in ./src/main.ts - app.listen(port no).

How to test it in postman

No authorization are implemented so you dont need a token to test the api.

Endpoints to test

  1. POST - http://localhost:port_no/todos - it will create/instert a new todo item in the db we need to pass this object in the body -

{ "title": "todo item title", "description": "todo item description", "dueDate": "due date in date format", "priority": 1, "isDone": false }

it will return the same object with the assigned id, createdAt and updatedAt date.

  1. GET - http://localhost:8080/todos - it will fetch all the todo items we have in the db

  2. GET - http://localhost:8080/todos/:id - it will fetch that particular todo item which matches with the passed id we have in the db otherwise it will return 404 exception.

  3. DELETE - http://localhost:8080/todos/:id - it will delete that particular todo item which matches with the passed id we have in the db otherwise it will return 404 exception.

  4. PUT - - http://localhost:8080/todos/:id - it will update that particular todo item which matches with the passed id we have in the db otherwise it will return 404 exception. we also need to pass the new updated data in the body

{ "title": "updated todo item title", "description": "updated todo item description", "dueDate": "due date in date format", "priority": 1, "isDone": false }

Features used to build the project

  1. Nest JS
  2. Typescript
  3. SequelizeORM
  4. Postgres SQL

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

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.