{"id":18352934,"url":"https://github.com/vedovati-matteo/mountainmates-server","last_synced_at":"2026-04-04T21:32:55.922Z","repository":{"id":252090947,"uuid":"563550442","full_name":"vedovati-matteo/MountainMates-server","owner":"vedovati-matteo","description":"A Flask-based backend API for MountainMates, managing hiking trips, user accounts, and trip templates with Firebase integration.","archived":false,"fork":false,"pushed_at":"2024-10-29T16:51:56.000Z","size":914,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-03T14:35:12.853Z","etag":null,"topics":["docker","firebase","flask","postgresql","python","restful-api","trip-planning"],"latest_commit_sha":null,"homepage":"https://vedovati-matteo.github.io/MountainMates-server/swagger.html","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/vedovati-matteo.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":"2022-11-08T21:05:15.000Z","updated_at":"2024-10-29T16:52:06.000Z","dependencies_parsed_at":"2024-08-29T17:30:03.188Z","dependency_job_id":"a9a1a1b8-56f5-4144-b8ba-7c7c06580f12","html_url":"https://github.com/vedovati-matteo/MountainMates-server","commit_stats":null,"previous_names":["vedovati-matteo/mountainmates_server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vedovati-matteo/MountainMates-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedovati-matteo%2FMountainMates-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedovati-matteo%2FMountainMates-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedovati-matteo%2FMountainMates-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedovati-matteo%2FMountainMates-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vedovati-matteo","download_url":"https://codeload.github.com/vedovati-matteo/MountainMates-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedovati-matteo%2FMountainMates-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31415110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: 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":["docker","firebase","flask","postgresql","python","restful-api","trip-planning"],"created_at":"2024-11-05T21:37:58.692Z","updated_at":"2026-04-04T21:32:55.889Z","avatar_url":"https://github.com/vedovati-matteo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MountainMates Server 🏔️\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Python](https://img.shields.io/badge/python-3.9-blue.svg)\n![Flask](https://img.shields.io/badge/flask-2.0.1-lightgrey.svg)\n![PostgreSQL](https://img.shields.io/badge/postgresql-13-blue.svg)\n![Docker](https://img.shields.io/badge/docker-20.10-blue.svg)\n\nWelcome to MountainMates Server, the robust backend powering the MountainMates application! This Flask-based API manages user accounts, hiking trips, and trip templates, making it easier than ever to organize and participate in hiking excursions.\n\n## 🌟 Features\n\n- User account management\n- Hiking trip organization\n- Trip template creation and management\n- RESTful API architecture\n- Firebase authentication integration\n- Swagger API documentation\n\n## 🏗️ System Architecture\nMountainMates follows a modern, distributed architecture designed for scalability and performance. Here's an overview of our system components and their interactions:\n\n![System Architecture](docs/architecture.png)\n\nThis architecture ensures a separation of concerns, allowing for easier maintenance and scalability of individual components as the application grows.\n\n## 🛠️ Technologies\n\n- Flask: Web framework for building the API\n- Flask-SQLAlchemy: ORM for database interactions\n- Flask-Migrate: Database migration management\n- Firebase Admin SDK: User authentication\n- Flask-RESTX: Simplifies RESTful API creation and Swagger documentation\n- PostgreSQL: Relational database for data storage\n- Docker: Application containerization\n- Gunicorn: Production-grade WSGI server\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Docker\n- Docker Compose\n\n### Setup\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/vedovati-matteo/MountainMates_server.git\n   cd MountainMates_server\n   ```\n\n2. Place your `firebase-credentials.json` file in the `/WebServer/` directory within the project\n\n3. Create a .env file in the project root and add the necessary environment variables:\n   ```\n   FIREBASE_CREDENTIALS_PATH=firebase_credential.json\n   FIREBASE_WEB_API_KEY=\u003cfirebase-web-api-key\u003e\n   POSTGRES_PASSWORD=mysecretpassword\n   FLASK_DEBUG=0 # Set 0 for production and 1 for development\n   ```\n\n4. Build and start the Docker containers:\n   ```\n   docker-compose up --build\n   ```\n\n5. The API will be available at `http://localhost:5000`\n\n### Database Migrations\n\nIf you need to run database migrations, you can use the following commands:\n\n1. Initialize the migration environment (if it's the first time):\n    ```\n    docker-compose exec app python manage.py db init\n    ```\n\n2. Generate a new migration script (after making changes to your models):\n    ```\n    docker-compose exec app python manage.py db migrate\n    ```\n\n3. Apply the migrations:\n    ```\n    docker-compose exec app python manage.py db upgrade\n    ```\n\n## 📚 API Documentation\n\n- Access the Swagger UI documentation at `http://localhost:5000/api/doc/` when the server is running.\n- For static documentation, refer to the [swagger docs](https://vedovati-matteo.github.io/MountainMates-server/swagger.html).\n- To update or regenerate the static documentation, please refer to the README file inside the `static` folder for detailed instructions.\n\n## 🔑 Authentication Helper\n\nWe provide a helper script `auth_token_getter.py` to simplify API testing without a frontend. This script allows you to obtain a Firebase ID token for a specific user, which you can then use to authenticate API requests.\n\n### Usage:\n\nRun the script with either a user's UID or email and password as arguments:\n\n```\npython auth_token_getter.py \u003cuser_uid\u003e\n```\nor\n```\npython auth_token_getter.py \u003cuser_email\u003e \u003cuser_password\u003e\n```\n\nThe script will output a Firebase ID token that you can use in your API requests.\n\nNote: This script is particularly useful for testing APIs in the Swagger UI (`/api/doc/`). You can use the generated token in the Swagger UI's \"Authorize\" feature to authenticate your requests.\n\n## 🧪 Testing\n\nRun the unit tests using:\n\n```\ndocker-compose exec app python manage.py test\n```\n\n## 🔒 Security\n\n- User authentication is handled via Firebase ID tokens.\n- Ensure to keep your `.env` file and Firebase credentials secure and never commit them to version control.\n\n## 🤝 Contributing\n\nWe welcome contributions! Please feel free to submit a Pull Request.\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 📞 Support\n\nIf you encounter any issues or have questions, please file an issue on the GitHub repository.\n\nHappy hiking with MountainMates! 🥾🏞️\n\n---\n\nBuilt with ❤️ by Matteo Vedovati\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvedovati-matteo%2Fmountainmates-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvedovati-matteo%2Fmountainmates-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvedovati-matteo%2Fmountainmates-server/lists"}