A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Copy the .env.sample file and fill in .env
- Build Docker Image: Build a Docker image of your application using the following command:
docker buildx build -t your-app-name .
- Run Docker Container: Run a Docker container using the built image with the following command:
docker run -d -p 3000:3000 your-app-name
Replace your-app-name with the actual name of your Docker image.
-
Access the Application: The application will be accessible at http://localhost:3000.
-
Create docker-compose.yml: Define services, ports, and dependencies in this file.
-
Start Application Run in the directory with docker-compose.yml.
docker-compose up
- Use a
.env.sample
file with sample configuration values for your resources (such as database credentials). Developers can copy this file to .env and customize the values according to their
To create a migration, use the following command:
npx typeorm migration:create src/migrations/your-migration-name
This creates a new migration file in the migrations folder. The file contains up function (instructions for updating the database) and down function (instructions for rolling back changes).
In the migration file, define changes in the up function. For instance, if you're adding a new field, creating a table, or removing an existing field, describe it in the up function. In the down function, specify actions for rollback if needed.
Applying a Migration:
After editing the migration, apply it to the database with the command:
npx typeorm migration:run