Skip to content

Commit 58725e4

Browse files
authored
Merge pull request #1 from ejir/feat/bootstrap-nextjs14-zh-cn-cny-prisma-sqlite
Bootstrap Next.js 14 app (zh-CN, CNY) with Prisma + SQLite + CI
2 parents 683a7ae + 8de54df commit 58725e4

File tree

30 files changed

+627
-21
lines changed

30 files changed

+627
-21
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Database (SQLite)
2+
DATABASE_URL="file:./prisma/dev.db"
3+
4+
# Timezone
5+
TZ=Asia/Shanghai
6+
7+
# NextAuth (set in production)
8+
# NEXTAUTH_URL=https://your-domain.com
9+
# NEXTAUTH_SECRET=replace-with-strong-secret
10+
11+
# Optional Email provider for magic link
12+
# EMAIL_SERVER=smtp://user:pass@smtp.example.com:587
13+
# EMAIL_FROM=noreply@example.com

.eslintrc.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/** @type {import('eslint').Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: ['next/core-web-vitals', 'eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
5+
plugins: ['@typescript-eslint'],
6+
parser: '@typescript-eslint/parser',
7+
parserOptions: {
8+
ecmaVersion: 'latest',
9+
sourceType: 'module'
10+
},
11+
rules: {
12+
'react/jsx-key': 'off'
13+
},
14+
ignorePatterns: ['*.js', 'node_modules/', 'dist/', '.next/']
15+
};

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
cache: 'yarn'
17+
- name: Install dependencies
18+
run: yarn install --frozen-lockfile || yarn install
19+
- name: Generate Prisma Client
20+
run: npx prisma generate
21+
- name: Lint
22+
run: yarn lint
23+
- name: Typecheck
24+
run: yarn typecheck

.gitignore

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,40 @@
1-
### AL ###
2-
#Template for AL projects for Dynamics 365 Business Central
3-
#launch.json folder
1+
# Dependencies
2+
node_modules/
3+
4+
# Next.js
5+
.next/
6+
out/
7+
8+
# Production
9+
build/
10+
11+
# Logs
12+
npm-debug.log*
13+
yarn-debug.log*
14+
yarn-error.log*
15+
.pnpm-debug.log*
16+
17+
# Env
18+
.env
19+
.env.local
20+
.env.*.local
21+
22+
# OS
23+
.DS_Store
24+
25+
# Prisma
26+
prisma/dev.db
27+
prisma/dev.db-journal
28+
29+
# Typescript
30+
*.tsbuildinfo
31+
32+
# Editor
433
.vscode/
5-
#Cache folder
6-
.alcache/
7-
#Symbols folder
8-
.alpackages/
9-
#Snapshots folder
10-
.snapshots/
11-
#Testing Output folder
12-
.output/
13-
#Extension App-file
14-
*.app
15-
#Rapid Application Development File
16-
rad.json
17-
#Translation Base-file
18-
*.g.xlf
19-
#License-file
20-
*.flf
21-
#Test results file
22-
TestResults.xml
34+
.idea/
35+
36+
# Tailwind JIT cache
37+
.next/cache/
38+
39+
# Husky
40+
.husky/_/

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn lint
5+
yarn typecheck

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100
6+
}

messages/zh-CN.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"app": {
3+
"title": "示例应用",
4+
"nav": {
5+
"dashboard": "仪表盘",
6+
"market": "市场",
7+
"signIn": "登录",
8+
"signOut": "退出登录"
9+
}
10+
},
11+
"dashboard": {
12+
"title": "仪表盘",
13+
"welcome": "欢迎使用!当前为中文(中国)界面。"
14+
},
15+
"market": {
16+
"title": "市场:{symbol}",
17+
"price": "价格",
18+
"sample": "示例:¥{amount}"
19+
},
20+
"auth": {
21+
"signInTitle": "登录",
22+
"email": "邮箱",
23+
"password": "密码",
24+
"submit": "登录",
25+
"or": "",
26+
"magicLink": "发送登录链接到邮箱"
27+
},
28+
"common": {
29+
"currency": "人民币",
30+
"hello": "你好"
31+
}
32+
}

next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

next.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import createNextIntlPlugin from 'next-intl/plugin';
2+
3+
const withNextIntl = createNextIntlPlugin();
4+
5+
/** @type {import('next').NextConfig} */
6+
const nextConfig = {
7+
reactStrictMode: true,
8+
experimental: {
9+
typedRoutes: true
10+
}
11+
};
12+
13+
export default withNextIntl(nextConfig);

0 commit comments

Comments
 (0)