create-nexu 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +149 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.js +603 -0
  4. package/package.json +41 -0
  5. package/templates/default/.changeset/config.json +11 -0
  6. package/templates/default/.eslintignore +13 -0
  7. package/templates/default/.eslintrc.js +66 -0
  8. package/templates/default/.github/actions/quality/action.yml +53 -0
  9. package/templates/default/.github/dependabot.yml +51 -0
  10. package/templates/default/.github/workflows/deploy-dev.yml +83 -0
  11. package/templates/default/.github/workflows/deploy-prod.yml +83 -0
  12. package/templates/default/.github/workflows/deploy-rec.yml +83 -0
  13. package/templates/default/.husky/commit-msg +1 -0
  14. package/templates/default/.husky/pre-commit +1 -0
  15. package/templates/default/.prettierignore +7 -0
  16. package/templates/default/.prettierrc +19 -0
  17. package/templates/default/.vscode/extensions.json +14 -0
  18. package/templates/default/.vscode/settings.json +36 -0
  19. package/templates/default/apps/.gitkeep +0 -0
  20. package/templates/default/commitlint.config.js +26 -0
  21. package/templates/default/docker/docker-compose.dev.yml +49 -0
  22. package/templates/default/docker/docker-compose.prod.yml +64 -0
  23. package/templates/default/docker/docker-compose.yml +5 -0
  24. package/templates/default/package.json +56 -0
  25. package/templates/default/packages/cache/package.json +26 -0
  26. package/templates/default/packages/cache/src/index.ts +137 -0
  27. package/templates/default/packages/cache/tsconfig.json +9 -0
  28. package/templates/default/packages/cache/tsup.config.ts +9 -0
  29. package/templates/default/packages/config/eslint/index.js +20 -0
  30. package/templates/default/packages/config/package.json +9 -0
  31. package/templates/default/packages/config/typescript/base.json +26 -0
  32. package/templates/default/packages/constants/package.json +26 -0
  33. package/templates/default/packages/constants/src/index.ts +121 -0
  34. package/templates/default/packages/constants/tsconfig.json +9 -0
  35. package/templates/default/packages/constants/tsup.config.ts +9 -0
  36. package/templates/default/packages/logger/package.json +27 -0
  37. package/templates/default/packages/logger/src/index.ts +197 -0
  38. package/templates/default/packages/logger/tsconfig.json +11 -0
  39. package/templates/default/packages/logger/tsup.config.ts +9 -0
  40. package/templates/default/packages/result/package.json +26 -0
  41. package/templates/default/packages/result/src/index.ts +142 -0
  42. package/templates/default/packages/result/tsconfig.json +9 -0
  43. package/templates/default/packages/result/tsup.config.ts +9 -0
  44. package/templates/default/packages/types/package.json +26 -0
  45. package/templates/default/packages/types/src/index.ts +78 -0
  46. package/templates/default/packages/types/tsconfig.json +9 -0
  47. package/templates/default/packages/types/tsup.config.ts +10 -0
  48. package/templates/default/packages/ui/package.json +38 -0
  49. package/templates/default/packages/ui/src/components/Button.tsx +65 -0
  50. package/templates/default/packages/ui/src/components/Card.tsx +90 -0
  51. package/templates/default/packages/ui/src/components/Input.tsx +51 -0
  52. package/templates/default/packages/ui/src/index.ts +15 -0
  53. package/templates/default/packages/ui/tsconfig.json +11 -0
  54. package/templates/default/packages/ui/tsup.config.ts +11 -0
  55. package/templates/default/packages/utils/package.json +30 -0
  56. package/templates/default/packages/utils/src/index.test.ts +130 -0
  57. package/templates/default/packages/utils/src/index.ts +154 -0
  58. package/templates/default/packages/utils/tsconfig.json +10 -0
  59. package/templates/default/packages/utils/tsup.config.ts +10 -0
  60. package/templates/default/pnpm-workspace.yaml +3 -0
  61. package/templates/default/scripts/deploy.sh +25 -0
  62. package/templates/default/scripts/generate-app.sh +166 -0
  63. package/templates/default/scripts/publish-cli.sh +54 -0
  64. package/templates/default/scripts/setup.sh +70 -0
  65. package/templates/default/services/.env.example +16 -0
  66. package/templates/default/services/docker-compose.yml +207 -0
  67. package/templates/default/services/grafana/provisioning/dashboards/dashboards.yml +11 -0
  68. package/templates/default/services/grafana/provisioning/datasources/datasources.yml +9 -0
  69. package/templates/default/services/postgres/init/.gitkeep +2 -0
  70. package/templates/default/services/prometheus/prometheus.yml +13 -0
  71. package/templates/default/tsconfig.json +27 -0
  72. package/templates/default/turbo.json +40 -0
  73. package/templates/default/vitest.config.ts +15 -0
