Files
16gagent/.benchmark/blog-cms/fullstack/README.md
T
2026-06-06 10:40:48 +08:00

126 lines
2.8 KiB
Markdown

# SocialApp — Fullstack Project
> 一款以内容分享和用户互动为核心的社交应用。
## Architecture
```
apps/
├── web/ # Next.js 15 + TypeScript + Tailwind CSS
└── api/ # Fastify 5 + TypeScript + SQLite (sql.js)
packages/
├── shared-types/ # @shared/types — shared TypeScript interfaces
└── shared-config/ # @shared/config — shared configuration
```
## Quick Start
```bash
# Install all dependencies (root + workspaces)
npm install
# Start both frontend and backend in dev mode
npm run dev
# Or start individually
npm run dev:web # http://localhost:3000
npm run dev:api # http://localhost:3001
```
## Build
```bash
# Build everything
npm run build
# Or individually
npm run build:web
npm run build:api
```
## Testing
```bash
# Run API tests
npm test
```
## API Endpoints
### Auth
- `POST /api/auth/register`
- `POST /api/auth/login`
- `GET /api/auth/me`
### Resources
#### users
- `GET /api/users` — List
- `GET /api/users/:id` — Get
- `POST /api/users` — Create
- `PUT /api/users/:id` — Update
- `DELETE /api/users/:id` — Delete
#### contracts
- `GET /api/contracts` — List
- `GET /api/contracts/:id` — Get
- `POST /api/contracts` — Create
- `PUT /api/contracts/:id` — Update
- `DELETE /api/contracts/:id` — Delete
#### approvals
- `GET /api/approvals` — List
- `GET /api/approvals/:id` — Get
- `POST /api/approvals` — Create
- `PUT /api/approvals/:id` — Update
- `DELETE /api/approvals/:id` — Delete
#### customers
- `GET /api/customers` — List
- `GET /api/customers/:id` — Get
- `POST /api/customers` — Create
- `PUT /api/customers/:id` — Update
- `DELETE /api/customers/:id` — Delete
#### reminders
- `GET /api/reminders` — List
- `GET /api/reminders/:id` — Get
- `POST /api/reminders` — Create
- `PUT /api/reminders/:id` — Update
- `DELETE /api/reminders/:id` — Delete
#### articles
- `GET /api/articles` — List
- `GET /api/articles/:id` — Get
- `POST /api/articles` — Create
- `PUT /api/articles/:id` — Update
- `DELETE /api/articles/:id` — Delete
#### tags
- `GET /api/tags` — List
- `GET /api/tags/:id` — Get
- `POST /api/tags` — Create
- `PUT /api/tags/:id` — Update
- `DELETE /api/tags/:id` — Delete
#### comments
- `GET /api/comments` — List
- `GET /api/comments/:id` — Get
- `POST /api/comments` — Create
- `PUT /api/comments/:id` — Update
- `DELETE /api/comments/:id` — Delete
#### media
- `GET /api/media` — List
- `GET /api/media/:id` — Get
- `POST /api/media` — Create
- `PUT /api/media/:id` — Update
- `DELETE /api/media/:id` — Delete
### System
- `GET /api/health` — Health check
## Environment Variables
See `.env.example` for all available configuration.