This is the backend API implementation version of the web_minco project, using Vercel Serverless Functions to provide backend services, including task management and AI conversation functionality.
This repository is forked from the original frontend project, with the following additions:
- Backend API implementation using Vercel Serverless Functions
- CRUD operations for task management
- AI chat integration with API key support
- Mock data support
- Clone the repository
git clone https://github.com/Rona-dt/web_minco_backend.git
cd web_minco_backend- Install dependencies
npm install
# Install necessary dependencies
npm install express @types/express dotenv
npm install openai
npm install -g vercel # Install Vercel CLI- Configure environment variables
Create a
.envfile and add:
API_KEY=<Replace with your API Key>
- Run locally
vercel devThe application will start locally, typically accessible at http://localhost:3000.
- Build the project
npm run buildBuilt files will be output to the dist directory.
This project uses Vercel Serverless Functions for backend API implementation:
- Register an account on Vercel and connect to your GitHub repository
- Import the project
- Add the
API_KEYenvironment variable in your Vercel project settings - Click deploy to complete deployment
The project includes the following API endpoints:
/api/tasks- Task Management- GET: Retrieve task list
- POST: Create new task
/api/chat- AI Conversation- POST: Send message and receive AI response
- React 18
- TypeScript
- Vite
- Express (Serverless Functions)
- Tailwind CSS
- Lucide React (Icon library)
- React Router
- Headless UI
- Vercel Serverless Functions
- OpenAI API Integration
- Node.js
- Use
vercel devcommand for local development to support Serverless Functions - API implementations are located in the
/apidirectory - Currently using mock data for development, may migrate to standalone backend service later
- The chat functionality (chat.ts) needs to be modified according to your specific AI model and API implementation
- Added complete backend API implementation
- Integrated AI chat functionality
- Replaced pure frontend implementation with Vercel Serverless Functions
- Added mock data support
- Ensure
.envfile is added to.gitignore - Local development must use
vercel devinstead ofnpm run dev - Requires a Vercel account and Vercel CLI installation
- Requires an API key for your chosen AI model
- The chat implementation (chat.ts) needs to be modified based on your specific AI model and API requirements