An agentic AI chat assistant, designed to help you bake your next successful startup idea.
-
Backend API built with FastAPI
- RESTful endpoints
- Async support
- Automatic API documentation
- Health check endpoint
-
Frontend built with React & TypeScript
- Responsive chat interface
- Real-time messaging
- Modern UI with styled-components
- Type-safe development
- Backend: Python, FastAPI, Uvicorn, Langgraph
- Frontend: React, TypeScript
- Build Tools: npm, Create React App
- API Documentation: Swagger UI, ReDoc
- Node.js (v14 or later)
- Python 3.9+ (recommended: 3.9 or later)
- npm or Yarn
- Git
- UV (Python package installer)
-
Install Python (if not already installed):
# Using Homebrew (macOS) brew install python # Or using system package manager (Ubuntu/Debian) sudo apt update sudo apt install python3 python3-pip python3-venv
-
Verify installation:
python3 --version pip3 --version
- Download Python from python.org
- Run the installer and make sure to check "Add Python to PATH"
- Verify installation in Command Prompt or PowerShell:
python --version pip --version
# Install uv using curl
curl -LsSf https://astral.sh/uv/install.sh | sh
# Add uv to your shell's configuration file (e.g., ~/.bashrc, ~/.zshrc)
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc
source ~/.zshrc # or ~/.bashrc
# Verify installation
uv --version# Install uv using PowerShell
irm https://astral.sh/uv/install.ps1 | iex
# Add uv to your PATH (if not added automatically)
[System.Environment]::SetEnvironmentVariable("Path", [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User) + ";$env:USERPROFILE\.cargo\bin", [System.EnvironmentVariableTarget]::User)
# Restart your terminal and verify installation
uv --version-
Clone the repository
git clone <repository-url> cd startup-bakery
-
Set up the backend
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate uv pip install . cp .env-example .env
-
Set up the frontend
cd ../frontend npm install # or yarn install
cd backend
uv run uvicorn main:app --reloadThe backend will be available at http://localhost:8000
In a new terminal:
cd frontend
npm startThe frontend will open automatically at http://localhost:3000
To run the backend tests using uv, make sure you're in the backend directory:
cd backend
# Run all tests
uv run pytest tests/
# Run a specific test file
uv run pytest tests/test_main.py
uv run pytest tests/test_chat_graph.py
# Run tests with coverage report
uv run pytest --cov=. tests/
# Run tests with specific markers (if any)
uv run pytest -m "not slow" tests/ # Example: skip slow tests
# Run tests with verbose output
uv run pytest -v tests/tests/test_main.py: Tests for the FastAPI application endpointstests/test_chat_graph.py: Tests for the chat graph functionalitytests/conftest.py: Test fixtures and configurations
The chat system is built with a modular and scalable architecture that enables stateful conversations and complex interactions. Here are the key components:
- LangGraph-based state machine for managing conversation flow
- Stateful processing with conversation context preservation
- Modular design for easy extension of capabilities
- Token management with intelligent message truncation
- Conversation lifecycle management
- Thread-safe conversation handling
- Global state management for multi-user support
- Conversation isolation for security and privacy
- Asynchronous message processing pipeline
- Context window management with smart truncation
- Token counting for efficient resource usage
- Timestamp management for message ordering
- User sends a message to the
/chatendpoint - System retrieves or creates a conversation context
- Message is processed through the chat graph
- Response is generated using GPT-4o-mini
- Conversation state is updated and persisted
POST /chat- Process a chat messageDELETE /conversations/{conversation_id}- Clear a conversationGET /conversations- List all active conversationsGET /health- Check API health status
- State Management: Thread-safe conversation state tracking
- Token Management: Automatic truncation of long conversations
- Error Handling: Comprehensive error handling and logging
- Scalability: Designed for horizontal scaling
Once the backend is running, you can access:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
startup-bakery/
βββ backend/ # FastAPI backend
β βββ main.py # Main application file
β βββ tests/ # Test files
β βββ requirements.txt
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # React components
β β βββ App.tsx
β β βββ index.tsx
β βββ package.json
βββ README.md # This file
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Have questions? Open an issue or reach out to the maintainers.