{"id":22772423,"url":"https://github.com/mthomason/mbot","last_synced_at":"2026-04-16T10:02:37.864Z","repository":{"id":263653730,"uuid":"661075479","full_name":"mthomason/mbot","owner":"mthomason","description":"A starter template for an AI-powered chat applications with Svelte-Typescript JS (frontend), Python FastAPI (backend), and OpenAI integration. Perfect for startups, developers, and hobbyists looking to create interactive chat experiences or experiment with modern web frameworks.","archived":false,"fork":false,"pushed_at":"2025-12-06T06:47:09.000Z","size":718,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-10T00:22:15.451Z","etag":null,"topics":["ai","artificial-intelligence","backend","chat-application","chatbot","chatgpt","fastapi","firebase","firebase-auth","frontend","mit-license","open-source","openai","python","python3","starter-kit","starter-template","sveltekit","web-development"],"latest_commit_sha":null,"homepage":"","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mthomason.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-07-01T17:56:50.000Z","updated_at":"2025-12-06T06:47:12.000Z","dependencies_parsed_at":"2024-12-20T08:27:29.007Z","dependency_job_id":"ac7a2fca-4418-4e3c-a0c4-3f078c5e50e8","html_url":"https://github.com/mthomason/mbot","commit_stats":null,"previous_names":["mthomason/mbot"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/mthomason/mbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthomason%2Fmbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthomason%2Fmbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthomason%2Fmbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthomason%2Fmbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mthomason","download_url":"https://codeload.github.com/mthomason/mbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthomason%2Fmbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31880884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","artificial-intelligence","backend","chat-application","chatbot","chatgpt","fastapi","firebase","firebase-auth","frontend","mit-license","open-source","openai","python","python3","starter-kit","starter-template","sveltekit","web-development"],"created_at":"2024-12-11T17:08:32.082Z","updated_at":"2026-04-16T10:02:37.860Z","avatar_url":"https://github.com/mthomason.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mbot: For Svelte and FastAPI Chat with OpenAI\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n## Overview\n\n**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.  It should work with any of the major AI providers.\n\nThis project currently uses the following tools and packages on the frontend:\n\n- [Typescript](https://www.typescriptlang.org/docs/) for programming the frontend\n- [SvelteKit](https://svelte.dev/docs/kit/introduction) v2 for routing\n- [Skeleton](https://www.skeleton.dev/) v4 for theming and components\n- [Tailwind CSS](https://tailwindcss.com/) v4 for style\n- [Firebase](https://firebase.google.com/docs/auth) for authentication\n- [Vite](https://vite.dev/) v7 for building\n\nThe backend is build using the following:\n\n- [Python3](https://docs.python.org/3.13/) for the backend\n- [FastAPI](https://fastapi.tiangolo.com/) for backend server\n- [OpenAI-Python](https://github.com/openai/openai-python) for chat completions (_works with other services like Google Gemini_)\n\nThis project is designed for:\n\n- **AI startup enthusiasts** building chat applications.\n- **Developers** exploring Svelte and FastAPI.\n- **Hobbyists** experimenting with OpenAI's GPT models.\n\n## Features\n\n- Modern Frontend: Built with SvelteKit for reactive UI.\n- FastAPI Backend: Async API integration with OpenAI.\n- Secure Authentication: Firebase for user authentication.\n- Boilerplate for AI Apps: A great foundation for interactive AI chat solutions.\n\n## Demo\n\n\u003cimg src=\"docs/assets/images/mbot_preview.gif\" alt=\"mbot Demo\" width=\"220\"\u003e\n\n## Table of Contents\n\n1. [Features](#features)\n2. [Getting Started](#getting-started)\n3. [Project Structure](#project-structure)\n4. [Environment Variables](#environment-variables)\n5. [Running the Project](#running-the-project)\n6. [Authentication](#authentication)\n7. [Contributing](#contributing)\n8. [License](#license)\n\n## Getting Started\n\n### Prerequisites\n\n1. Node.js\n    Install from [Node.js official site](https://nodejs.org).\n2. Python\n    Install from [Python's official site](https://www.python.org).\n3. Firebase Project\n    Create a Firebase project for authentication (free tier is sufficient).\n4. OpenAI API Key\n    Obtain an API key from [OpenAI's platform](https://platform.openai.com).\n\n### Installation\n\n#### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/mthomason/mbot.git\ncd mbot\n```\n\n#### 2. Set Up the Backend\n\n```bash\ncd backend\npython -m venv venv\nsource venv/bin/activate (On Windows: venv\\Scripts\\activate)\npip install -r ../requirements.txt\n```\n\nAlternatively, you can install the `.venv` in the projects root directory\n\n```bash\npython -m venv .venv\nsource .venv/bin/activate (On Windows: .venv\\Scripts\\activate)\npip install requirements.txt\n```\n\n#### 3. Set Up the Frontend\n\n```bash\ncd frontend\nnpm install\n```\n\n#### 4. Add your Environment Variables\n\nSee [Environment Variables](#environment-variables)\n\n#### 5. Run the project (see Running the Project)\n\n## Project Structure\n\n```bash\nfrontend/         # SvelteKit app for the UI\nbackend/          # FastAPI app for APIs\nbackend/app/      # FastAPI endpoints and logic\nbackend/mserv/    # Backend utilities and config\nelectron/         # Optional Electron app (if applicable)\ndocs/             # Documentation files\n```\n\n## Environment Variables\n\n### Step 1: Backend Environment Variables\n\nTo configure your *backend* environment variables, create a `.env` file in the *__root__ directory* of the project with the following structure:\n\n```bash\n# Used for Firebase authentication\nGOOGLE_PROJECT_ID_MBOT=my-firebase-project-id \n\n# Used for OpenAI services\nOPENAI_API_KEY_MBOT=sk-xxxxxxxxxxxxxxxxxxxx\n```\n\n- **GOOGLE_PROJECT_ID_MBOT**: Your Firebase project ID, used for authentication.\n- **OPENAI_API_KEY_MBOT**: Your API key for OpenAI services. Remember that usage may incur costs.\n\n### Step 2: Frontend Environment Variables\n\nTo configure the *frontend* environment variables, create a `.env` file in the *__`frontend`__ directory* of the project with the following structure:\n\n```bash\n# These values are given to you by Google when\n#   You create a new Firebase project.\n#   They will be in the form of a .JSON file.\n#   It's your Firebase Project config information for auth.\nVITE_FIREBASE_API_KEY=ABCDEFGHIJKLMNOPQRSTUVWXYZA-12345678901\nVITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com\nVITE_FIREBASE_PROJECT_ID=my-firebase-project-id\nVITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com\nVITE_FIREBASE_MESSAGING_SENDER_ID=777777777777\nVITE_FIREBASE_APP_ID=1:777777777777:web:3333333333333333333333\nVITE_FIREBASE_MEASUREMENT_ID=G-ABCDEF7890\n```\n\nNote that `VITE_FIREBASE_PROJECT_ID` is the same value as `GOOGLE_PROJECT_ID_MBOT` in the backend.\n\n## Running the Project\n\nThis project was developed using Visual Studio Code as the IDE and includes a pre-configured launch profile for a seamless startup experience.\n\nThe recommended way to run the application is by using the provided \"Launch mbot (client and server)\" debug configuration. The configuration file, `launch.json`, is included in the `.vscode` folder.\n\nTo run the project:\n\n1. Open the project root in VSCode.\n2. After you've created the `venv` virtual environment, VS Code should automatically detect it and ask if you want to use it for the workspace. Click \"Yes\" to accept.\n3. If you are not prompted, you can manually select the interpreter by opening the Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`) and typing \"Python: Select Interpreter\". Choose the interpreter located in the `venv/bin` (or `venv\\Scripts` on Windows) directory.\n4. Navigate to the \"Run and Debug\" view (usually in the left-hand sidebar).\n5. Select the `Launch mbot (client and server)` configuration from the dropdown menu.\n6. Press F5 or click the green play button to start both the frontend and backend servers.\n\nAlternatively, you can run the components manually:\n\n### Backend\n\n```bash\ncd backend\nsource venv/bin/activate\nuvicorn main:fastapi_app --reload\n```\n\n### Frontend\n\n```bash\ncd frontend\nnpm run dev\n```\n\n## Authentication\n\nTo use the chat functionality, you must be authenticated. This is a deliberate feature of this starter project to demonstrate how to protect routes and integrate authentication in a modern web application.\n\n**Note:** Currently, there is no warning message if you attempt to use the chat without being authenticated. The chat simply will not respond. This is a known issue and will be addressed in a future update.\n\n## Contributing\n\nContributions are welcome! Please fork the repo and submit a pull request. Before contributing, make sure to:\n\n1. Write clear documentation for new features.\n2. Follow the existing code style.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Webfront\n\nThis project has a webfront [here](https://mthomason.github.io/mbot/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthomason%2Fmbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmthomason%2Fmbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthomason%2Fmbot/lists"}