{"id":20954982,"url":"https://github.com/one-bit-myanmar/api-for-sarrmal-app","last_synced_at":"2025-05-14T04:32:55.202Z","repository":{"id":252664380,"uuid":"841052708","full_name":"One-Bit-Myanmar/api-for-sarrmal-app","owner":"One-Bit-Myanmar","description":"API for sarr ml app using fastapi","archived":false,"fork":false,"pushed_at":"2024-11-27T22:48:26.000Z","size":364,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T13:03:34.305Z","etag":null,"topics":["fastapi","python"],"latest_commit_sha":null,"homepage":"","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/One-Bit-Myanmar.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-08-11T13:56:51.000Z","updated_at":"2024-11-27T22:48:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4230062-54be-4897-b6d4-a3e11a242197","html_url":"https://github.com/One-Bit-Myanmar/api-for-sarrmal-app","commit_stats":null,"previous_names":["one-bit-myanmar/api-for-sarrmal-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-Bit-Myanmar%2Fapi-for-sarrmal-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-Bit-Myanmar%2Fapi-for-sarrmal-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-Bit-Myanmar%2Fapi-for-sarrmal-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-Bit-Myanmar%2Fapi-for-sarrmal-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/One-Bit-Myanmar","download_url":"https://codeload.github.com/One-Bit-Myanmar/api-for-sarrmal-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254071346,"owners_count":22009776,"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":["fastapi","python"],"created_at":"2024-11-19T01:17:11.522Z","updated_at":"2025-05-14T04:32:54.931Z","avatar_url":"https://github.com/One-Bit-Myanmar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Food Recommendation API\n\n**NOTE: please don't change everything in main branch, if you want to change you have to create new branch with your desired name.**\n\n\u003e You can also check how the main branch is developed by checking the other branches, the branches are as follow....\n- sample-api: testing fastapi, just pure\n- api-with-mongodb: testing with mongodb database\n\n**Run the docker container**\n\n```shell\ndocker-compose up -d\n```\n\n\n1. Clone the repo\n\n```git\ngit clone https://github.com/Hein-HtetSan/api-for-sarrmal-app.git\n```\n\nCreate **env dir** and **credentials.env**\n```shell\nmkdir env\ncd env\ntouch credentials.env\n```\n\n2. Create a Virtual Environment\n\n```shell\npython -m venv venv\n```\n\n3. Activate the Virtual Environment\n\n```shell\n# for windows\nvenv\\Scripts\\activate\n\n# for mac\nsource venv/bin/activate\n```\n\n4. Install Dependencies\n\n```shell\npip install -r requirements.txt\n```\n\n5. After installing new packages, don't forget to update (optional)\n\n```shell\npip freeze \u003e requirements.txt\n```\n\n6. Project Structures\n\n```\napp/\n├── venv/                     # Virtual environment directory\n├── app/\n│   ├── __init__.py\n│   ├── main.py\n│   ├── api/\n│   │   ├── __init__.py\n│   │   ├── endpoints/\n│   │   │   ├── __init__.py\n│   │   │   ├── recommendations.py\n│   │   │   ├── users.py\n│   │   │   ├── foods.py\n│   ├── core/\n│   │   ├── __init__.py\n│   │   ├── config.py\n│   │   ├── security.py\n│   ├── db/\n│   │   ├── __init__.py\n│   │   ├── mongodb.py\n│   │   ├── models/\n│   │   │   ├── __init__.py\n│   │   │   ├── user.py\n│   │   │   ├── food.py\n│   ├── models/\n│   │   ├── __init__.py\n│   │   ├── recommendation_model.py\n│   ├── schemas/\n│   │   ├── __init__.py\n│   │   ├── user.py\n│   │   ├── food.py\n│   │   ├── recommendation.py\n│   ├── services/\n│   │   ├── __init__.py\n│   │   ├── recommendation_service.py\n│   │   ├── user_service.py\n│   ├── utils/\n│   │   ├── __init__.py\n│   │   ├── common.py\n│   └── tests/\n│       ├── __init__.py\n│       ├── test_recommendations.py\n│       ├── test_users.py\n│       ├── test_foods.py\n├── data/\n│   ├── raw/\n│   ├── processed/\n│   ├── trained_model/\n│   │   ├── model.joblib\n├── notebooks/\n│   ├── data_preprocessing.ipynb\n│   ├── model_training.ipynb\n├── requirements.txt\n├── .env\n└── README.md\n ```\n\n### Libs included\n\n- fastapi: The main framework for building your API.\n- uvicorn: ASGI server to run your FastAPI application.\n- pydantic: For data validation and settings management.\n- motor: Asynchronous MongoDB driver.\n- pandas: Data manipulation and analysis library.\n- scikit-learn: For machine learning algorithms and model handling.\n- joblib: For model serialization and deserialization.\n- python-dotenv: To load environment variables from a .env file.\n- pytest: Framework for writing and running tests.\n- httpx: For making HTTP requests in your tests.\n- flake8: For checking the style and quality of your code.\n- black: Code formatter.\n\n### Project Structure Breakdown\n\n\u003e your_app/:\n\nThe root directory of your FastAPI project.\n\n\u003e venv/:\n\nVirtual environment directory containing all the dependencies and packages installed for this project.\n\n\u003e app/:\n\nMain application directory containing the core components of your FastAPI project.\n\n\u003e __init__.py:\n\nMarks the app directory as a Python package.\nmain.py:\n\nThe entry point of the FastAPI application where the app is initialized and routes are included.\n\n\u003e api/:\n\nContains the API-related modules and routing.\n\n\u003e __init__.py:\n\nMarks the api directory as a Python package.\n\n\u003e endpoints/:\n\nContains individual API endpoints or routes for different functionalities.\n\n\u003e __init__.py:\n\nMarks the endpoints directory as a Python package.\nrecommendations.py:\n\nAPI endpoints related to generating and managing food recommendations.\nusers.py:\n\nAPI endpoints related to user management, such as registration, login, and profile updates.\nfoods.py:\n\nAPI endpoints related to managing food items in the database.\n\n\u003e core/:\n\nCore functionalities and configurations of the application.\n\n\u003e __init__.py:\n\nMarks the core directory as a Python package.\nconfig.py:\n\nApplication configuration settings, including environment variables and database connections.\nsecurity.py:\n\nSecurity-related functions, such as password hashing, JWT token creation, and authentication.\n\n\u003e db/:\n\nDatabase-related modules and models.\n\n\u003e __init__.py:\n\nMarks the db directory as a Python package.\nmongodb.py:\n\nMongoDB connection and database handling logic.\n\n\u003e models/:\n\nContains database models that define the structure of data in MongoDB.\n\n\u003e __init__.py:\n\nMarks the models directory as a Python package.\nuser.py:\n\nDatabase model representing a user in the system.\nfood.py:\n\nDatabase model representing a food item in the system.\n\n\u003e models/:\n\nContains machine learning models or any other business-related models.\n\n\u003e __init__.py:\n\nMarks the models directory as a Python package.\nrecommendation_model.py:\n\nHandles loading and using the machine learning model for food recommendations.\n\n\u003e schemas/:\n\nPydantic models (schemas) used for data validation and serialization.\n\n\u003e __init__.py:\n\nMarks the schemas directory as a Python package.\nuser.py:\n\nSchemas for user-related data validation (e.g., registration, login).\nfood.py:\n\nSchemas for food-related data validation.\nrecommendation.py:\n\nSchemas for recommendation-related data validation.\n\n\u003e services/:\n\nBusiness logic and services that interact with the database and models.\n\n\u003e __init__.py:\n\nMarks the services directory as a Python package.\nrecommendation_service.py:\n\nBusiness logic for generating and managing food recommendations.\nuser_service.py:\n\nBusiness logic for managing users.\n\n\u003e utils/:\n\nUtility functions and common helpers used across the application.\n\n\u003e __init__.py:\n\nMarks the utils directory as a Python package.\ncommon.py:\n\nCommon utility functions used throughout the application.\n\n\u003e tests/:\n\nTest cases for the application, ensuring all features work as expected.\n\n\u003e __init__.py:\n\nMarks the tests directory as a Python package.\ntest_recommendations.py:\n\nTest cases for the recommendation functionality.\ntest_users.py:\n\nTest cases for user-related functionality.\ntest_foods.py:\n\nTest cases for food-related functionality.\n\n\u003e data/:\n\nDirectory for storing datasets and trained models.\n\n\u003e raw/:\n\nRaw, unprocessed data files.\n\n\u003e processed/:\n\nProcessed data files ready for use in model training.\n\n\u003e trained_model/:\n\nContains trained machine learning models, like model.joblib.\n\n\u003e notebooks/:\n\nJupyter notebooks for data analysis, preprocessing, and model training.\n\ndata_preprocessing.ipynb:\n\nNotebook for data preprocessing.\nmodel_training.ipynb:\n\nNotebook for training the machine learning model.\n\n\u003e requirements.txt:\n\nLists all the Python packages required for the project.\n\n\u003e .env:\n\nEnvironment variables, such as database connection strings and secret keys.\n\n\u003e README.md:\n\nProject documentation providing an overview of the application, how to set it up, and how to use it.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-bit-myanmar%2Fapi-for-sarrmal-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fone-bit-myanmar%2Fapi-for-sarrmal-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-bit-myanmar%2Fapi-for-sarrmal-app/lists"}