Skip to content

Commit c86aef2

Browse files
authored
Merge pull request #472 from yunchipang/typescript-branch
feat: port over /auth
2 parents 766937d + dfd32b5 commit c86aef2

40 files changed

+3432
-1674
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
node: true,
1616
jest: true,
1717
},
18-
ignorePatterns: ['.eslintrc.js', 'database/migrations'],
18+
ignorePatterns: ['.eslintrc.js', 'database/migrations', 'dist/**'],
1919
rules: {
2020
'@typescript-eslint/interface-name-prefix': 'off',
2121
'@typescript-eslint/explicit-function-return-type': 'off',

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ dist/
1919
*.log
2020

2121
#IDEA
22-
.idea
22+
.idea
23+
24+
.DS_Store

Dockerfile

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
FROM node:16-alpine
22
WORKDIR /app
33
ENV PATH /app/node_modules/.bin:$PATH
4-
COPY package.json ./
5-
COPY package-lock.json ./
4+
COPY package.json package-lock.json ./
65
RUN npm ci --silent
7-
COPY . ./
8-
CMD [ "node", "." ]
6+
COPY . .
7+
RUN npm run build
8+
EXPOSE 3006
9+
# CMD ["node", "dist/main"]
10+
CMD ["npm", "run", "start:dev"]

docker-compose.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
version: '3.1'
22

3-
services:
4-
db:
3+
services:
4+
db:
55
image: postgres:9-alpine
66
restart: always
77
environment:
88
- POSTGRES_USER=wallet_user
99
- POSTGRES_PASSWORD=secret
10-
ports:
11-
- 5432:5432
12-
volumes:
10+
ports:
11+
- '5432:5432'
12+
volumes:
1313
- postgres_volume:/var/lib/postgresql
1414

15+
app:
16+
build: .
17+
restart: always
18+
environment:
19+
- DATABASE_URL=postgresql://wallet_user:secret@db:5432/wallet_user
20+
- NODE_ENV=development
21+
ports:
22+
- '3006:3006'
23+
depends_on:
24+
- db
1525

1626
volumes:
17-
postgres_volume: {}
27+
postgres_volume: {}

jest.config.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { Config } from '@jest/types';
2+
3+
const config: Config.InitialOptions = {
4+
moduleFileExtensions: ['js', 'json', 'ts'],
5+
rootDir: 'src',
6+
testRegex: '.*\\.spec\\.ts$',
7+
transform: {
8+
'^.+\\.(t|j)s$': 'ts-jest',
9+
},
10+
collectCoverageFrom: ['**/*.(t|j)s'],
11+
coverageDirectory: '../coverage',
12+
testEnvironment: 'node',
13+
};
14+
15+
export default config;

0 commit comments

Comments
 (0)