A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript repository with a Docker.
- Make sure that you have docker, docker-compose apps and node installed, before any further develop activities.
- 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 .
-
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"
-
Run docker services
# Run docker containers $ docker compose -f docker-compose.yaml -f docker-compose.api.yaml up --build
-
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
-
Project startup in watch mode with access at http://localhost:3000/api/docs