Skip to content

Commit c2a9adb

Browse files
author
hersveit
committed
nest monorepo
1 parent 71929e4 commit c2a9adb

File tree

186 files changed

+7189
-26796
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+7189
-26796
lines changed

.dockerignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
**/node_modules
2-
**/dist
3-
**/build
4-
api/.prisma-lib
1+
.git
2+
node_modules
3+
dist
4+
typeorm.env
5+
api.env
6+

api/.eslintrc.js renamed to .eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
project: './tsconfig.eslint.json',
66
sourceType: 'module',
77
},
8-
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
8+
extends: ['plugin:@typescript-eslint/recommended'],
99
root: true,
1010
env: {
1111
node: true,
@@ -14,7 +14,7 @@ module.exports = {
1414
rules: {
1515
'max-len': [
1616
'error',
17-
100,
17+
120,
1818
{
1919
ignorePattern: '^import\\s.+\\sfrom\\s.+;$',
2020
ignoreUrls: true,

.gitignore

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,41 @@
1-
node_modules/
1+
# compiled output
2+
/dist
3+
/node_modules
4+
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
pnpm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
14+
# OS
15+
.DS_Store
16+
17+
# Tests
18+
/coverage
19+
/.nyc_output
20+
21+
# IDEs and editors
22+
/.idea
23+
.project
24+
.classpath
25+
.c9/
26+
*.launch
27+
.settings/
28+
*.sublime-workspace
29+
30+
# IDE - VSCode
31+
.vscode/*
32+
!.vscode/settings.json
33+
!.vscode/tasks.json
34+
!.vscode/launch.json
35+
!.vscode/extensions.json
236

337
.vscode
4-
yarn-error.log
5-
.env
6-
.e2e.env
738

8-
*/**/node_modules_docker_dev
9-
*/**/.ignore
39+
.env
40+
typeorm.env
41+
api.env

.husky/commit-msg

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
module.exports = {
2+
plugins: ['prettier-plugin-organize-imports'],
23
bracketSpacing: true,
34
jsxBracketSameLine: false,
4-
printWidth: 100,
5+
printWidth: 120,
56
semi: true,
67
singleQuote: true,
78
tabWidth: 4,

Dockerfile.api

Lines changed: 0 additions & 61 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
1. [API doc](./api/Readme.md)
66

77
## Preparations
8+
89
### Installation
910

1011
Do installations step by step:
@@ -37,19 +38,19 @@ Do installations step by step:
3738

3839
1. Run docker containers via docker-compose from the root folder of the repository
3940

40-
```bash
41-
docker compose -f stk.docker-compose.yaml up -d --build
42-
```
41+
```bash
42+
docker compose -f stk.docker-compose.yaml up -d --build
43+
```
4344

4445
2. Go to `api/env` folder and create copy of `dev.example.env` to `dev.env`
45-
```bash
46-
cd ./api/env
47-
cp ./dev.example.env ./dev.env
48-
```
46+
```bash
47+
cd ./api/env
48+
cp ./dev.example.env ./dev.env
49+
```
4950
3. Copy `schema.prisma` from root dir in `api/src/schema.prisma`
5051
4. Go up to `api` and launch migrations
51-
```bash
52-
cd ../
53-
source ./env/dev.env && DATABASE_URL=$DATABASE_URL yarn prisma:migrate:deploy
54-
```
55-
- Press `Yes (y)` if it asks you to install missed dependencies
52+
```bash
53+
cd ../
54+
source ./env/dev.env && DATABASE_URL=$DATABASE_URL yarn prisma:migrate:deploy
55+
```
56+
- Press `Yes (y)` if it asks you to install missed dependencies

api.Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM node:18-alpine3.18 AS dependencies
2+
RUN npm install -g pnpm
3+
USER node
4+
RUN mkdir -p /home/node/app
5+
WORKDIR /home/node/app
6+
COPY --chown=node . .
7+
RUN pnpm i
8+
9+
FROM dependencies AS build
10+
WORKDIR /home/node/app
11+
RUN pnpm run api:build
12+
13+
FROM node:18-alpine3.18
14+
RUN npm install -g pnpm
15+
USER node
16+
RUN mkdir -p /home/node/app
17+
WORKDIR /home/node/app
18+
COPY --chown=node --from=build /home/node/app .
19+
CMD ["pnpm", "run", "api:prod"]

api.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
PORT=3000
2+
3+
DB_NAME="stk_db"
4+
DB_HOST="localhost"
5+
DB_USERNAME="admin"
6+
DB_PASSWORD="1234"
7+
DB_PORT=5432
8+
DOMAIN=https://localhost
9+
10+
JWT_SECRET="123"
11+
JWT_EXPIRES_IN="2min"
12+
JWT_REFRESH_SECRET="321"
13+
JWT_REFRESH_EXPIRES_IN="2days"

api/.dockerignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)