{"id":22787018,"url":"https://github.com/ahmedshetaia/moodmate","last_synced_at":"2026-02-16T23:01:40.650Z","repository":{"id":267694167,"uuid":"900730666","full_name":"AhmedShetaia/MoodMate","owner":"AhmedShetaia","description":"Welcome to MoodMate repository! This project features an interactive chatbot designed to offer empathetic responses and basic emotional support. Through thoughtful conversational design, MoodMate provides a comforting and engaging experience, helping users feel heard and understood.","archived":false,"fork":false,"pushed_at":"2024-12-11T22:13:44.000Z","size":242,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T12:07:33.098Z","etag":null,"topics":["ai","chatbot","cloud-deployment","docker","fastapi","google-cloud","langchain","streamlit"],"latest_commit_sha":null,"homepage":"https://moodmate-app-1048481941232.me-central1.run.app/","language":"Python","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/AhmedShetaia.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}},"created_at":"2024-12-09T11:17:15.000Z","updated_at":"2024-12-13T11:45:01.000Z","dependencies_parsed_at":"2024-12-11T22:29:33.591Z","dependency_job_id":null,"html_url":"https://github.com/AhmedShetaia/MoodMate","commit_stats":null,"previous_names":["ahmedshetaia/moodmate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedShetaia%2FMoodMate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedShetaia%2FMoodMate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedShetaia%2FMoodMate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedShetaia%2FMoodMate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AhmedShetaia","download_url":"https://codeload.github.com/AhmedShetaia/MoodMate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710433,"owners_count":21149190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","chatbot","cloud-deployment","docker","fastapi","google-cloud","langchain","streamlit"],"created_at":"2024-12-12T00:37:38.860Z","updated_at":"2026-02-16T23:01:35.615Z","avatar_url":"https://github.com/AhmedShetaia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MoodMate\n\n![MoodMate](images/moodmate.jpg)\n\n## Description\nMoodMate is a chatbot designed as a personal learning project to explore and practice skills in modern technologies like LangChain, FastAPI, and Streamlit. While it provides empathetic responses and basic emotional support, its primary goal is to demonstrate the integration of these tools in a functional, interactive application.\n\n## Features\nMoodMate demonstrates the integration of modern tools and frameworks to create a functional chatbot application:\n\n\u003cimg src=\"images/langchain.jpeg\" alt=\"Langchain Logo\" width=\"150\"\u003e \n\n### LangChain Integration:\n- Implements `ConversationSummaryMemory` to provide context-aware interactions.\n- Utilizes `ConversationChain` and Google’s LLM (ChatGoogleGenerativeAI) to power the chatbot's conversational logic.\n\n\u003cimg src=\"images/fastapi.jpeg\" alt=\"FastAPI Logo\" width=\"150\"\u003e \n\n### FastAPI Backend:\n- Designed an API endpoint (`/chat`) to handle user inputs and return chatbot responses.\n\n\u003cimg src=\"images/streamlit.jpeg\" alt=\"Streamlit Logo\" width=\"150\"\u003e \n\n### Streamlit Frontend:\n- Developed an interactive web interface to send user queries to the API and display responses.\n\n\u003cimg src=\"images/Docker.png\" alt=\"Docker Logo\" width=\"150\"\u003e \n\n### Docker for Containerization:\n- Containerized the entire system, ensuring portability and ease of deployment.\n\n\u003cimg src=\"images/gcr.jpeg\" alt=\"GCR Logo\" width=\"150\"\u003e \n\n### Google Cloud Run Deployment:\n- Deployed the application online, making it accessible from anywhere.\n\n## Table of Contents\n1. [Project Structure](#project-structure)\n2. [Installation](#installation)\n3. [Deployment](#deployment)\n4. [License](#license)\n5. [Contact](#contact)\n\n## Project Structure\nThe `moodmate/` project directory is organized as follows:\n\n```plaintext\nmoodmate/\n├── api/                      # Backend code for the chatbot API\n│   ├── .env                  # Include your GOOGLE_API_KEY\n│   ├── api.py                # API server entry point, handles requests and responses\n│   ├── chatbot.py            # Core chatbot logic, including conversation management\n│   ├── requirements.txt      # Dependencies required for the backend\n│   └── Dockerfile            # Dockerfile for containerizing the backend\n│\n├── app/                      # Frontend application code\n│   ├── app.py                # Streamlit app entry point, provides user interface\n│   ├── requirements.txt      # Dependencies required for the frontend\n│   └── Dockerfile            # Dockerfile for containerizing the frontend\n│\n├── images/                   # Project assets like screenshots\n│   └── moodmate.png          # Screenshot of the MoodMate interface\n│\n├── .dockerignore             # Specifies files to exclude from Docker builds\n├── .gitignore                # Specifies files to exclude from Git commits\n├── docker-compose.yml        # Configuration for Docker Compose to run the project\n└── README.md                 # Project documentation\n```\n\n## Installation\nTo run MoodMate locally, follow these steps:\n\n### Clone the repository:\n```bash\ngit clone https://github.com/AhmedShetaia/moodmate.git\ncd moodmate\n```\n### Create a new Python environment\n```bash\npython -m venv myenv\n```\nmake sure to activate it \n```bash\nmyenv\\Scripts\\activate\n```\n### Environment Variables\nMoodMate requires a Google API Key to access Google’s LLM for powering chatbot interactions. Follow these steps to set it up:\n\n#### Obtain a Google API Key:\n1. Visit the [Google Cloud Console](https://console.cloud.google.com/).\n2. Create a new project or select an existing one.\n3. Enable the Generative AI API or the relevant service.\n4. Generate an API key from the **APIs \u0026 Services** section.\n\n#### Create a `.env` file inside the `api/` directory:\n```bash\ntouch api/.env\n```\n\n#### Add the API key to the `.env` file:\n```env\nGOOGLE_API_KEY=your-google-api-key\n```\nReplace `your-google-api-key` with the actual API key obtained from Google Cloud.\n\n### Other environment variables:\nAdditional environment variables required for the system are specified in the Dockerfile and managed during containerization.\n\n### Install Docker:\n```bash\npip install docker\n```\n\n### Build and run the Docker container:\n```bash\ndocker-compose up --build\n```\n\n### Access the application:\nOpen the Streamlit server using the link provided in the terminal output.\n\n## Deployment\nMoodMate is deployed using Google Cloud Run, enabling easy scalability and online accessibility. Follow these steps for deployment:\n\n### Prerequisites\n#### Google Cloud Account:\n- Create a Google Cloud account.\n- Ensure billing is enabled for your account.\n\n#### Set Up Permissions:\n1. Create a new project in Google Cloud (e.g., `moodmate-project`).\n2. Enable the following services:\n   - Cloud Run\n   - Artifact Registry\n   - Container Registry\n3. Grant necessary IAM permissions for deployment (e.g., Cloud Run Admin, Storage Admin).\n\n### Steps to Deploy\n\n#### Step 1: Set Up Artifact Registry\n1. Navigate to the Artifact Registry in the Google Cloud Console.\n2. Create a new Docker repository:\n   - **Repository name**: `moodmate-repo`\n   - **Location**: Choose a region close to your user base.\n   - **Format**: Docker.\n3. Authenticate Docker with Google Cloud:\n\nTo authenticate Docker with Google Cloud, follow these steps:\n\n##### 1: Generate the Access Token\nRun the following command to generate and print your access token:\n```bash\ngcloud auth print-access-token\n```\nCopy the token from the output.\n\n##### 2: Log in to Docker with the Token\nRun the docker login command and paste the token when prompted for a password:\n\nFor Artifact Registry:\n```bash\ndocker login -u oauth2accesstoken https://\u003cregion\u003e-docker.pkg.dev\n```\nReplace `\u003cregion\u003e` with your registry's region (e.g., us, me-central1, or asia).\n\n##### Step 3: Paste the Token\nWhen prompted for a password after running the docker login command, paste the token you copied in Step 1.\n\nOutput should look like this :\n```bash\n$ docker login -u oauth2accesstoken https://gcr.io\nPassword: \nLogin Succeeded\n```\nNow, you are authenticated with Docker using the manually copied token.\n\n#### Step 2: Build and Push Docker Images\n\n##### Build the API backend Docker image:\n```bash\ndocker build -t REGION-docker.pkg.dev/PROJECT_ID/moodmate-repo/api-backend ./api\n```\n\n##### Build the app frontend Docker image:\n```bash\ndocker build -t REGION-docker.pkg.dev/PROJECT_ID/moodmate-repo/app-frontend ./app\n```\n\n##### Push the images to Artifact Registry:\n\n###### API Backend:\n```bash\ndocker push REGION-docker.pkg.dev/PROJECT_ID/moodmate-repo/api-backend\n```\n\n###### App Frontend:\n```bash\ndocker push REGION-docker.pkg.dev/PROJECT_ID/moodmate-repo/app-frontend\n```\n\n#### Step 3: Deploy on Google Cloud Run\n\n##### Deploy the API backend:\n```bash\ngcloud run deploy moodmate-api \\\n    --image REGION-docker.pkg.dev/PROJECT_ID/moodmate-repo/api-backend \\\n    --platform managed \\\n    --region REGION \\\n    --allow-unauthenticated\n```\n\n##### Deploy the app frontend:\n```bash\ngcloud run deploy moodmate-app \\\n    --image REGION-docker.pkg.dev/PROJECT_ID/moodmate-repo/app-frontend \\\n    --platform managed \\\n    --region REGION \\\n    --allow-unauthenticated \\\n    --set-env-vars API_URL=https://moodmate-api-YOUR_PROJECT_ID.REGION.run.app/\n```\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/AhmedShetaia/MoodMate/blob/main/LICENSE) file for details.\n\n## Contact\nFeel free to connect with me on [LinkedIn](https://www.linkedin.com/in/ahmed-shetaia/). I’d love to hear your feedback, discuss the project, or collaborate on future ideas!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedshetaia%2Fmoodmate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedshetaia%2Fmoodmate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedshetaia%2Fmoodmate/lists"}