Skip to content

maxikSP/api-skeleton

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Donate us Support us Follow us on Twitter

Description

Nest framework TypeScript repository with a Docker.

Installation

  1. Make sure that you have docker, docker-compose apps and node installed, before any further develop activities.
  2. Create a new folder, go in and upload sources from the repo
    # Create folder
    $ mkdir skeleton && cd skeleton
    # Clone source
    $ git clone [email protected]:maxikSP/api-skeleton.git . 

Running the containers and the app

  1. Generate new RSA key pairs (Can be skipped)

    # Generate private key
    $ openssl genrsa -out private.pem 2048
    # Generate public key
    $ openssl rsa -in private.pem -pubout > public.pem
    # Convert the keys to one line string 
    $ awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' private.pem
    $ awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' public.pem
      # Update .env file with your keys
    JWT_PRIVATE_KEY="genearte your private key"
    JWT_PUBLIC_KEY="genearte your public key"
  2. Run docker services

    # Run docker containers
    $ docker compose -f docker-compose.yaml -f docker-compose.api.yaml up --build
  3. Apply database migrations and load data fixtures

    # Bash commands
    $ docker-compose exec api bash 
     # Apply migrations
     $ NODE_ENV=local npm run db:migration:run
    # Load data fixtures
    $ NODE_ENV=local npm run fixtures:load
  4. Project startup in watch mode with access at http://localhost:3000/api/docs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •