A modern, full-stack chatbot application with user authentication, conversation management, and OpenAI integration. Built with FastAPI backend and React TypeScript frontend.
- User Authentication & Authorization: JWT-based authentication with role-based access control
- Intelligent Chat Interface: OpenAI-powered conversations with context awareness
- Conversation Management: Save, retrieve, and organize chat histories
- Data Source Integration: Upload and process CSV files for contextual responses
- Admin Dashboard: User management, analytics, and system monitoring
- Dark/Light Theme: Customizable UI themes
- Real-time Analytics: Usage statistics and conversation insights
βββ backend/ # FastAPI REST API
β βββ app/
β β βββ models/ # Database models (SQLAlchemy)
β β βββ routers/ # API endpoints
β β βββ schemas/ # Pydantic models
β β βββ services/ # Business logic
β βββ uploads/ # File storage
βββ frontend/ # React TypeScript SPA
β βββ src/
β β βββ components/
β β βββ contexts/
β β βββ pages/
β β βββ services/
β βββ public/
- Node.js: 18.0.0 or higher
- Python: 3.8 or higher
- npm or yarn: Latest stable version
- OpenAI API Key: Required for chat functionality
git clone https://github.com/B1gB4dB4ng/ChatBotAssistant.git
cd ChatBotAssistantcd backend# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txt-
Copy the environment template:
cp .env.example .env
-
Edit
.envfile with your configuration:OPENAI_API_KEY=your_openai_api_key_here ENVIRONMENT=development LOG_LEVEL=INFO API_HOST=0.0.0.0 API_PORT=8000 # Database Configuration DATABASE_URL=sqlite:///./smart_assistant.db # JWT Authentication SECRET_KEY=your-secret-key-here-change-in-production-minimum-32-characters ACCESS_TOKEN_EXPIRE_MINUTES=43200
β οΈ Important: Replaceyour_openai_api_key_herewith your actual OpenAI API key and generate a secure secret key (minimum 32 characters).
python -m app.init_dbuvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadThe API will be available at http://localhost:8000
- API Documentation:
http://localhost:8000/docs - Alternative Docs:
http://localhost:8000/redoc
cd frontendnpm installnpm run devThe application will be available at http://localhost:5173
- Navigate to
http://localhost:5173 - Register a new account
- Login with your credentials
- Start chatting with the AI assistant
- First registered user automatically becomes admin
- Access admin dashboard via user menu
- Manage users, view analytics, and monitor system health
- Upload CSV files through the admin interface
- Files are processed and made available for contextual AI responses
- Supported formats: CSV with headers
cd backend
# Activate virtual environment
source venv/bin/activate # or venv\Scripts\activate on Windows
# Install development dependencies
pip install -r requirements.txt
# Run with auto-reload
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
## π API Documentation
### Key Endpoints
- `GET /` - API health check and information
- `POST /api/v1/auth/login` - User authentication
- `POST /api/v1/auth/register` - User registration
- `POST /api/v1/chat/message` - Send chat message
- `GET /api/v1/conversations` - List user conversations
- `GET /api/v1/admin/users` - Admin user management
Full API documentation available at `http://localhost:8000/docs`