andersonmalheiro / ecommerce-auth-microsvc

Microservice for handling authentication in the Ecommerce Microfrontends project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ecommerce Authentication Microservice

Simple microservice that handle authentication related endpoints in an e-commerce app

🧰 Stack

  • TypeScript
  • Nest JS
  • R2DBC
  • Postgres

✨ Features

  • REST API using NestJS
  • JWT authentication
  • TODO:
    • CI/CD
    • Test Coverage

🚀 Running the app

  • Requirements:
    • Node (v14+)
    • Postgres
    • pgAdmin4 (optional)

Develop

  1. First, copy the .env.example in the root dir of the project and rename it to .env . Inside it you will find the environment variables necessary to the project run, so you will need to change the values accordingly.

  2. Now, with pgAdmin or using the command line, create a Database (the name is up to you) and update the DB_NAME value with the name you have chose. Update the rest of the variables according to your database configuration and credentials.

  3. Install the dependencies with: yarn install or npm install;

  4. Generate prisma client:

    $ npx prisma generate
    
  5. Apply prisma migrations to your database:

    $ npx prisma migrate deploy
    
  6. Start the server:

    $ yarn start:dev
    

Production

Run via Docker 🐳:

docker-compose up server

About

Microservice for handling authentication in the Ecommerce Microfrontends project


Languages

Language:TypeScript 94.4%Language:JavaScript 3.2%Language:HTML 1.4%Language:Dockerfile 0.9%