# nextjs-mvp **Repository Path**: cleanbing/nextjs-mvp ## Basic Information - **Project Name**: nextjs-mvp - **Description**: MVP project base on nextjs 基于NextJS框架的最小化项目架构 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-03-15 - **Last Updated**: 2025-03-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # lawyer_aipower #### 介绍 律师工作者的AI助理 This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## Getting Started First, run the development server: ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More To learn more about Next.js, take a look at the following resources: - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! ## Deploy on Vercel The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. # 关于该项目的其他说明 pnpm dlx prisma studio 这会启动一个网页界面(通常在 http://localhost:5555),让您可以: - 查看所有数据表的结构 - 查看和编辑表中的数据 - 添加测试数据 - 验证表之间的关系 pnpm run db:seed - 将seed.ts中的数据导入到数据库中 # AI Lawyer Assistant 基于人工智能的法律咨询助手系统。 ## 项目结构 ### 页面结构 #### 1. 营销展示页面 (`/home`) - 公开页面,任何人都可以访问 - 包含产品介绍、功能展示 - 主要功能按钮: - "立即开始" -> 跳转到登录页面 - "免费注册" -> 跳转到注册页面 - 访问根路径 `/` 时会自动重定向到此页面 #### 2. 登录页面 (`/login`) - 公开页面,处理用户认证 - 已登录用户会自动重定向到主界面 - 功能组件: - 登录表单(用户名/密码) - "记住我"选项 - "忘记密码"链接 - "立即注册"链接 #### 3. 用户主界面 (`/main`) - 受保护页面,需要用户登录 - 未登录用户会被重定向到登录页面 - 包含: - 导航栏 - 用户信息 - 主要功能区域 ### 页面访问流程 ``` 1. 首次访问: / (根路径) ----重定向----> /home 2. 未登录用户: /home ----点击"立即开始"----> /login /home ----点击"免费注册"----> /register 3. 登录流程: /login ----登录成功----> /main /login <----登录失败---- (停留在登录页面) 4. 受保护页面访问: /main ----未登录----> /login /main <----已登录---- (正常访问) ``` ### 权限控制 ```typescript 公开路由: ['/login', '/register', '/reset-password', '/home', '/'] - 这些页面任何人都可以访问 - 已登录用户访问 /login 会被重定向到 /main 受保护路由: ['/main', ...] - 需要登录才能访问 - 未登录用户会被重定向到 /login ``` ## 技术栈 - 前端框架:Next.js - UI 框架:Tailwind CSS - 状态管理:React Context - 认证:基于 Cookie 的会话管理 ## 开发指南 ### 安装依赖 ```bash npm install ``` ### 运行开发服务器 ```bash npm run dev ``` ### 构建生产版本 ```bash npm run build ``` ## 贡献指南 1. Fork 本仓库 2. 创建你的特性分支 (`git checkout -b feature/AmazingFeature`) 3. 提交你的改动 (`git commit -m 'Add some AmazingFeature'`) 4. 推送到分支 (`git push origin feature/AmazingFeature`) 5. 开启一个 Pull Request ## 许可证 [MIT](LICENSE)