Skip to content

Commit

Permalink
231st Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Chen committed Dec 31, 2023
1 parent f279119 commit a84b5d9
Show file tree
Hide file tree
Showing 4 changed files with 403 additions and 562 deletions.
46 changes: 15 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,12 @@ This seed repository provides the following features:
- [x] [Prettier](https://github.com/prettier/prettier) - Formatter
- [x] [Vitest](https://github.com/vitest-dev/vitest) - Test Runner
- [x] [Playwright](https://github.com/microsoft/playwright) - Test Automation
- [x] [Autocannon](https://github.com/mcollina/autocannon) - Measure Performance
- [x] [VitePress](https://vitepress.vuejs.org/) - Documentation
- ---------- **Environments** ----------
- [x] [Node.js](https://nodejs.org/en/) - JavaScript Runtime Environment
- [x] [Pnpm](https://pnpm.io/) - Package Manager
- [x] [PM2](https://pm2.keymetrics.io/) - Process Manager
- [x] [Caddy](https://caddyserver.com/) - Web Server
- [x] [Docker](https://www.docker.com/) - Containerized Application Development
- [x] [CircleCI](https://circleci.com/) - Continuous Integration and Delivery
- [x] [GitHub Actions](https://github.com/features/actions) - Continuous Integration and Delivery
- [x] [Render](https://render.com/) - Cloud Application Hosting

### Tiny examples
Expand All @@ -151,37 +148,30 @@ Control the environment.
Set your local environment variables.

```ts
// env.ts
export default {
NODE_ENV: process.env.NODE_ENV || 'development',
// vite.config.ts
define: envify({
NODE_ENV: process.env.NODE_ENV || 'development',

HOST: process.env.HOST || '127.0.0.1',
PORT: process.env.PORT || 3000,
HOST: process.env.HOST || '127.0.0.1',
PORT: process.env.PORT || 3000,

SITE_URL: process.env.SITE_URL || 'http://127.0.0.1:5173',
SITE_URL: process.env.SITE_URL || 'http://127.0.0.1:5173',

MONGODB_URL: process.env.MONGODB_URL || 'xxx',
REDIS_URL: process.env.REDIS_URL || 'xxx',
CLOUDINARY_URL: process.env.CLOUDINARY_URL || 'xxx',
SMTP_URL: process.env.SMTP_URL || 'xxx',
MONGODB_URL: process.env.MONGODB_URL || 'xxx',
REDIS_URL: process.env.REDIS_URL || 'xxx',
CLOUDINARY_URL: process.env.CLOUDINARY_URL || 'xxx',
SMTP_URL: process.env.SMTP_URL || 'xxx',

SECRET_KEY: process.env.SECRET_KEY || 'xxx',
};
SECRET_KEY: process.env.SECRET_KEY || 'xxx',
}),
```

### Continuous integration environments

Add environment variables to the CircleCI build.
Add environment secrets to the GitHub Actions workflow.

```sh
# production
DEPLOY_HOOK=xxx

# development
DEV_DEPLOY_HOOK=xxx

# staging
STAGE_DEPLOY_HOOK=xxx
```

### Continuous delivery environments
Expand All @@ -205,13 +195,8 @@ The structure follows the LIFT Guidelines.

```coffee
.
├── .circleci
├── benchmark -> load testing
├── docs -> api documentation
├── .github/workflows/ci.yml
├── e2e -> e2e testing (Caddy Server proxy api and proxy mock api)
├── mock
│ ├── requests -> mock third-party api
│ └── responses -> mock data for mock api, unit testing, and e2e testing
├── public -> not handled by vite, copy it to dist
├── src
│ ├── assets -> wasm
Expand All @@ -234,7 +219,6 @@ The structure follows the LIFT Guidelines.
├── Caddyfile
├── docker-compose.yml
├── Dockerfile
├── LICENSE
├── package.json
├── pnpm-lock.yaml
├── README.md
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
},
"devDependencies": {
"@playwright/test": "^1.40.1",
"@types/node": "^20.10.4"
"@types/node": "^20.10.6"
}
}
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"type": "module",
"scripts": {
"dev": "vite-node -w src/main.ts",
"mock": "cd api && pnpm mock",
"build": "vite build",
"preview": "node dist/main.js",
"lint": "eslint 'src/**/*.ts'",
"check": "tsc",
"test": "vitest --dir src --run --coverage",
"e2e": "cd e2e && pnpm e2e",
"mock": "cd mock/requests && pnpm mock"
"e2e": "cd e2e && pnpm e2e"
},
"dependencies": {
"@fastify/cors": "^8.4.2",
"@fastify/cors": "^8.5.0",
"@fastify/helmet": "^11.1.1",
"@fastify/jwt": "^7.2.4",
"@fastify/mongodb": "^8.0.0",
Expand All @@ -22,22 +22,22 @@
"@fastify/rate-limit": "^9.0.1",
"@fastify/redis": "^6.1.1",
"@fastify/sensible": "^5.5.0",
"@fastify/type-provider-typebox": "^3.5.0",
"@fastify/type-provider-typebox": "^3.6.0",
"@fastify/under-pressure": "^8.3.0",
"@fastify/websocket": "^8.2.0",
"@sinclair/typebox": "^0.31.28",
"bullmq": "^4.15.2",
"cache-manager": "^5.3.1",
"@fastify/websocket": "^8.3.1",
"@sinclair/typebox": "^0.32.4",
"bullmq": "^5.1.0",
"cache-manager": "^5.3.2",
"cache-manager-ioredis-yet": "^1.2.2",
"exceljs": "^4.4.0",
"fastify": "^4.24.3",
"fastify": "^4.25.2",
"fastify-cloudinary": "^1.1.0",
"fastify-i18n": "^1.1.1",
"fastify-plugin": "^4.5.1",
"fastify-sse-v2": "^3.1.2",
"generate-password": "^1.7.1",
"ioredis": "^5.3.2",
"nodemailer": "^6.9.7",
"nodemailer": "^6.9.8",
"nunjucks": "^3.2.4",
"ofetch": "^1.3.3",
"otplib": "^12.0.1",
Expand All @@ -47,22 +47,22 @@
"@types/ioredis-mock": "^8.2.5",
"@types/nodemailer": "^6.4.14",
"@types/nunjucks": "^3.2.6",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@vitest/coverage-v8": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"@vitest/coverage-v8": "^1.1.0",
"concurrently": "^8.2.2",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-prettier": "^5.1.2",
"ioredis-mock": "^8.9.0",
"mongodb-memory-server": "^9.1.1",
"prettier": "^3.1.0",
"mongodb-memory-server": "^9.1.3",
"prettier": "^3.1.1",
"process-envify": "^2.0.0",
"typescript": "^5.3.3",
"vite": "^5.0.7",
"vite-node": "^1.0.2",
"vite": "^5.0.10",
"vite-node": "^1.1.0",
"vite-plugin-fastify": "^1.2.5",
"vite-plugin-fastify-routes": "^1.0.2",
"vitest": "^1.0.2"
"vitest": "^1.1.0"
}
}
Loading

0 comments on commit a84b5d9

Please sign in to comment.