Skip to content

nathanfmachado/api-node-template

Repository files navigation

About this project

This is a simple REST API of products with categories, emulating a simple e-commerce, that can be used as a template. The main technologies used are:

  • Typescript
  • Express
  • Prisma
  • Docker
  • Swagger

Prerequisites - Before running this project

Running app

  • This app is containerized. To start the app locally, up containers:
$ docker compose up -d
  • To stop, run:
$ docker compose stop

Contributing - running outside container

  • Create a .env file and copy the .env.example content

  • Install nvm or other node version package manager

  • Make sure you are using node v20.10.0 and install packages

$ nvm use
$ npm install
  • If containers are running, stop them:
$ docker compose stop
  • Comment the web and migration services on docker-compose.yml and run just the database services:
$ docker compose up -d
  • Run migrations and start local server
$ npm run migrate:generate
$ npm run dev

Testing

  • End to end tests are not implemented yet, but you can run unit test using:
$ npm test

API documentation

  • This app was documented with Swagger. While running this app, you can see the documentation at /docs

About

REST API template with a basic product with category model

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors