Giter Club home page Giter Club logo

2xleap's Introduction

GoodLeap Project

Installation

yarn install

Running the app

# development
yarn run start

# watch mode
yarn run start:dev

# production mode
yarn run start:prod

Test

# unit tests
yarn run test

# e2e tests
yarn run test:e2e

# test coverage
yarn run test:cov

API Usage

  • GET / - Hello World output, simple testing and open endpoint to verify the API is alive
  • GET /items - Protected endpoint, requires a valid token to access, lists items
  • POST /items - Protected endpoint, requires a valid token to access, adds an item to the list
  • GET /items/:id - Protected endpoint, requires a valid token to access, gets an item by id
  • PATCH /items/:id/complete - Protected endpoint, requires a valid token to access, marks an item as complete
  • DELETE /items/:id - Protected endpoint, requires a valid token to access, deletes an item by id
  • Requests are protected through Bearer-token which is provided in the .env file

Notes

  • First time using NestJS so a lot of this is a learning experience, I like to learn new frameworks
  • Went over the boundary time of 2 hours
  • Test coverage should be 100% - covered caching, invalid inputs, and the like. Just ignored app due to time constraints
  • Basic rate limiter implemented
  • Implemented super basic authentication due to lack of more time to spend. Also added a @Public() decorator to allow for public endpoints
  • I did not create tests for throttling and authentication due to time constraints, but one can verify the authentication is working by visiting / (public) and /items (protected). The tests will demonstrate the routes work, or you can add @Public() to test it yourself.
  • Sensitive information is in .env, but in a real project, much of this would remain a protected secret, naturally
  • For caching, I would seriously consider redis, but I used in memory DB and caching for this project
  • With more time I would more consistently adopt ZOD for schema validation, but the project is a bit inconsistent right now due to time
  • Would setup husky and lint-staged and ci/cd pipeline for a real project
  • With more time, would make sure swagger or similar is setup for automatically generated documentation
  • With more time I would also make it a bit easier to test and make the seeder work in the main application outside of just seeing if the tests run
  • e2e tests were also implemented, run yarn test, yarn test:e2e and yarn test:cov to see the results

2xleap's People

Contributors

lewdcario avatar

Watchers

 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.