Files
lunarfront-app/packages/backend/package.json
Ryan Moon 760e995ae3 Implement file storage layer with local provider, upload/download API, tests
- StorageProvider interface with LocalProvider (S3 placeholder)
- File table with entity_type/entity_id references, content type, path
- POST /v1/files (multipart upload), GET /v1/files (list by entity),
  GET /v1/files/:id (metadata), GET /v1/files/serve/* (content),
  DELETE /v1/files/:id
- member_identifier drops base64 columns, uses file_id FKs
- File validation: type whitelist, size limits, per-entity max
- Fastify storage plugin injects provider into app
- 6 API tests for upload, list, get, delete, validation
- Test runner kills stale port before starting backend
2026-03-28 15:29:06 -05:00

39 lines
960 B
JSON

{
"name": "@forte/backend",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "bun --watch run src/main.ts",
"start": "bun run src/main.ts",
"test": "bun test",
"test:watch": "bun test --watch",
"api-test": "bun run api-tests/run.ts",
"lint": "eslint src/",
"db:generate": "bunx drizzle-kit generate",
"db:migrate": "bunx drizzle-kit migrate",
"db:seed": "bun run src/db/seed.ts"
},
"dependencies": {
"@fastify/cors": "^10",
"@fastify/jwt": "^9",
"@fastify/multipart": "^9.4.0",
"@fastify/rate-limit": "^10.3.0",
"@forte/shared": "workspace:*",
"bcrypt": "^6",
"drizzle-orm": "^0.38",
"fastify": "^5",
"fastify-plugin": "^5",
"ioredis": "^5",
"postgres": "^3",
"zod": "^4"
},
"devDependencies": {
"typescript": "^5",
"drizzle-kit": "^0.30",
"pino-pretty": "^13",
"@types/node": "^22",
"@types/bcrypt": "^5"
}
}