Skip to content

Commit 848ca51

Browse files
Initial commit - clean version without sensitive data
0 parents  commit 848ca51

File tree

133 files changed

+41509
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+41509
-0
lines changed

.env.example

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# AI赋能坊项目环境变量模板
2+
# 复制此文件为 .env.local 并填入实际值
3+
4+
# ===========================================
5+
# 前端环境变量 (Frontend)
6+
# ===========================================
7+
8+
# Next.js 应用配置
9+
NEXT_PUBLIC_SITE_URL=http://localhost:3000
10+
NEXT_PUBLIC_SITE_NAME=AI赋能坊
11+
12+
# Strapi API 配置
13+
NEXT_PUBLIC_STRAPI_API_URL=http://localhost:1337
14+
STRAPI_API_TOKEN=your-strapi-api-token
15+
16+
# 第三方服务
17+
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=your-ga-id
18+
19+
# ===========================================
20+
# 后端环境变量 (Backend - Strapi)
21+
# ===========================================
22+
23+
# 服务器配置
24+
HOST=0.0.0.0
25+
PORT=1337
26+
27+
# 应用密钥 (生产环境必须更改)
28+
APP_KEYS=your-app-keys-here
29+
API_TOKEN_SALT=your-api-token-salt
30+
ADMIN_JWT_SECRET=your-admin-jwt-secret
31+
TRANSFER_TOKEN_SALT=your-transfer-token-salt
32+
JWT_SECRET=your-jwt-secret
33+
34+
# 数据库配置 (PostgreSQL)
35+
DATABASE_CLIENT=postgres
36+
DATABASE_HOST=your-database-host
37+
DATABASE_PORT=5432
38+
DATABASE_NAME=your-database-name
39+
DATABASE_USERNAME=your-database-username
40+
DATABASE_PASSWORD=your-database-password
41+
DATABASE_SSL=true
42+
43+
# 媒体存储 (Cloudinary)
44+
CLOUDINARY_NAME=your-cloudinary-name
45+
CLOUDINARY_KEY=your-cloudinary-key
46+
CLOUDINARY_SECRET=your-cloudinary-secret
47+
48+
# ===========================================
49+
# 开发工具
50+
# ===========================================
51+
52+
# 调试模式
53+
NODE_ENV=development
54+
NEXT_PRIVATE_DEBUG_CACHE=1
55+
56+
# ===========================================
57+
# 生产环境额外配置
58+
# ===========================================
59+
60+
# 域名配置
61+
# NEXT_PUBLIC_SITE_URL=https://your-domain.com
62+
# NEXT_PUBLIC_STRAPI_API_URL=https://your-backend-domain.com
63+
64+
# 安全配置
65+
# STRAPI_ADMIN_BACKEND_URL=https://your-backend-domain.com
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# 保持Render后端服务活跃
2+
# 防止免费版Render服务因15分钟无活动而休眠
3+
name: Keep Render Backend Awake
4+
5+
on:
6+
schedule:
7+
# 每14分钟触发一次 (避免15分钟休眠限制)
8+
- cron: "*/14 * * * *"
9+
workflow_dispatch: # 允许手动触发
10+
11+
jobs:
12+
ping-backend:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Ping Render Backend
17+
run: |
18+
echo "🚀 开始ping Render后端服务..."
19+
echo "⏰ 当前时间: $(date)"
20+
echo "🎯 目标URL: ${{ secrets.BACKEND_URL }}"
21+
22+
# 使用curl ping后端根路径 (Strapi根路径会返回302重定向到/admin,这是正常的)
23+
response=$(curl -s -o /dev/null -w "%{http_code}" -m 30 ${{ secrets.BACKEND_URL }} || echo "failed")
24+
25+
if [ "$response" = "200" ] || [ "$response" = "302" ]; then
26+
echo "✅ 后端服务响应正常 (HTTP $response)"
27+
elif [ "$response" = "failed" ]; then
28+
echo "❌ 请求失败 - 可能是网络问题或服务暂时不可用"
29+
else
30+
echo "⚠️ 后端服务响应异常 (HTTP $response)"
31+
fi
32+
33+
echo "📊 任务完成时间: $(date)"
34+
35+
# 确保工作流不会因为ping失败而报错
36+
exit 0
37+
38+
- name: Ping API Endpoint (备用检查)
39+
run: |
40+
echo "🔄 执行备用API端点检查..."
41+
42+
# 检查API端点是否可访问 (404是正常的,说明服务在运行)
43+
api_response=$(curl -s -o /dev/null -w "%{http_code}" -m 30 ${{ secrets.BACKEND_URL }}/api || echo "failed")
44+
45+
if [ "$api_response" = "200" ] || [ "$api_response" = "404" ]; then
46+
echo "✅ API端点可访问 (HTTP $api_response)"
47+
elif [ "$api_response" = "failed" ]; then
48+
echo "❌ API请求失败"
49+
else
50+
echo "⚠️ API端点检查: HTTP $api_response"
51+
fi
52+
53+
echo "🎯 保持活跃任务执行完毕"
54+
exit 0