@@ -0,0 +1,66 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ browser: true,
5
+ es2024: true,
6
+ node: true,
7
+ },
8
+ extends: [
9
+ 'eslint:recommended',
10
+ 'plugin:@typescript-eslint/recommended',
11
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
12
+ 'prettier',
13
+ ],
14
+ parser: '@typescript-eslint/parser',
15
+ parserOptions: {
16
+ ecmaVersion: 'latest',
17
+ sourceType: 'module',
18
+ project: ['./tsconfig.json', './apps/*/tsconfig.json', './packages/*/tsconfig.json'],
19
+ },
20
+ plugins: ['@typescript-eslint', 'import', 'unused-imports'],
21
+ rules: {
22
+ // TypeScript
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
+ },
33
+ ],
34
+ '@typescript-eslint/explicit-function-return-type': 'off',
35
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
36
+ '@typescript-eslint/no-explicit-any': 'warn',
37
+ '@typescript-eslint/no-floating-promises': 'error',
38
+ '@typescript-eslint/await-thenable': 'error',
39
+
40
+ // Import
41
+ 'import/order': [
42
+ 'error',
43
+ {
44
+ groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
45
+ 'newlines-between': 'always',
46
+ alphabetize: { order: 'asc', caseInsensitive: true },
47
+ },
48
+ ],
49
+ 'import/no-duplicates': 'error',
50
+
51
+ // General
52
+ 'no-console': ['warn', { allow: ['warn', 'error'] }],
53
+ 'prefer-const': 'error',
54
+ 'no-var': 'error',
55
+ },
56
+ ignorePatterns: [
57
+ 'node_modules',
58
+ 'dist',
59
+ '.next',
60
+ 'coverage',
61
+ '*.config.js',
62
+ '*.config.mjs',
63
+ '.eslintrc.js',
64
+ 'commitlint.config.js',
65
+ ],
66
+ };
@@ -0,0 +1,53 @@
1
+ name: 'Quality Check'
2
+ description: 'Run lint, format, typecheck, and tests'
3
+
4
+ inputs:
5
+ turbo-token:
6
+ description: 'Turbo remote cache token'
7
+ required: false
8
+ turbo-team:
9
+ description: 'Turbo team name'
10
+ required: false
11
+
12
+ runs:
13
+ using: 'composite'
14
+ steps:
15
+ - name: Setup pnpm
16
+ uses: pnpm/action-setup@v3
17
+ with:
18
+ version: 9
19
+
20
+ - name: Setup Node.js
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: 20
24
+ cache: 'pnpm'
25
+
26
+ - name: Install dependencies
27
+ shell: bash
28
+ run: pnpm install --frozen-lockfile
29
+
30
+ - name: Lint
31
+ shell: bash
32
+ run: pnpm lint
33
+ env:
34
+ TURBO_TOKEN: ${{ inputs.turbo-token }}
35
+ TURBO_TEAM: ${{ inputs.turbo-team }}
36
+
37
+ - name: Format Check
38
+ shell: bash
39
+ run: pnpm format:check
40
+
41
+ - name: Type Check
42
+ shell: bash
43
+ run: pnpm typecheck
44
+ env:
45
+ TURBO_TOKEN: ${{ inputs.turbo-token }}
46
+ TURBO_TEAM: ${{ inputs.turbo-team }}
47
+
48
+ - name: Test
49
+ shell: bash
50
+ run: pnpm test
51
+ env:
52
+ TURBO_TOKEN: ${{ inputs.turbo-token }}
53
+ TURBO_TEAM: ${{ inputs.turbo-team }}
@@ -0,0 +1,51 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: 'npm'
4
+ directory: '/'
5
+ schedule:
6
+ interval: 'weekly'
7
+ day: 'monday'
8
+ open-pull-requests-limit: 10
9
+ groups:
10
+ typescript:
11
+ patterns:
12
+ - 'typescript'
13
+ - '@typescript-eslint/*'
14
+ update-types:
15
+ - 'minor'
16
+ - 'patch'
17
+ eslint:
18
+ patterns:
19
+ - 'eslint*'
20
+ update-types:
21
+ - 'minor'
22
+ - 'patch'
23
+ testing:
24
+ patterns:
25
+ - 'vitest'
26
+ - '@vitest/*'
27
+ update-types:
28
+ - 'minor'
29
+ - 'patch'
30
+ build:
31
+ patterns:
32
+ - 'turbo'
33
+ - 'tsup'
34
+ update-types:
35
+ - 'minor'
36
+ - 'patch'
37
+ commit-message:
38
+ prefix: 'chore(deps)'
39
+ labels:
40
+ - 'dependencies'
41
+
42
+ - package-ecosystem: 'github-actions'
43
+ directory: '/'
44
+ schedule:
45
+ interval: 'weekly'
46
+ day: 'monday'
47
+ commit-message:
48
+ prefix: 'ci(deps)'
49
+ labels:
50
+ - 'dependencies'
51
+ - 'ci'
@@ -0,0 +1,83 @@
1
+ name: Deploy Dev
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - dev
7
+
8
+ env:
9
+ REGISTRY: ghcr.io
10
+ IMAGE_NAME: ${{ github.repository }}
11
+ ENVIRONMENT: development
12
+
13
+ jobs:
14
+ quality:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Quality Check
21
+ uses: ./.github/actions/quality
22
+ with:
23
+ turbo-token: ${{ secrets.TURBO_TOKEN }}
24
+ turbo-team: ${{ vars.TURBO_TEAM }}
25
+
26
+ build-and-deploy:
27
+ runs-on: ubuntu-latest
28
+ needs: quality
29
+ environment: development
30
+
31
+ steps:
32
+ - name: Checkout
33
+ uses: actions/checkout@v4
34
+
35
+ - name: Build
36
+ uses: ./.github/actions/build
37
+ with:
38
+ turbo-token: ${{ secrets.TURBO_TOKEN }}
39
+ turbo-team: ${{ vars.TURBO_TEAM }}
40
+
41
+ - name: Set up Docker Buildx
42
+ uses: docker/setup-buildx-action@v3
43
+
44
+ - name: Login to Container Registry
45
+ uses: docker/login-action@v3
46
+ with:
47
+ registry: ${{ env.REGISTRY }}
48
+ username: ${{ github.actor }}
49
+ password: ${{ secrets.GITHUB_TOKEN }}
50
+
51
+ - name: Get app list
52
+ id: apps
53
+ run: |
54
+ if [ -d "apps" ] && [ "$(ls -A apps 2>/dev/null)" ]; then
55
+ APPS=$(ls -d apps/*/ 2>/dev/null | xargs -n1 basename | tr '\n' ' ')
56
+ echo "list=$APPS" >> $GITHUB_OUTPUT
57
+ echo "exists=true" >> $GITHUB_OUTPUT
58
+ else
59
+ echo "exists=false" >> $GITHUB_OUTPUT
60
+ fi
61
+
62
+ - name: Build and push images
63
+ if: steps.apps.outputs.exists == 'true'
64
+ run: |
65
+ for APP in ${{ steps.apps.outputs.list }}; do
66
+ if [ -f "apps/$APP/docker/Dockerfile" ]; then
67
+ echo "Building $APP..."
68
+ docker build \
69
+ -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }} \
70
+ -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }} \
71
+ -f apps/$APP/docker/Dockerfile \
72
+ .
73
+ docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }}
74
+ docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }}
75
+ fi
76
+ done
77
+
78
+ - name: Deploy summary
79
+ run: |
80
+ echo "## Deployment Summary" >> $GITHUB_STEP_SUMMARY
81
+ echo "- **Environment:** ${{ env.ENVIRONMENT }}" >> $GITHUB_STEP_SUMMARY
82
+ echo "- **Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
83
+ echo "- **Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
@@ -0,0 +1,83 @@
1
+ name: Deploy Prod
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ env:
9
+ REGISTRY: ghcr.io
10
+ IMAGE_NAME: ${{ github.repository }}
11
+ ENVIRONMENT: production
12
+
13
+ jobs:
14
+ quality:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Quality Check
21
+ uses: ./.github/actions/quality
22
+ with:
23
+ turbo-token: ${{ secrets.TURBO_TOKEN }}
24
+ turbo-team: ${{ vars.TURBO_TEAM }}
25
+
26
+ build-and-deploy:
27
+ runs-on: ubuntu-latest
28
+ needs: quality
29
+ environment: production
30
+
31
+ steps:
32
+ - name: Checkout
33
+ uses: actions/checkout@v4
34
+
35
+ - name: Build
36
+ uses: ./.github/actions/build
37
+ with:
38
+ turbo-token: ${{ secrets.TURBO_TOKEN }}
39
+ turbo-team: ${{ vars.TURBO_TEAM }}
40
+
41
+ - name: Set up Docker Buildx
42
+ uses: docker/setup-buildx-action@v3
43
+
44
+ - name: Login to Container Registry
45
+ uses: docker/login-action@v3
46
+ with:
47
+ registry: ${{ env.REGISTRY }}
48
+ username: ${{ github.actor }}
49
+ password: ${{ secrets.GITHUB_TOKEN }}
50
+
51
+ - name: Get app list
52
+ id: apps
53
+ run: |
54
+ if [ -d "apps" ] && [ "$(ls -A apps 2>/dev/null)" ]; then
55
+ APPS=$(ls -d apps/*/ 2>/dev/null | xargs -n1 basename | tr '\n' ' ')
56
+ echo "list=$APPS" >> $GITHUB_OUTPUT
57
+ echo "exists=true" >> $GITHUB_OUTPUT
58
+ else
59
+ echo "exists=false" >> $GITHUB_OUTPUT
60
+ fi
61
+
62
+ - name: Build and push images
63
+ if: steps.apps.outputs.exists == 'true'
64
+ run: |
65
+ for APP in ${{ steps.apps.outputs.list }}; do
66
+ if [ -f "apps/$APP/docker/Dockerfile" ]; then
67
+ echo "Building $APP..."
68
+ docker build \
69
+ -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }} \
70
+ -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }} \
71
+ -f apps/$APP/docker/Dockerfile \
72
+ .
73
+ docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }}
74
+ docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }}
75
+ fi
76
+ done
77
+
78
+ - name: Deploy summary
79
+ run: |
80
+ echo "## Deployment Summary" >> $GITHUB_STEP_SUMMARY
81
+ echo "- **Environment:** ${{ env.ENVIRONMENT }}" >> $GITHUB_STEP_SUMMARY
82
+ echo "- **Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
83
+ echo "- **Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
@@ -0,0 +1,83 @@
1
+ name: Deploy Rec
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - rec
7
+
8
+ env:
9
+ REGISTRY: ghcr.io
10
+ IMAGE_NAME: ${{ github.repository }}
11
+ ENVIRONMENT: recette
12
+
13
+ jobs:
14
+ quality:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Quality Check
21
+ uses: ./.github/actions/quality
22
+ with:
23
+ turbo-token: ${{ secrets.TURBO_TOKEN }}
24
+ turbo-team: ${{ vars.TURBO_TEAM }}
25
+
26
+ build-and-deploy:
27
+ runs-on: ubuntu-latest
28
+ needs: quality
29
+ environment: recette
30
+
31
+ steps:
32
+ - name: Checkout
33
+ uses: actions/checkout@v4
34
+
35
+ - name: Build
36
+ uses: ./.github/actions/build
37
+ with:
38
+ turbo-token: ${{ secrets.TURBO_TOKEN }}
39
+ turbo-team: ${{ vars.TURBO_TEAM }}
40
+
41
+ - name: Set up Docker Buildx
42
+ uses: docker/setup-buildx-action@v3
43
+
44
+ - name: Login to Container Registry
45
+ uses: docker/login-action@v3
46
+ with:
47
+ registry: ${{ env.REGISTRY }}
48
+ username: ${{ github.actor }}
49
+ password: ${{ secrets.GITHUB_TOKEN }}
50
+
51
+ - name: Get app list
52
+ id: apps
53
+ run: |
54
+ if [ -d "apps" ] && [ "$(ls -A apps 2>/dev/null)" ]; then
55
+ APPS=$(ls -d apps/*/ 2>/dev/null | xargs -n1 basename | tr '\n' ' ')
56
+ echo "list=$APPS" >> $GITHUB_OUTPUT
57
+ echo "exists=true" >> $GITHUB_OUTPUT
58
+ else
59
+ echo "exists=false" >> $GITHUB_OUTPUT
60
+ fi
61
+
62
+ - name: Build and push images
63
+ if: steps.apps.outputs.exists == 'true'
64
+ run: |
65
+ for APP in ${{ steps.apps.outputs.list }}; do
66
+ if [ -f "apps/$APP/docker/Dockerfile" ]; then
67
+ echo "Building $APP..."
68
+ docker build \
69
+ -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }} \
70
+ -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }} \
71
+ -f apps/$APP/docker/Dockerfile \
72
+ .
73
+ docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }}
74
+ docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }}
75
+ fi
76
+ done
77
+
78
+ - name: Deploy summary
79
+ run: |
80
+ echo "## Deployment Summary" >> $GITHUB_STEP_SUMMARY
81
+ echo "- **Environment:** ${{ env.ENVIRONMENT }}" >> $GITHUB_STEP_SUMMARY
82
+ echo "- **Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
83
+ echo "- **Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
@@ -0,0 +1 @@
1
+ pnpm commitlint --edit $1
@@ -0,0 +1 @@
1
+ pnpm lint-staged
@@ -0,0 +1,7 @@
1
+ node_modules
2
+ dist
3
+ .next
4
+ coverage
5
+ pnpm-lock.yaml
6
+ *.min.js
7
+ *.min.css
@@ -0,0 +1,19 @@
1
+ {
2
+ "semi": true,
3
+ "singleQuote": true,
4
+ "tabWidth": 2,
5
+ "trailingComma": "es5",
6
+ "printWidth": 100,
7
+ "bracketSpacing": true,
8
+ "arrowParens": "avoid",
9
+ "endOfLine": "lf",
10
+ "plugins": ["prettier-plugin-tailwindcss"],
11
+ "overrides": [
12
+ {
13
+ "files": "*.json",
14
+ "options": {
15
+ "tabWidth": 2
16
+ }
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "recommendations": [
3
+ "dbaeumer.vscode-eslint",
4
+ "esbenp.prettier-vscode",
5
+ "bradlc.vscode-tailwindcss",
6
+ "ms-vscode.vscode-typescript-next",
7
+ "ms-azuretools.vscode-docker",
8
+ "GitHub.copilot",
9
+ "eamodio.gitlens",
10
+ "usernamehw.errorlens",
11
+ "christian-kohler.path-intellisense",
12
+ "formulahendry.auto-rename-tag"
13
+ ]
14
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
4
+ "editor.codeActionsOnSave": {
5
+ "source.fixAll.eslint": "explicit",
6
+ "source.organizeImports": "explicit"
7
+ },
8
+ "eslint.workingDirectories": [{ "pattern": "apps/*" }, { "pattern": "packages/*" }],
9
+ "typescript.tsdk": "node_modules/typescript/lib",
10
+ "typescript.enablePromptUseWorkspaceTsdk": true,
11
+ "files.associations": {
12
+ "*.css": "tailwindcss"
13
+ },
14
+ "tailwindCSS.experimental.classRegex": [
15
+ ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
16
+ ["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
17
+ ],
18
+ "[typescript]": {
19
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
20
+ },
21
+ "[typescriptreact]": {
22
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
23
+ },
24
+ "[javascript]": {
25
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
26
+ },
27
+ "[javascriptreact]": {
28
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
29
+ },
30
+ "[json]": {
31
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
32
+ },
33
+ "[markdown]": {
34
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
35
+ }
36
+ }
File without changes
@@ -0,0 +1,26 @@
1
+ module.exports = {
2
+ extends: ['@commitlint/config-conventional'],
3
+ rules: {
4
+ 'type-enum': [
5
+ 2,
6
+ 'always',
7
+ [
8
+ 'feat', // Nouvelle fonctionnalité
9
+ 'fix', // Correction de bug
10
+ 'docs', // Documentation
11
+ 'style', // Formatage (pas de changement de code)
12
+ 'refactor', // Refactorisation
13
+ 'perf', // Amélioration de performance
14
+ 'test', // Ajout de tests
15
+ 'build', // Changements de build
16
+ 'ci', // Changements CI
17
+ 'chore', // Maintenance
18
+ 'revert', // Annulation
19
+ 'build', // Changements de build
20
+ ],
21
+ ],
22
+ 'subject-case': [2, 'always', 'lower-case'],
23
+ 'subject-max-length': [2, 'always', 100],
24
+ 'body-max-line-length': [0, 'always', Infinity],
25
+ },
26
+ };
@@ -0,0 +1,49 @@
1
+ version: '3.9'
2
+
3
+ services:
4
+ web:
5
+ build:
6
+ context: ..
7
+ dockerfile: apps/web/Dockerfile
8
+ target: development
9
+ volumes:
10
+ - ../apps/web:/app/apps/web
11
+ - ../packages:/app/packages
12
+ - /app/node_modules
13
+ - /app/apps/web/node_modules
14
+ ports:
15
+ - '3000:3000'
16
+ environment:
17
+ - NODE_ENV=development
18
+ - WATCHPACK_POLLING=true
19
+ command: pnpm dev
20
+
21
+ api:
22
+ build:
23
+ context: ..
24
+ dockerfile: apps/api/Dockerfile
25
+ target: development
26
+ volumes:
27
+ - ../apps/api:/app/apps/api
28
+ - ../packages:/app/packages
29
+ - /app/node_modules
30
+ - /app/apps/api/node_modules
31
+ ports:
32
+ - '4000:4000'
33
+ environment:
34
+ - NODE_ENV=development
35
+ command: pnpm dev
36
+
37
+ db:
38
+ image: postgres:16-alpine
39
+ environment:
40
+ POSTGRES_USER: postgres
41
+ POSTGRES_PASSWORD: postgres
42
+ POSTGRES_DB: nexu_dev
43
+ ports:
44
+ - '5432:5432'
45
+ volumes:
46
+ - postgres_dev_data:/var/lib/postgresql/data
47
+
48
+ volumes:
49
+ postgres_dev_data:
@@ -0,0 +1,64 @@
1
+ version: '3.9'
2
+
3
+ services:
4
+ web:
5
+ build:
6
+ context: ..
7
+ dockerfile: apps/web/Dockerfile
8
+ target: production
9
+ ports:
10
+ - '3000:3000'
11
+ environment:
12
+ - NODE_ENV=production
13
+ - NEXT_PUBLIC_API_URL=http://api:4000
14
+ depends_on:
15
+ - api
16
+ restart: unless-stopped
17
+ networks:
18
+ - app-network
19
+
20
+ api:
21
+ build:
22
+ context: ..
23
+ dockerfile: apps/api/Dockerfile
24
+ target: production
25
+ ports:
26
+ - '4000:4000'
27
+ environment:
28
+ - NODE_ENV=production
29
+ - DATABASE_URL=${DATABASE_URL}
30
+ - PORT=4000
31
+ depends_on:
32
+ - db
33
+ - redis
34
+ restart: unless-stopped
35
+ networks:
36
+ - app-network
37
+
38
+ db:
39
+ image: postgres:16-alpine
40
+ environment:
41
+ POSTGRES_USER: ${DB_USER:-postgres}
42
+ POSTGRES_PASSWORD: ${DB_PASSWORD}
43
+ POSTGRES_DB: ${DB_NAME:-nexu}
44
+ volumes:
45
+ - postgres_data:/var/lib/postgresql/data
46
+ restart: unless-stopped
47
+ networks:
48
+ - app-network
49
+
50
+ redis:
51
+ image: redis:7-alpine
52
+ volumes:
53
+ - redis_data:/data
54
+ restart: unless-stopped
55
+ networks:
56
+ - app-network
57
+
58
+ networks:
59
+ app-network:
60
+ driver: bridge
61
+
62
+ volumes:
63
+ postgres_data:
64
+ redis_data:
@@ -0,0 +1,5 @@
1
+ # Main docker-compose - includes all apps
2
+ # Each app has its own docker-compose.yml in apps/<app-name>/
3
+ # Run: pnpm generate:app <name> <port> to add a new app
4
+
5
+ include: []