feat: Day 8-9 - Project Management API completed

Backend:
- Create project routes (GET, POST, PUT, DELETE)
- Implement projectController with CRUD operations
- Create projectService for database operations
- Add validation middleware for request validation
- Update Prisma schema (add background, researchType, deletedAt fields)
- Implement soft delete for projects

Frontend:
- Create projectApi service module
- Update useProjectStore with fetchProjects and loading state
- Connect ProjectSelector to real API with loading indicator
- Connect CreateProjectDialog to real API with error handling
- Connect EditProjectDialog to real API with loading state
- Add comprehensive error handling and user feedback

Build: Both frontend and backend build successfully
This commit is contained in:
AI Clinical Dev Team
2025-10-10 19:38:18 +08:00
parent e9e19064e2
commit b72167f73e
11 changed files with 613 additions and 42 deletions

View File

@@ -2,6 +2,7 @@ import Fastify from 'fastify';
import cors from '@fastify/cors';
import { config } from './config/env.js';
import { testDatabaseConnection, prisma } from './config/database.js';
import { projectRoutes } from './routes/projects.js';
const fastify = Fastify({
logger: {
@@ -51,6 +52,9 @@ fastify.get('/api/v1', async () => {
};
});
// 注册项目管理路由
await fastify.register(projectRoutes, { prefix: '/api/v1' });
// 启动服务器
const start = async () => {
try {