Skip to content

Commit a9a634d

Browse files
committed
Init
0 parents  commit a9a634d

Some content is hidden

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

46 files changed

+11134
-0
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Dockerfile
2+
deployment/
3+
docker-compose.yml
4+
scripts/
5+
.circleci/

.env.sample

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
DB_USERNAME=topcoderuser
2+
DB_PASSWORD=randompassword
3+
DB_HOST=127.0.0.1
4+
DB_PORT=5434
5+
DB_NAME=walletdb
6+
DATABASE_URL="postgresql://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable"

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
# Go workspace file
18+
go.work
19+
20+
.idea/*
21+
.idea
22+
23+
.idea/dataSources.xml
24+
# Compiled locally 'main' binary
25+
main
26+
27+
.env
28+
node_modules
29+
dist

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.13.1

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## Description
2+
3+
[Nest](https://github.com/nestjs/nest) framework TypeScript starter pack.
4+
5+
## Project setup
6+
7+
```bash
8+
$ pnpm install
9+
```
10+
11+
## Compile and run the project
12+
13+
```bash
14+
# development
15+
$ pnpm run start
16+
17+
# watch mode
18+
$ pnpm run start:dev
19+
20+
# production mode
21+
$ pnpm run start:prod
22+
```
23+
24+
## Run tests
25+
26+
```bash
27+
# unit tests
28+
$ pnpm run test
29+
30+
# e2e tests
31+
$ pnpm run test:e2e
32+
33+
# test coverage
34+
$ pnpm run test:cov
35+
```
36+
37+
## Database setup
38+
[Prisma](https://www.prisma.io/docs/getting-started) is used to handle DB communication & data migration.
39+
To run a local copy of the database, make sure to copy the contents of ".env.sample" into ".env", and setup your db credentials.
40+
Afterwards, you can just run "npx prisma migrate dev". This will create all the necessary tables in the db.
41+
If you don't have a local setup for postgres, you can use docker to stand up on. Run "docker-compose up -d".

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
postgres:
3+
image: postgres:16
4+
environment:
5+
POSTGRES_USER: ${DB_USERNAME}
6+
POSTGRES_PASSWORD: ${DB_PASSWORD}
7+
POSTGRES_DB: ${DB_NAME}
8+
ports:
9+
- "${DB_PORT}:5432"

eslint.config.mjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// @ts-check
2+
import eslint from '@eslint/js';
3+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
4+
import globals from 'globals';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
{
9+
ignores: ['eslint.config.mjs'],
10+
},
11+
eslint.configs.recommended,
12+
...tseslint.configs.recommendedTypeChecked,
13+
eslintPluginPrettierRecommended,
14+
{
15+
languageOptions: {
16+
globals: {
17+
...globals.node,
18+
...globals.jest,
19+
},
20+
ecmaVersion: 5,
21+
sourceType: 'module',
22+
parserOptions: {
23+
projectService: true,
24+
tsconfigRootDir: import.meta.dirname,
25+
},
26+
},
27+
},
28+
{
29+
rules: {
30+
'@typescript-eslint/no-explicit-any': 'off',
31+
'@typescript-eslint/no-floating-promises': 'warn',
32+
'@typescript-eslint/no-unsafe-argument': 'off',
33+
'@typescript-eslint/no-unsafe-assignment': 'off',
34+
'@typescript-eslint/no-unsafe-call': 'off',
35+
'@typescript-eslint/no-unsafe-member-access': 'off',
36+
},
37+
},
38+
);

nest-cli.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://json.schemastore.org/nest-cli",
3+
"collection": "@nestjs/schematics",
4+
"sourceRoot": "src",
5+
"compilerOptions": {
6+
"builder": "swc",
7+
"deleteOutDir": true
8+
}
9+
}

package.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"name": "tc-payments-api",
3+
"version": "0.0.1",
4+
"description": "",
5+
"author": "",
6+
"private": true,
7+
"license": "UNLICENSED",
8+
"scripts": {
9+
"build": "nest build",
10+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
11+
"start": "nest start",
12+
"start:dev": "nest start --watch",
13+
"start:debug": "nest start --debug --watch",
14+
"start:prod": "node dist/main",
15+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
16+
"test": "jest",
17+
"test:watch": "jest --watch",
18+
"test:cov": "jest --coverage",
19+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
20+
"test:e2e": "jest --config ./test/jest-e2e.json"
21+
},
22+
"dependencies": {
23+
"@nestjs/common": "^11.0.1",
24+
"@nestjs/core": "^11.0.1",
25+
"@nestjs/platform-express": "^11.0.1",
26+
"@nestjs/swagger": "^11.0.3",
27+
"@prisma/client": "^6.3.1",
28+
"class-transformer": "^0.5.1",
29+
"class-validator": "^0.14.1",
30+
"cors": "^2.8.5",
31+
"csv": "^6.3.11",
32+
"jsonwebtoken": "^9.0.2",
33+
"reflect-metadata": "^0.2.2",
34+
"rxjs": "^7.8.1",
35+
"winston": "^3.17.0"
36+
},
37+
"devDependencies": {
38+
"@eslint/eslintrc": "^3.2.0",
39+
"@eslint/js": "^9.18.0",
40+
"@nestjs/cli": "^11.0.0",
41+
"@nestjs/schematics": "^11.0.0",
42+
"@nestjs/testing": "^11.0.1",
43+
"@swc/cli": "^0.6.0",
44+
"@swc/core": "^1.10.7",
45+
"@types/express": "^5.0.0",
46+
"@types/jest": "^29.5.14",
47+
"@types/node": "^22.13.1",
48+
"@types/supertest": "^6.0.2",
49+
"eslint": "^9.18.0",
50+
"eslint-config-prettier": "^10.0.1",
51+
"eslint-plugin-prettier": "^5.2.2",
52+
"globals": "^15.14.0",
53+
"jest": "^29.7.0",
54+
"prettier": "^3.4.2",
55+
"prisma": "^6.3.1",
56+
"source-map-support": "^0.5.21",
57+
"supertest": "^7.0.0",
58+
"ts-jest": "^29.2.5",
59+
"ts-loader": "^9.5.2",
60+
"ts-node": "^10.9.2",
61+
"tsconfig-paths": "^4.2.0",
62+
"typescript": "^5.7.3",
63+
"typescript-eslint": "^8.20.0"
64+
},
65+
"jest": {
66+
"moduleFileExtensions": [
67+
"js",
68+
"json",
69+
"ts"
70+
],
71+
"rootDir": "src",
72+
"testRegex": ".*\\.spec\\.ts$",
73+
"transform": {
74+
"^.+\\.(t|j)s$": "ts-jest"
75+
},
76+
"collectCoverageFrom": [
77+
"**/*.(t|j)s"
78+
],
79+
"coverageDirectory": "../coverage",
80+
"testEnvironment": "node"
81+
},
82+
"prisma": {
83+
"seed": "ts-node prisma/seed.ts"
84+
}
85+
}

0 commit comments

Comments
 (0)