Files
2026-06-06 10:40:48 +08:00

98 lines
2.1 KiB
Markdown

# NoteApp — Fullstack Project
> 一款支持多端同步、Markdown 编辑和标签管理的笔记应用。
## 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
#### customers
- `GET /api/customers` — List
- `GET /api/customers/:id` — Get
- `POST /api/customers` — Create
- `PUT /api/customers/:id` — Update
- `DELETE /api/customers/:id` — Delete
#### sales_pipeline
- `GET /api/sales_pipeline` — List
- `GET /api/sales_pipeline/:id` — Get
- `POST /api/sales_pipeline` — Create
- `PUT /api/sales_pipeline/:id` — Update
- `DELETE /api/sales_pipeline/:id` — Delete
#### follow_ups
- `GET /api/follow_ups` — List
- `GET /api/follow_ups/:id` — Get
- `POST /api/follow_ups` — Create
- `PUT /api/follow_ups/:id` — Update
- `DELETE /api/follow_ups/:id` — Delete
#### dashboard
- `GET /api/dashboard` — List
- `GET /api/dashboard/:id` — Get
- `POST /api/dashboard` — Create
- `PUT /api/dashboard/:id` — Update
- `DELETE /api/dashboard/:id` — Delete
### System
- `GET /api/health` — Health check
## Environment Variables
See `.env.example` for all available configuration.