nest登录后端
Go to file
golc f557f8581b fix: 修复 Vercel serverless 运行时崩溃
关键修复:
- 使用 require() 而非 import() 动态加载编译后的模块
- 从 dist/src/ 路径加载模块(Vercel 构建后的路径)
- 移除 tsconfig 中对 api 目录的排除
- 配置 vercel.json 路由到 dist/api/index.js

技术说明:
- api/index.ts 会被编译到 dist/api/index.js
- 运行时从 dist/src/app.module 加载 NestJS 应用
- 使用 require 避免 TypeScript 编译时路径检查

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 11:14:09 +00:00
api fix: 修复 Vercel serverless 运行时崩溃 2026-03-04 11:14:09 +00:00
docs feat: 整理项目结构 2026-02-21 22:50:02 +08:00
scripts security: 移除所有硬编码的敏感信息 2026-02-24 14:03:57 +00:00
src fix: configure CORS for Vercel frontend domain 2026-02-25 11:53:44 +00:00
test feat: 初始化项目 2025-01-08 19:46:50 +08:00
.dockerignore feat: 添加管理员以及部署内容 2026-02-24 20:17:59 +08:00
.env.example feat: initial commit with Vercel CI/CD 2026-02-25 09:42:55 +00:00
.env.vercel feat: 配置 Vercel serverless 部署支持 2026-03-04 09:19:00 +00:00
.eslintrc.js feat: 初始化项目 2025-01-08 19:46:50 +08:00
.gitignore feat: initial commit with Vercel CI/CD 2026-02-25 09:42:55 +00:00
.prettierrc feat: 初始化项目 2025-01-08 19:46:50 +08:00
Dockerfile feat: 添加管理员以及部署内容 2026-02-24 20:17:59 +08:00
README.md feat: 整理项目结构 2026-02-21 22:50:02 +08:00
nest-cli.json feat: 初始化项目 2025-01-08 19:46:50 +08:00
package.json fix: 配置 Vercel serverless 部署 2026-03-04 09:58:09 +00:00
pnpm-lock.yaml fix: 配置 Vercel serverless 部署 2026-03-04 09:58:09 +00:00
tsconfig.build.json feat: 初始化项目 2025-01-08 19:46:50 +08:00
tsconfig.json fix: 修复 Vercel serverless 运行时崩溃 2026-03-04 11:14:09 +00:00
vercel.json fix: 修复 Vercel serverless 运行时崩溃 2026-03-04 11:14:09 +00:00

README.md

OAuth NestJS Demo

A NestJS backend with multi-provider OAuth, JWT authentication, task management, and a license/activation key system.

Tech Stack

  • Framework: NestJS 10 + TypeScript
  • Database: MySQL + TypeORM
  • Auth: JWT, GitHub OAuth2, Lark OAuth2
  • API Docs: Swagger (/api)
  • Package Manager: pnpm

Getting Started

# Install dependencies
pnpm install

# Configure environment variables
cp .env.example .env  # then edit .env

# Start in development mode
pnpm run start:dev

See docs/QUICKSTART.md for a detailed setup guide.

Documentation

Document Description
QUICKSTART.md Quick start guide
OAuth-JWT-Integration.md OAuth and JWT integration
database-flow.md Database schema and data flow
LICENSE_SYSTEM.md License system overview
LICENSE_IMPLEMENTATION.md License implementation details
GENERATE_LICENSE_GUIDE.md License generation guide
HOW_TO_GENERATE.md License generation instructions

Scripts

Script Description
scripts/generate-licenses.sh Interactive license key generation
scripts/test-license-system.sh License system integration tests
scripts/check-db-schema.js Database schema validation
# Generate license keys
bash scripts/generate-licenses.sh

# Run license system tests
bash scripts/test-license-system.sh

Running the App

# Development
pnpm run start:dev

# Production build
pnpm run build
pnpm run start:prod

Tests

# Unit tests
pnpm run test

# E2E tests
pnpm run test:e2e

# Coverage
pnpm run test:cov

Project Structure

src/
├── auth/          # JWT auth, strategies, guards
├── common/        # Shared filters, interceptors, guards
├── user/          # User management
├── task/          # Task management
├── license/       # License/activation key system
├── github/        # GitHub OAuth provider
├── lark/          # Lark OAuth provider
├── deepseek/      # DeepSeek AI provider
└── constants/     # Shared constants
docs/              # Project documentation
scripts/           # Utility and test scripts
test/              # E2E tests