Skip to content

This API Rest presents a product server for an ecommerce with Authentication and Authorization using PostgreSQL database relationships.

Notifications You must be signed in to change notification settings

baguilar6174/nest-store-server

Repository files navigation

Nest Logo

Description

This API Rest presents a product server for an ecommerce using PostgreSQL database relationships.

Installation

Clone this repository

git clone https://github.com/baguilar6174/nest-store-server.git

Install dependencies

$ yarn

You need Nest CLI

$ npm i -g @nestjs/cli

Configure and start Database (in the root project)

docker-compose up -d

Clone .env.template file and rename to .env

Complete environment variables

Running the app

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Endpoints

Populate DB (users and products)

http://localhost:300/api/v1/seed

You can find all endpoints here:

Swagger documentation

http://localhost:3000/api
Swagger documentation

Also you can use Postman Collention

My process

Built with

  • Nest JS
  • Typescript
  • PostgreSQL
  • TypeORM

What I learned

  • Nest with TypeScript
  • Restful APIS with PostgreSQL
  • TypeORM
  • Create and using Constrains
  • Data validations and types
  • Nest core building blocks
    • Services
    • Controllers
    • Providers
    • Decorators
    • Gateways
    • Guards
    • Interceptors
    • Exception Filters
    • Modules
  • DTOs (Data Transfer Object)
  • Entities and TypeORM decorators
  • Class Validator
  • Class Transformer
  • Results pagination
  • Tables relationships (one to many | many to one)
  • Query Runner
  • Query Builder
  • Transactions
  • Commits and rollbacks
  • Using File System
  • Authentication
  • Authorization
  • Json Web Tokens
  • Password Hash
  • Nest Passport
  • Protect endpoints
  • Custom Method Decorators
  • Custom Class Decorators
  • Custom Property Decorators
  • Using Tokens
  • Postman documentation
  • Nest Swagger

TODO

  • Use plainToInstance to return a entity with custom fields
  • Use constants (delete magic strings)
  • Api documentation (using Swagger decorators)
  • Refresh token endpoint
  • Timestamps in entities

Stay in touch

About

This API Rest presents a product server for an ecommerce with Authentication and Authorization using PostgreSQL database relationships.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published