Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .dockerignore
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

Comment on lines +17 to +26

Copilot AI Feb 28, 2026

Copy link

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. Add storage/keys/ (or at least storage/keys/**/*.key) to .dockerignore and provide keys to the container via secrets/volumes instead.

Copilot uses AI. Check for mistakes.
# 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

12 changes: 12 additions & 0 deletions .editorconfig
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
33 changes: 33 additions & 0 deletions .github/workflows/ci.yaml
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'

Copilot AI Feb 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI uses Node.js 24 while package.json declares support for >=22 and the Dockerfile builds/runs on Node 22-alpine. Using a different major in CI can mask runtime issues or introduce Node-version-specific behavior. Consider aligning the workflow to the same major as production (e.g., 22) or testing a matrix that explicitly includes the production version.

Suggested change
node-version: '24'
node-version: '22'

Copilot uses AI. Check for mistakes.
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run linting
run: npm run lint

- name: Build application
run: npm run build
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/myapp
155 changes: 29 additions & 126 deletions .gitignore
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
16 changes: 16 additions & 0 deletions .husky/pre-commit
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!"
9 changes: 9 additions & 0 deletions .prettierrc.json
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"
}
36 changes: 36 additions & 0 deletions Dockerfile
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"]
Loading