Git Product home page Git Product logo

nestjs-tasker's Introduction

MIT License

nestjs-tasker

a task management tool with NestJS

Table of Contents


About

nestjs-tasker is an example Nest.js back-end API that can manage tasks.

Motivation

This repository serves as a learning repository to chronicle my progress from the Udemy course: NestJS Zero to Hero by Ariel Weinberger.

Original code was written by Ariel Weinberger, minor modifications by me (Sophia Brandt).

Built With

Installation

Prerequisites:

You'll need Docker and docker-compose for the Postgres database. The database runs in a Docker container.

$ git clone [email protected]:sophiabrandt/nestjs-tasker.git && cd nestjs-tasker
$ docker-compose build
$ pnpm install # or `npm install`

If you want to use your locally installed Postgres instance, you have to configure the database in the config folder.

Usage

  1. Start application
$ docker-compose up -d
$ pnpm run start:dev # or npm run start:dev

Basic Open API is available under http://localhost:3000/api.

  1. Register user

Register a new user under http://localhost:3000/auth/signup:

$ curl -d '{"username":"janedoe","password":"JaneDoe$333"}' -H "Content-Type: application/json" -X POST http://localhost:3000/auth/signup
  1. Sign in and retrieve auth token on the route http://localhost:3000/auth/signin:
$ TOKEN=$(curl -d '{"username":"janedoe","password":"JaneDoe$333"}' -H "Content-Type: application/json" -X POST http://localhost:3000/auth/signin | jq -r '.accessToken')

We use jq to parse the json response and set the auth token as a bash variable in the command line.

  1. Use the tasks route

Example:

$ curl -H 'Accept: application/json' -H "Authorization: Bearer ${TOKEN}" http://localhost:3000/tasks

Now you can do CRUD operations on http://localhost:3000/tasks when you send the bearer token.

Tests

$ pnpm run test  # or npm run test

License

MIT Licence

Credits

Copyright © 2019 Ariel Weinberger, Sophia Brandt
Original repository

nestjs-tasker's People

Contributors

dependabot[bot] avatar sophiabrandt avatar

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.