WhatsEase is a real-time chat application built with FastAPI, Socket.IO, and a Supabase backend. It features JWT authentication, persistent message history, and an integrated AI chatbot powered by the Google Gemini API.
- Real-time Messaging: Instant communication between users in different rooms.
- User Authentication: Secure login system using JWT.
- Room Management: Users can create new chat rooms and join existing ones by their unique ID.
- Persistent Chat History: All messages are saved to a PostgreSQL database (Supabase) and loaded when a user joins a room.
- AI Chatbot: Integrated Gemini-powered bot that responds to user messages in a designated room.
The application uses a PostgreSQL database managed by Supabase. The schema is designed to handle users, rooms, message history, and their relationships.
- Backend: Python, FastAPI, Uvicorn, Python-SocketIO
- Database: Supabase (PostgreSQL)
- AI: Google Gemini API
- Authentication: JWT (PyJWT)
- Frontend: HTML, CSS, JavaScript (no framework)
- Environment Management: python-dotenv
-
Clone the repository:
git clone <your-repository-url> cd <your-repository-folder>
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
Create a
.envfile in the project root:GEMINI_API_KEY=your_gemini_api_key_here SUPABASE_URL=your_supabase_project_url_here SUPABASE_KEY=your_supabase_service_role_key_here BOT_ROOM_ID=the_uuid_of_your_bot_room_here
Make sure your virtual environment is activated, then run the Uvicorn server:
uvicorn main:socket_app --reloadYour server should now be running at http://127.0.0.1:8000/.