.gitignore

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
pnpm-debug.log*
7+
.pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
# Package managers
11+
/.pnp
12+
.pnp.*
13+
.yarn/*
14+
!.yarn/patches
15+
!.yarn/plugins
16+
!.yarn/releases
17+
!.yarn/versions
18+
19+
# Next.js
20+
.next/
21+
out/
22+
build/
23+
dist/
24+
25+
# Production builds
26+
*.tgz
27+
*.tar.gz
28+
29+
# Runtime data
30+
pids
31+
*.pid
32+
*.seed
33+
*.pid.lock
34+
35+
# Coverage directory used by tools like istanbul
36+
coverage/
37+
*.lcov
38+
39+
# nyc test coverage
40+
.nyc_output
41+
42+
# Grunt intermediate storage
43+
.grunt
44+
45+
# Bower dependency directory
46+
bower_components
47+
48+
# node-waf configuration
49+
.lock-wscript
50+
51+
# Compiled binary addons
52+
build/Release
53+
54+
# Dependency directories
55+
jspm_packages/
56+
57+
# TypeScript cache
58+
*.tsbuildinfo
59+
next-env.d.ts
60+
61+
# Testing
62+
/coverage
63+
64+
# Optional npm cache directory
65+
.npm
66+
67+
# Optional eslint cache
68+
.eslintcache
69+
70+
# Optional stylelint cache
71+
.stylelintcache
72+
73+
# Microbundle cache
74+
.rpt2_cache/
75+
.rts2_cache_cjs/
76+
.rts2_cache_es/
77+
.rts2_cache_umd/
78+
79+
# Optional REPL history
80+
.node_repl_history
81+
82+
# Output of 'npm pack'
83+
*.tgz
84+
85+
# Yarn Integrity file
86+
.yarn-integrity
87+
88+
# dotenv environment variable files
89+
.env
90+
.env.development.local
91+
.env.test.local
92+
.env.production.local
93+
.env.local
94+
95+
# parcel-bundler cache
96+
.cache
97+
.parcel-cache
98+
99+
# Next.js build output
100+
.next
101+
out
102+
103+
# Nuxt.js build / generate output
104+
.nuxt
105+
dist
106+
107+
# Gatsby files
108+
.cache/
109+
public
110+
111+
# Vuepress build output
112+
.vuepress/dist
113+
114+
# Serverless directories
115+
.serverless/
116+
117+
# FuseBox cache
118+
.fusebox/
119+
120+
# DynamoDB Local files
121+
.dynamodb/
122+
123+
# TernJS port file
124+
.tern-port
125+
126+
# Stores VSCode versions used for testing VSCode extensions
127+
.vscode-test
128+
129+
# yarn v2
130+
.yarn/cache
131+
.yarn/unplugged
132+
.yarn/build-state.yml
133+
.yarn/install-state.gz
134+
.pnp.*
135+
136+
# IDEs and editors
137+
.idea/
138+
.vscode/
139+
*.swp
140+
*.swo
141+
*~
142+
143+
# OS generated files
144+
.DS_Store
145+
.DS_Store?
146+
._*
147+
.Spotlight-V100
148+
.Trashes
149+
ehthumbs.db
150+
Thumbs.db
151+
*.pem
152+
153+
# Logs
154+
logs
155+
*.log
156+
157+
# Temporary folders
158+
tmp/
159+
temp/
160+
161+
# Strapi
162+
####################################
163+
# Strapi backend specific
164+
backend/.tmp/
165+
backend/build/
166+
backend/.strapi-updater.json
167+
backend/.env
168+
backend/dist/
169+
backend/exports/
170+
171+
# Database
172+
*.db
173+
*.sqlite
174+
*.sqlite3
175+
176+
# Session
177+
.strapi-session
178+
179+
# Strapi cloud
180+
.strapi-cloud.json
181+
182+
# Media uploads
183+
backend/public/uploads/
184+
185+
# Cache
186+
.cache/
187+
188+
# Build
189+
backend/build/
190+
191+
# PM2
192+
ecosystem.config.js
193+
194+
# Cloudinary
195+
.cloudinary/
196+
197+
# Testing
198+
coverage/
199+
.nyc_output/
200+
201+
# Misc
202+
*.tgz
203+
*.tar.gz
204+
.DS_Store
205+
.vscode/
206+
.idea/
207+
208+
# Local development
209+
.env.local
210+
.env.development.local
211+
.env.test.local
212+
.env.production.local
213+
214+
# Vercel
215+
.vercel
216+
217+
# Turbo
218+
.turbo
219+
220+
# Sentry
221+
.sentryclirc
222+
223+
# Internal documentation (contains sensitive information)
224+
docs/internal/
225+
226+
# Sensitive configuration files
227+
**/config/production.ts
228+
**/config/secrets.ts
229+
230+
# Environment files with sensitive data
231+
.env.production
232+
.env.staging
233+
.env.*.local
234+
*/.env.production
235+
*/.env.staging
236+
*/.env.*.local
237+
238+
# Security reports and sensitive logs
239+
security-report.json
240+
*.security.log
241+
sensitive-data-*.json

0 commit comments

Comments
 (0)