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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user