- Node.js
- Typescript
- Express.js
- MikroORM
- Passport
- PostgreSQL
- Prettier
- Clone this repo
- Install dependencies with
yarn install
- Rename
.env.sample
to.env
- Update variables in
.env
file - If you're using different DB than PostgreSQL run these commands
1. Remove @mikro-cli/postgresql package - `yarn remove @mikro-cli/postgresql` 2. Install different DB driver (https://mikro-orm.io/docs/installation/) - e.g. `yarn add @mikro-cli/mysql` 3. Update `DB_TYPE` variable in `.env` file
- Run migrations
- Run project in development mode with
yarn dev
- Clone this repo to deployment server
- Install dependencies
yarn install
- Rename
.env.sample
to.env
- Update variables in
.env
file - Build app with
yarn build
- Create
frontend
folder inside./dist
- Copy built React app into
./dist/frontend
folder
All commands are specified inside package.json
file
Running app in development
mode (auto-compile & auto-restart after change).
Builds app into dist
folder
Running built app from dist
folder
Generates entities from DB & saves them into src/db/entities
folder
Creates a new migration file (in src/db/migrations
) witch applied changes inside entities
Applies all (not applied) migrations to DB
$ docker build . -t node-typescript-api
$ docker run -p 8000:8000 -d --env-file .env --name api-starter node-typescript-api:latest
TODO