@underundre/undev 0.1.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.
- package/LICENSE +21 -0
- package/README.md +148 -0
- package/README.ru.md +148 -0
- package/configs/.editorconfig +28 -0
- package/configs/commitlint.config.js +36 -0
- package/configs/eslint.config.js +58 -0
- package/configs/prettier.config.js +23 -0
- package/configs/tsconfig.base.json +23 -0
- package/package.json +53 -0
- package/scripts/common.sh +74 -0
- package/scripts/db/backup.sh +53 -0
- package/scripts/db/restore.sh +46 -0
- package/scripts/deploy/deploy.sh +102 -0
- package/scripts/deploy/logs.sh +40 -0
- package/scripts/deploy/rollback.sh +46 -0
- package/scripts/dev/setup.sh +69 -0
- package/scripts/docker/cleanup.sh +49 -0
- package/scripts/monitoring/security-audit.sh +76 -0
- package/scripts/server/health-check.sh +83 -0
- package/scripts/server/setup-ssl.sh +30 -0
- package/scripts/server/setup-vps.sh +92 -0
- package/templates/.env.example +32 -0
- package/templates/.github/workflows/ci.yml +48 -0
- package/templates/docker-compose.dev.yml +41 -0
- package/templates/package-scripts.jsonc +52 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
validate:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: 20
|
|
22
|
+
cache: npm
|
|
23
|
+
|
|
24
|
+
- run: npm ci
|
|
25
|
+
|
|
26
|
+
- name: Lint
|
|
27
|
+
run: npm run lint
|
|
28
|
+
|
|
29
|
+
- name: Type Check
|
|
30
|
+
run: npm run typecheck
|
|
31
|
+
|
|
32
|
+
- name: Format Check
|
|
33
|
+
run: npm run format:check
|
|
34
|
+
|
|
35
|
+
- name: Test
|
|
36
|
+
run: npm run test:run
|
|
37
|
+
|
|
38
|
+
# Uncomment when you have E2E tests:
|
|
39
|
+
# e2e:
|
|
40
|
+
# runs-on: ubuntu-latest
|
|
41
|
+
# needs: validate
|
|
42
|
+
# steps:
|
|
43
|
+
# - uses: actions/checkout@v4
|
|
44
|
+
# - uses: actions/setup-node@v4
|
|
45
|
+
# with: { node-version: 20, cache: npm }
|
|
46
|
+
# - run: npm ci
|
|
47
|
+
# - run: npx playwright install --with-deps
|
|
48
|
+
# - run: npm run test:e2e
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Development Docker Compose: PostgreSQL + Redis
|
|
2
|
+
# Copy to project root and customize.
|
|
3
|
+
#
|
|
4
|
+
# Usage:
|
|
5
|
+
# docker compose -f docker-compose.dev.yml up -d
|
|
6
|
+
# docker compose -f docker-compose.dev.yml down
|
|
7
|
+
|
|
8
|
+
services:
|
|
9
|
+
db:
|
|
10
|
+
image: postgres:16-alpine
|
|
11
|
+
restart: unless-stopped
|
|
12
|
+
ports:
|
|
13
|
+
- "${POSTGRES_PORT:-5432}:5432"
|
|
14
|
+
environment:
|
|
15
|
+
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
16
|
+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
17
|
+
POSTGRES_DB: ${POSTGRES_DB:-mydb}
|
|
18
|
+
volumes:
|
|
19
|
+
- pgdata:/var/lib/postgresql/data
|
|
20
|
+
healthcheck:
|
|
21
|
+
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
|
22
|
+
interval: 5s
|
|
23
|
+
timeout: 5s
|
|
24
|
+
retries: 5
|
|
25
|
+
|
|
26
|
+
redis:
|
|
27
|
+
image: redis:7-alpine
|
|
28
|
+
restart: unless-stopped
|
|
29
|
+
ports:
|
|
30
|
+
- "${REDIS_PORT:-6379}:6379"
|
|
31
|
+
volumes:
|
|
32
|
+
- redisdata:/data
|
|
33
|
+
healthcheck:
|
|
34
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
35
|
+
interval: 5s
|
|
36
|
+
timeout: 5s
|
|
37
|
+
retries: 5
|
|
38
|
+
|
|
39
|
+
volumes:
|
|
40
|
+
pgdata:
|
|
41
|
+
redisdata:
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// ─────────────────────────────────────────────────
|
|
2
|
+
// Recommended npm scripts for Node.js/TypeScript projects.
|
|
3
|
+
// Copy relevant entries into your package.json "scripts" block.
|
|
4
|
+
// ─────────────────────────────────────────────────
|
|
5
|
+
{
|
|
6
|
+
"scripts": {
|
|
7
|
+
// ── Dev ──
|
|
8
|
+
"dev": "concurrently \"npm run dev:server\" \"npm run dev:client\"",
|
|
9
|
+
"dev:server": "tsx watch server/index.ts",
|
|
10
|
+
"dev:client": "vite",
|
|
11
|
+
|
|
12
|
+
// ── Build ──
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"start": "node dist/index.js",
|
|
15
|
+
|
|
16
|
+
// ── Test ──
|
|
17
|
+
"test": "vitest",
|
|
18
|
+
"test:run": "vitest run",
|
|
19
|
+
"test:watch": "vitest",
|
|
20
|
+
"test:unit": "vitest run tests/unit",
|
|
21
|
+
"test:integration": "vitest run tests/integration",
|
|
22
|
+
"test:e2e": "playwright test",
|
|
23
|
+
"test:coverage": "vitest run --coverage",
|
|
24
|
+
|
|
25
|
+
// ── Quality ──
|
|
26
|
+
"lint": "eslint .",
|
|
27
|
+
"lint:fix": "eslint . --fix",
|
|
28
|
+
"format": "prettier --write .",
|
|
29
|
+
"format:check": "prettier --check .",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
|
|
32
|
+
// ── Validate (CI gate) ──
|
|
33
|
+
"validate": "npm run lint && npm run typecheck && npm run format:check",
|
|
34
|
+
"validate:fix": "npm run lint:fix && npm run typecheck && npm run format",
|
|
35
|
+
|
|
36
|
+
// ── Database (Drizzle) ──
|
|
37
|
+
"db:generate": "drizzle-kit generate",
|
|
38
|
+
"db:migrate": "drizzle-kit migrate",
|
|
39
|
+
"db:push": "drizzle-kit push",
|
|
40
|
+
"db:studio": "drizzle-kit studio",
|
|
41
|
+
|
|
42
|
+
// ── Deploy ──
|
|
43
|
+
"deploy": "./scripts/deploy/deploy.sh",
|
|
44
|
+
"deploy:logs": "./scripts/deploy/logs.sh",
|
|
45
|
+
"deploy:rollback": "./scripts/deploy/rollback.sh",
|
|
46
|
+
|
|
47
|
+
// ── Maintenance ──
|
|
48
|
+
"deps:check": "depcheck",
|
|
49
|
+
"audit:check": "npm audit",
|
|
50
|
+
"security": "./scripts/monitoring/security-audit.sh"
|
|
51
|
+
}
|
|
52
|
+
}
|