Skip to content

Commit e7ebaa2

Browse files
authored
Merge pull request #35 from fullstack-development/v5
V5
2 parents 7786f2f + 50b6ffb commit e7ebaa2

File tree

191 files changed

+7461
-24976
lines changed

Some content is hidden

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

191 files changed

+7461
-24976
lines changed

.dockerignore

+6-4
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

+2-2
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

+38-6
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

-4
This file was deleted.

api/.prettierrc.js renamed to .prettierrc.js

+2-1
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

-48
This file was deleted.

README.md

+1-55
Original file line numberDiff line numberDiff line change
@@ -1,55 +1 @@
1-
# Starter kit Node js
2-
3-
## Links
4-
5-
1. [API doc](./api/Readme.md)
6-
7-
## Preparations
8-
### Installation
9-
10-
Do installations step by step:
11-
12-
1. Install dependencies for `api`
13-
14-
```bash
15-
cd ./api
16-
yarn
17-
```
18-
19-
The postinstall script will generate prisma types for you
20-
21-
`On windows can be not work auto generating prisma schema. You can manual copy schema.prisma in api/src/schema.prisma`
22-
23-
2. Then install dependencies for `e2e`
24-
25-
```bash
26-
cd ./e2e
27-
yarn
28-
```
29-
30-
The postinstall script will generate prisma types for you
31-
32-
`On windows can be not work auto generating prisma schema. You can manual copy schema.prisma in e2e/src/schema.prisma`
33-
34-
### Launch
35-
36-
#### Local with docker
37-
38-
1. Run docker containers via docker-compose from the root folder of the repository
39-
40-
```bash
41-
docker compose -f stk.docker-compose.yaml up -d --build
42-
```
43-
44-
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-
```
49-
3. Copy `schema.prisma` from root dir in `api/src/schema.prisma`
50-
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
1+
# Starter kit Node js V5

api.Dockerfile

+19
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

+13
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

-9
This file was deleted.

api/.eslintignore

-1
This file was deleted.

api/.gitignore

-38
This file was deleted.

api/.prettierignore

-1
This file was deleted.

api/Dockerfile.dev

-9
This file was deleted.

api/Readme.md

-31
This file was deleted.

api/buildPrepare.js

-53
This file was deleted.

api/env/dev.example.env

-13
This file was deleted.

api/jest-setup-file.ts

-1
This file was deleted.

0 commit comments

Comments
 (0)