- Node.js >=16.6.0
- NPM >=7.19.1
- MySQL
-
Clone the application from the repository.
-
Install dependencies:
npm ci
-
Create the .env file by copying the .env.example file:
cp .env.example .env
-
Specify the port, JWT key and database connection settings in the .env file.
-
Create database:
sudo mysql -uuser -ppass > CREATE DATABASE `nest-articles-app` CHARACTER SET utf8 COLLATE utf8_general_ci; > exit
Replace user and pass with your username and password, respectively.
-
Run migrations and seeds:
npm run migration:run npm run seed:run
The next steps will be different for development and production modes.
-
Launch the application:
npm run start:dev
-
Create the application build:
npm run build
-
Launch the application:
npm run start:prod
-
Run tests:
npm run test
-
Create database:
sudo mysql -uuser -ppass > CREATE DATABASE `nest-articles-app_test` CHARACTER SET utf8 COLLATE utf8_general_ci; > exit
Replace user and pass with your username and password, respectively.
-
Run tests:
npm run test:e2e