# todo-app **Repository Path**: rogueskill/todo-app ## Basic Information - **Project Name**: todo-app - **Description**: 使用go做好端,Next.js 做前端的demo项目 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-16 - **Last Updated**: 2025-09-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Todo App 这是一个使用 Go 1.25 和 Next.js 14 构建的简单待办事项应用。该应用包含前后端交互,允许用户添加和查看待办事项。 ## 项目结构 ``` todo-app ├── backend │ ├── main.go # 后端应用的入口点 │ ├── service │ │ └── todo_service.go # 待办事项服务实现 │ ├── rpc │ │ └── todo_rpc.go # RPC服务的接口和实现 │ ├── models │ │ └── task.go # 任务模型定义 │ ├── tests │ │ └── todo_service_test.go # 单元测试 │ └── go.mod # Go模块配置文件 ├── frontend │ ├── app │ │ ├── page.tsx # 前端应用的主页面 │ │ └── components │ │ ├── TaskList.tsx # 展示待办事项的组件 │ │ └── AddTaskForm.tsx # 添加新任务的组件 │ ├── package.json # 前端项目配置文件 │ ├── next.config.js # Next.js配置文件 │ └── tsconfig.json # TypeScript配置文件 └── README.md # 项目文档和使用说明 ``` ## 运行命令 1. 在 `backend` 目录下,运行以下命令启动后端服务: ``` go run main.go ``` 2. 在 `frontend` 目录下,运行以下命令启动前端应用: ``` npm install npm run dev ``` ## 环境要求 确保在运行前已安装以下环境: - Go 1.25 - Node.js ## 功能 - 添加新任务 - 查看所有待办事项 - 删除任务(附加功能) ## 单元测试 后端的 `AddTask` 和 `GetTasks` 方法包含单元测试,确保服务的正确性。测试文件位于 `backend/tests/todo_service_test.go`。