2.5 KiB
2.5 KiB
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
# 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
# Build everything
npm run build
# Or individually
npm run build:web
npm run build:api
Testing
# Run API tests
npm test
API Endpoints
Auth
POST /api/auth/registerPOST /api/auth/loginGET /api/auth/me
Resources
users
GET /api/users— ListGET /api/users/:id— GetPOST /api/users— CreatePUT /api/users/:id— UpdateDELETE /api/users/:id— Delete
items
GET /api/items— ListGET /api/items/:id— GetPOST /api/items— CreatePUT /api/items/:id— UpdateDELETE /api/items/:id— Delete
stock_in
GET /api/stock_in— ListGET /api/stock_in/:id— GetPOST /api/stock_in— CreatePUT /api/stock_in/:id— UpdateDELETE /api/stock_in/:id— Delete
stock_out
GET /api/stock_out— ListGET /api/stock_out/:id— GetPOST /api/stock_out— CreatePUT /api/stock_out/:id— UpdateDELETE /api/stock_out/:id— Delete
stocktaking
GET /api/stocktaking— ListGET /api/stocktaking/:id— GetPOST /api/stocktaking— CreatePUT /api/stocktaking/:id— UpdateDELETE /api/stocktaking/:id— Delete
stock_alerts
GET /api/stock_alerts— ListGET /api/stock_alerts/:id— GetPOST /api/stock_alerts— CreatePUT /api/stock_alerts/:id— UpdateDELETE /api/stock_alerts/:id— Delete
warehouse
GET /api/warehouse— ListGET /api/warehouse/:id— GetPOST /api/warehouse— CreatePUT /api/warehouse/:id— UpdateDELETE /api/warehouse/:id— Delete
System
GET /api/health— Health check
Environment Variables
See .env.example for all available configuration.