Skip to content

ActuallyConnor/nest-js-starter

Repository files navigation

Nest Logo

An API for use by Example

Description

An API for for use by Example

Documentation

API Docs

https://example.com/api-docs/index.html

App Docs

https://example.com/app-docs/index.htmlm

SDK Code Docs

https://example.com/sdk-docs/index.html

Commands

Installation

This project requires Docker

Running the app

Development

# Install dependencies
$ npm install

# Build containers
$ make dev-build
$ make dev-up

Note: this will run with --watch enabled, so it will automatically detect changes and auto-reload the environment

Production

$ npm run start:prod

Test

# integration tests
$ make dev-shell-node-worker

# Once inside the container
$ sh test.sh

TypeORM

See using the TypeORM CLI

# Create migration - name must be in PascalCase
npm run typeorm migration:create -- -n <NameOfMigration>

# Run migrations
npm run typeorm migration:run

# Create - entity name must be in camelCase and you must suffix the name with ".entity"
npm run typeorm entity:create -- -n <entityName>.entity

Creating Nest files

# Create controller
nest g controller controllers/<ControllerName>

# Create module
nest g module modules/<ModuleName>

# Create service
nest g service services/<ServiceName>

SDK

sdk-example

For any questions please reach out to First Last

Docker image

example Docker image

First you need to log in into GitHub's Docker registry. This will require you to log in using a PAT (personal access token) that has read:packages permissions.

# Docker login
docker login ghcr.io -u <GitHub username> -p <GitHub PAT>

Then you can pull the image

docker pull ghcr.io/username/example:latest