-
Notifications
You must be signed in to change notification settings - Fork 1
basic setup with modular monolith & auth #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Dependencies | ||
| node_modules | ||
|
|
||
| # Build output | ||
| dist | ||
|
|
||
| # Git | ||
| .git | ||
| .gitignore | ||
|
|
||
| # IDE | ||
| .vscode | ||
| .idea | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # Logs | ||
| *.log | ||
| storage/logs/* | ||
| !storage/logs/.gitkeep | ||
|
|
||
| # Environment files | ||
| .env | ||
| .env.* | ||
| !env.example | ||
|
|
||
| # Documentation | ||
| *.md | ||
| docs | ||
|
|
||
| # Tests | ||
| **/*.test.ts | ||
| **/*.spec.ts | ||
| coverage | ||
| .nyc_output | ||
|
|
||
| # OS files | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Docker | ||
| Dockerfile | ||
| docker-compose*.yml | ||
| .dockerignore | ||
|
|
||
| # Husky | ||
| .husky | ||
|
|
||
| # GitHub | ||
| .github | ||
|
|
||
| # Misc | ||
| *.tgz | ||
| *.tar.gz | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
| indent_style = space | ||
| indent_size = 4 | ||
|
|
||
| [*.md] | ||
| trim_trailing_whitespace = false |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||
| name: CI Pipeline | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: [main] | ||||||
| pull_request: | ||||||
| branches: [main] | ||||||
| types: [opened, synchronize, reopened] | ||||||
|
|
||||||
| jobs: | ||||||
| ci: | ||||||
| name: Build & Lint | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Checkout code | ||||||
| uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Setup Node.js | ||||||
| uses: actions/setup-node@v4 | ||||||
| with: | ||||||
| node-version: '24' | ||||||
|
||||||
| node-version: '24' | |
| node-version: '22' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,139 +1,42 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| lerna-debug.log* | ||
|
|
||
| # Diagnostic reports (https://nodejs.org/api/report.html) | ||
| report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
|
||
| # Runtime data | ||
| pids | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Directory for instrumented libs generated by jscoverage/JSCover | ||
| lib-cov | ||
|
|
||
| # Coverage directory used by tools like istanbul | ||
| coverage | ||
| *.lcov | ||
|
|
||
| # nyc test coverage | ||
| .nyc_output | ||
|
|
||
| # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
| .grunt | ||
|
|
||
| # Bower dependency directory (https://bower.io/) | ||
| bower_components | ||
|
|
||
| # node-waf configuration | ||
| .lock-wscript | ||
|
|
||
| # Compiled binary addons (https://nodejs.org/api/addons.html) | ||
| build/Release | ||
|
|
||
| # Dependency directories | ||
| # Dependencies | ||
| node_modules/ | ||
| jspm_packages/ | ||
|
|
||
| # Snowpack dependency directory (https://snowpack.dev/) | ||
| web_modules/ | ||
|
|
||
| # TypeScript cache | ||
| *.tsbuildinfo | ||
|
|
||
| # Optional npm cache directory | ||
| .npm | ||
|
|
||
| # Optional eslint cache | ||
| .eslintcache | ||
|
|
||
| # Optional stylelint cache | ||
| .stylelintcache | ||
|
|
||
| # Optional REPL history | ||
| .node_repl_history | ||
| # Build output | ||
| dist/ | ||
|
|
||
| # Output of 'npm pack' | ||
| *.tgz | ||
|
|
||
| # Yarn Integrity file | ||
| .yarn-integrity | ||
|
|
||
| # dotenv environment variable files | ||
| # Environment | ||
| .env | ||
| .env.* | ||
| !.env.example | ||
|
|
||
| # parcel-bundler cache (https://parceljs.org/) | ||
| .cache | ||
| .parcel-cache | ||
|
|
||
| # Next.js build output | ||
| .next | ||
| out | ||
|
|
||
| # Nuxt.js build / generate output | ||
| .nuxt | ||
| dist | ||
|
|
||
| # Gatsby files | ||
| .cache/ | ||
| # Comment in the public line in if your project uses Gatsby and not Next.js | ||
| # https://nextjs.org/blog/next-9-1#public-directory-support | ||
| # public | ||
|
|
||
| # vuepress build output | ||
| .vuepress/dist | ||
|
|
||
| # vuepress v2.x temp and cache directory | ||
| .temp | ||
| .cache | ||
| !env.example | ||
|
|
||
| # Sveltekit cache directory | ||
| .svelte-kit/ | ||
|
|
||
| # vitepress build output | ||
| **/.vitepress/dist | ||
|
|
||
| # vitepress cache directory | ||
| **/.vitepress/cache | ||
|
|
||
| # Docusaurus cache and generated files | ||
| .docusaurus | ||
|
|
||
| # Serverless directories | ||
| .serverless/ | ||
| # Logs | ||
| *.log | ||
| storage/logs/* | ||
| !storage/logs/.gitkeep | ||
|
|
||
| # FuseBox cache | ||
| .fusebox/ | ||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
|
|
||
| # DynamoDB Local files | ||
| .dynamodb/ | ||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Firebase cache directory | ||
| .firebase/ | ||
| # TypeScript | ||
| *.tsbuildinfo | ||
|
|
||
| # TernJS port file | ||
| .tern-port | ||
| # Test coverage | ||
| coverage/ | ||
| .nyc_output/ | ||
|
|
||
| # Stores VSCode versions used for testing VSCode extensions | ||
| .vscode-test | ||
| # RSA keys (generated per project) | ||
| storage/keys/**/*.key | ||
| storage/keys/**/*.pub | ||
| !storage/keys/**/.gitkeep | ||
|
|
||
| # yarn v3 | ||
| .pnp.* | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/sdks | ||
| !.yarn/versions | ||
| # Prisma generated client | ||
| src/database/prisma/ | ||
|
|
||
| # Vite logs files | ||
| vite.config.js.timestamp-* | ||
| vite.config.ts.timestamp-* | ||
| # npm | ||
| .npm | ||
| *.tgz |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/usr/bin/env sh | ||
| set -e | ||
|
|
||
| # Run linting with auto-fix | ||
| echo "📝 Fixing and checking code style..." | ||
| npm run lint:fix || exit 1 | ||
|
|
||
| # Run linting | ||
| echo "📝 Checking code style..." | ||
| npm run lint || exit 1 | ||
|
|
||
| # Build application | ||
| echo "🔨 Building application..." | ||
| npm run build || exit 1 | ||
|
|
||
| echo "✅ All pre-commit checks passed!" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "tabWidth": 4, | ||
| "useTabs": false, | ||
| "semi": true, | ||
| "singleQuote": true, | ||
| "trailingComma": "none", | ||
| "printWidth": 120, | ||
| "arrowParens": "avoid" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Build stage | ||
| FROM node:22-alpine AS builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY package*.json ./ | ||
| RUN npm ci | ||
|
|
||
| COPY . . | ||
| RUN npm run build | ||
|
|
||
| # Production stage | ||
| FROM node:22-alpine AS production | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| RUN apk add --no-cache curl | ||
|
|
||
| COPY package*.json ./ | ||
| RUN npm ci --omit=dev | ||
|
|
||
| COPY --from=builder /app/dist ./dist | ||
| COPY --from=builder /app/storage ./storage | ||
|
|
||
| RUN addgroup -g 1001 -S nodejs && \ | ||
| adduser -S nodejs -u 1001 -G nodejs && \ | ||
| chown -R nodejs:nodejs /app | ||
|
|
||
| USER nodejs | ||
|
|
||
| EXPOSE 8070 | ||
|
|
||
| HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ | ||
| CMD curl -f http://localhost:8070/health || exit 1 | ||
|
|
||
| CMD ["node", "dist/index.js"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
storage/keys/*is not excluded from the Docker build context. If a developer has generated RSA keys locally,COPY . .in the build stage can bake those private keys into the image layers. Addstorage/keys/(or at leaststorage/keys/**/*.key) to.dockerignoreand provide keys to the container via secrets/volumes instead.