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.
- Node JS need to be installed.
- PostgresSql should be installed and the database server should be running locally
- Git is optional.
- 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. - 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. - 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.
- 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.
- Once the installation is done run
npm run start:dev
to run the project in dev environment. - 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).
No authorization are implemented so you dont need a token to test the api.
- 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.
-
GET - http://localhost:8080/todos - it will fetch all the todo items we have in the db
-
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.
-
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.
-
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 }
- Nest JS
- Typescript
- SequelizeORM
- Postgres SQL
A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
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.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.