mbot is an open-source starter project for building AI-powered chatbot applications. Combining a modern tech stack of Svelte for the frontend and FastAPI for the backend, it provides Firebase authentication and integrates seamlessly with OpenAI APIs.
This project is designed for:
- AI startup enthusiasts building chat applications.
- Developers exploring Svelte and FastAPI.
- Hobbyists experimenting with OpenAI's GPT models.
- Modern Frontend: Built with SvelteKit for reactive UI.
- FastAPI Backend: Async API integration with OpenAI.
- Secure Authentication: Firebase for user authentication.
- Boilerplate for AI Apps: A great foundation for interactive AI chat solutions.
- Features
- Getting Started
- Project Structure
- Environment Variables
- Running the Project
- Contributing
- License
- Node.js
Install from Node.js official site. - Python
Install from Python's official site. - Firebase Project
Create a Firebase project for authentication (free tier is sufficient). - OpenAI API Key
Obtain an API key from OpenAI's platform.
git clone https://github.com/mthomason/mbot.git
cd mbot
cd backend
python -m venv venv
source venv/bin/activate (On Windows: venv\Scripts\activate)
pip install -r requirements.txt
cd frontend
npm install
See Environment Variables
frontend/ # SvelteKit app for the UI
backend/ # FastAPI app for APIs
backend/app/ # FastAPI endpoints and logic
backend/mserv/ # Backend utilities and config
electron/ # Optional Electron app (if applicable)
docs/ # Documentation files
Create a .env
file in the root directory and set the following:
GOOGLE_PROJECT_ID_MBOT=your-firebase-project-id
OPENAI_API_KEY_MBOT=your-openai-api-key
- GOOGLE_PROJECT_ID_MBOT: Firebase project ID for authentication.
- OPENAI_API_KEY_MBOT: API key for OpenAI services (note: usage may incur costs).
Use the provided VSCode debug configuration for ease of use. Follow these steps:
- Open the project in VSCode.
- Select the
Launch mbot client and server
configuration. - Press F5 to start debugging.
Alternatively, run the components manually:
cd backend
source venv/bin/activate
uvicorn main:fastapi_app --reload
cd frontend
npm run dev
Contributions are welcome! Please fork the repo and submit a pull request. Before contributing, make sure to:
- Write clear documentation for new features.
- Follow the existing code style.
This project is licensed under the MIT License. See the LICENSE file for details.