Skip to content

Commit cccd6c8

Browse files
committed
chore: initial commit
0 parents  commit cccd6c8

File tree

103 files changed

+48468
-0
lines changed

Some content is hidden

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

103 files changed

+48468
-0
lines changed

backend/.dockerignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# IDEs
2+
.idea/
3+
.vscode/
4+
5+
# Project files
6+
dist/
7+
node_modules/
8+
test/
9+
.dockerignore
10+
.gitignore
11+
.eslintrc.js
12+
.prettierrc
13+
jest.config.ts
14+
jest.config.e2e.ts
15+
readme.md

backend/.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
NODE_ENV="development"
2+
HOST="0.0.0.0"
3+
PORT="3000"
4+
5+
DATABASE_URL="postgres://postgres:password@postgres:5432/postgres?sslmode=disable"
6+
7+
GRAPHQL_PLAYGROUND="true"
8+
9+
OPENAI_API_KEY=""
10+
OPENAI_API_URL="https://api.openai.com/v1"
11+
OPENAI_MODEL="gpt-4o-mini"
12+
13+
FIREBASE_CREDENTIALS="/app/firebase-credentials.json"

backend/.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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
36+
37+
# Environment
38+
.env
39+
40+
# Yalc
41+
.yalc
42+
yalc.lock
43+
44+
# Firebase credentials
45+
firebase-credentials.json

backend/.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yarn commitlint --edit $1

backend/.husky/pre-commit

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

backend/.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"tabWidth": 4,
5+
"printWidth": 120,
6+
"plugins": [
7+
"prettier-plugin-organize-imports"
8+
]
9+
}

backend/commitlint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'scope-case': [0, 'always', 'lower-case'],
5+
'subject-case': [0, 'always', 'sentence-case'],
6+
'subject-empty': [0, 'never'],
7+
},
8+
};

backend/docker-compose.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
services:
2+
backend:
3+
image: "node:20"
4+
command: "yarn start:dev"
5+
working_dir: "/app"
6+
restart: "always"
7+
env_file:
8+
- ".env"
9+
ports:
10+
- "3000:3000"
11+
volumes:
12+
- ".:/app"
13+
networks:
14+
- "default"
15+
16+
postgres:
17+
image: "postgres:17.0"
18+
restart: "always"
19+
healthcheck:
20+
test: [ "CMD", "pg_isready", "-U", "${POSTGRES_USER:-postgres}" ]
21+
interval: 10s
22+
timeout: 3s
23+
retries: 3
24+
environment:
25+
POSTGRES_USER: "${POSTGRES_USER:-postgres}"
26+
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-password}"
27+
POSTGRES_DB: "${POSTGRES_DB:-postgres}"
28+
ports:
29+
- "5432:5432"
30+
volumes:
31+
- "postgres_data:/var/lib/postgresql/data"
32+
networks:
33+
- "default"
34+
35+
volumes:
36+
postgres_data:
37+
38+
39+
networks:
40+
default:

backend/eslint.config.mjs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import jsEslint from '@eslint/js';
2+
import prettier from 'eslint-plugin-prettier/recommended';
3+
import pluginUnusedImports from 'eslint-plugin-unused-imports';
4+
import tsEslint from 'typescript-eslint';
5+
6+
export default tsEslint.config(jsEslint.configs.recommended, ...tsEslint.configs.recommended, prettier, {
7+
languageOptions: {
8+
parserOptions: {
9+
project: 'tsconfig.json',
10+
tsconfigRootDir: import.meta.dirname,
11+
sourceType: 'module',
12+
},
13+
},
14+
plugins: {
15+
'unused-imports': pluginUnusedImports,
16+
},
17+
ignores: ['eslint.config.mjs'],
18+
rules: {
19+
'@typescript-eslint/interface-name-prefix': 'off',
20+
'@typescript-eslint/explicit-function-return-type': 'off',
21+
'@typescript-eslint/explicit-module-boundary-types': 'off',
22+
'@typescript-eslint/no-explicit-any': 'off',
23+
'@typescript-eslint/no-unused-vars': 'off',
24+
'unused-imports/no-unused-imports': 'error',
25+
'unused-imports/no-unused-vars': [
26+
'warn',
27+
{
28+
vars: 'all',
29+
varsIgnorePattern: '^_',
30+
args: 'after-used',
31+
argsIgnorePattern: '^_',
32+
ignoreRestSiblings: true,
33+
},
34+
],
35+
},
36+
});

backend/jest.config.e2e.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { Config } from '@jest/types';
2+
import defaultConfig from './jest.config';
3+
4+
const config: Config.InitialOptions = {
5+
...defaultConfig,
6+
testRegex: ['.*\\e2e-spec\\.ts$'],
7+
globalSetup: '<rootDir>/test/setup.e2e.ts',
8+
};
9+
10+
export default config;

0 commit comments

Comments
 (0)