A React application for building project specifications with an AI-powered chatbot assistant and SQLite database for storing customer data and tasks.
- Form Builder: Interactive form for creating project specifications
- AI Chatbot: OpenAI-powered assistant that provides contextual help
- Form Field Tracking: The chatbot knows which form field you're working on
- Manual Form Selection: Dropdown to manually select which form field to get help with
- SQLite Database: Persistent storage for customer specs, answers, and tasks
- Task Management: Create, update, and manage tasks for each project specification
- Chat History: Persistent chat history for each spec
The application uses SQLite with the following tables:
- specs: Customer information and spec metadata
- spec_answers: Individual form field answers for each spec
- tasks: Task management for each spec
- chat_history: Persistent chat conversations
-
Install dependencies:
npm install
-
Set up OpenAI API key:
- Get your API key from OpenAI
- Create a
.envfile in the root directory - Add your API key:
OPENAI_API_KEY=your_actual_api_key_here
-
Start the development servers:
npm run dev
This will start both the React frontend (port 3000) and the Express backend (port 3001).
- Enter customer name and email
- Click "Create New Spec" to start a new project
- Fill out the form fields with AI assistance
- Use "Save Form" to persist your answers
- Load existing specs by entering the spec ID
- Navigate to
/task-managerin your browser - Select a project specification from the left panel
- Create tasks with title, description, priority, assignee, and due date
- Update task status (pending, in-progress, completed)
- Delete tasks as needed
- The chatbot provides contextual help based on the current form field
- Chat history is automatically saved to the database
- Manual form field selection via dropdown
- Real-time AI responses using OpenAI's API
POST /api/specs- Create a new specGET /api/specs- Get all specsGET /api/specs/:id- Get specific spec with answersPOST /api/specs/:id/answers- Save form answers
POST /api/specs/:id/tasks- Create a task for a specGET /api/specs/:id/tasks- Get tasks for a specPUT /api/tasks/:id- Update a taskDELETE /api/tasks/:id- Delete a task
POST /api/chat- Get AI response and save to databasePOST /api/specs/:id/chat- Save chat messageGET /api/specs/:id/chat- Get chat history for a spec
The SQLite database is automatically created as database.sqlite in the project root when you first run the server.