-
Notifications
You must be signed in to change notification settings - Fork 0
Implement full-stack TypeScript Hello World demo with Express + Vite #2
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
base: main
Are you sure you want to change the base?
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,13 @@ | ||
| # Docker ignore file | ||
| node_modules | ||
| npm-debug.log | ||
| .env | ||
| .env.local | ||
| dist | ||
| coverage | ||
| .git | ||
| .gitignore | ||
| README.md | ||
| .vscode | ||
| .idea | ||
| *.md | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| PORT=3000 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "env": { | ||
| "es2022": true, | ||
| "node": true, | ||
| "browser": true | ||
| }, | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/recommended" | ||
| ], | ||
| "parser": "@typescript-eslint/parser", | ||
| "parserOptions": { | ||
| "ecmaVersion": "latest", | ||
| "sourceType": "module" | ||
| }, | ||
| "plugins": ["@typescript-eslint"], | ||
| "rules": { | ||
| "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], | ||
| "@typescript-eslint/explicit-function-return-type": "off" | ||
| }, | ||
| "ignorePatterns": ["dist", "node_modules", "*.config.js"] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,48 @@ | ||||||
| name: CI | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: [ main, develop ] | ||||||
| pull_request: | ||||||
| branches: [ main, develop ] | ||||||
|
|
||||||
| jobs: | ||||||
| build-and-test: | ||||||
| runs-on: ubuntu-latest | ||||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
|
|
||||||
| strategy: | ||||||
| matrix: | ||||||
| node-version: [18.x, 20.x] | ||||||
|
|
||||||
| steps: | ||||||
| - name: Checkout code | ||||||
| uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Setup Node.js ${{ matrix.node-version }} | ||||||
| uses: actions/setup-node@v4 | ||||||
| with: | ||||||
| node-version: ${{ matrix.node-version }} | ||||||
| cache: 'npm' | ||||||
|
|
||||||
| - name: Install dependencies | ||||||
| run: npm ci | ||||||
|
|
||||||
| - name: Lint code | ||||||
| run: npm run lint | ||||||
|
|
||||||
| - name: Build backend | ||||||
| run: npm run build | ||||||
|
|
||||||
| - name: Run tests | ||||||
| run: npm test | ||||||
|
|
||||||
| - name: Upload coverage reports | ||||||
| if: matrix.node-version == '20.x' | ||||||
| uses: codecov/codecov-action@v3 | ||||||
| with: | ||||||
| file: ./coverage/coverage-final.json | ||||||
|
||||||
| file: ./coverage/coverage-final.json | |
| file: ./coverage/*.json,./coverage/lcov.info |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Build output | ||
| dist/ | ||
| build/ | ||
| *.tsbuildinfo | ||
|
|
||
| # Environment | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Testing | ||
| coverage/ | ||
| .nyc_output/ | ||
|
|
||
| # Logs | ||
| logs/ | ||
| *.log |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "semi": true, | ||
| "trailingComma": "es5", | ||
| "singleQuote": true, | ||
| "printWidth": 100, | ||
| "tabWidth": 2, | ||
| "useTabs": false, | ||
| "arrowParens": "always" | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||
| # Build stage for backend | ||||||
| FROM node:20-alpine AS backend-builder | ||||||
|
|
||||||
| WORKDIR /app | ||||||
|
|
||||||
| # Copy package files | ||||||
| COPY package*.json ./ | ||||||
| COPY tsconfig.json ./ | ||||||
|
|
||||||
| # Install dependencies | ||||||
| RUN npm ci | ||||||
|
|
||||||
| # Copy source files | ||||||
| COPY src ./src | ||||||
|
|
||||||
| # Build backend | ||||||
| RUN npm run build | ||||||
|
||||||
| RUN npm run build | |
| RUN npx tsc |
Copilot
AI
Nov 17, 2025
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.
Creating a .env.example file inside the Docker image is misleading since this is runtime, not a template for users. The comment says "Create .env file with default values if not exists" but the command creates .env.example, not .env. If the intention is to provide default environment values, they should either be set as ENV variables directly or this line should be removed entirely since environment variables are already set via docker-compose.yml.
| # Create .env file with default values if not exists | |
| RUN echo "PORT=3000" > .env.example |
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.
[nitpick] The
.dockerignorefile excludesREADME.mdon line 10 and then uses a broader pattern*.mdon line 13, which also excludes README.md. The first specific exclusion is redundant. While not harmful, it's cleaner to remove line 10 since line 13 already covers it.