{"id":26166824,"url":"https://github.com/kejiahp/fastapi-ecom-recommendation-system","last_synced_at":"2026-04-07T22:31:03.091Z","repository":{"id":281690658,"uuid":"929125425","full_name":"kejiahp/fastapi-ecom-recommendation-system","owner":"kejiahp","description":"Advanced recommendation system for e-commerce applications.","archived":false,"fork":false,"pushed_at":"2025-06-30T11:41:09.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T10:40:36.737Z","etag":null,"topics":["docker","fastapi","jinja2","mongodb","motor","pydantic","python","scikit-learn","scikit-surprise"],"latest_commit_sha":null,"homepage":"https://fastapi-ecom-recommendation-syst-production.up.railway.app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kejiahp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-02-07T21:15:35.000Z","updated_at":"2025-06-30T12:27:08.000Z","dependencies_parsed_at":"2025-04-05T18:22:04.012Z","dependency_job_id":"0f8b861a-efb5-471e-8636-96663c504d45","html_url":"https://github.com/kejiahp/fastapi-ecom-recommendation-system","commit_stats":null,"previous_names":["kejiahp/fastapi-ecom-recommendation-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kejiahp/fastapi-ecom-recommendation-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kejiahp%2Ffastapi-ecom-recommendation-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kejiahp%2Ffastapi-ecom-recommendation-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kejiahp%2Ffastapi-ecom-recommendation-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kejiahp%2Ffastapi-ecom-recommendation-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kejiahp","download_url":"https://codeload.github.com/kejiahp/fastapi-ecom-recommendation-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kejiahp%2Ffastapi-ecom-recommendation-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31532139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["docker","fastapi","jinja2","mongodb","motor","pydantic","python","scikit-learn","scikit-surprise"],"created_at":"2025-03-11T16:59:43.597Z","updated_at":"2026-04-07T22:31:03.076Z","avatar_url":"https://github.com/kejiahp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ADVANCED RECOMMENDATION SYSTEM FOR E-COMMERCE APPS\n*This was a Bsc dissertation project.*\n\n#### Introduction\n\nThe backend is built using FastAPI, a high-performance web framework for Python. It is\nresponsible for handling all business logic, authentication, recommendation generation,\nand database interactions. The backend server is developed using a modular monolithic\narchitecture, where all core functionalities, including API routing, authentication,\nrecommendation logic, and database access, are contained within a single unified\ncodebase but loosely coupled. This approach simplifies development and deployment in\nthe early stages of the project, offering ease of integration and centralized control.\nAs the system grows, this monolithic structure provides a solid foundation that can later be\nmodularized or refactored into microservices if scalability and separation of concerns\nbecome priorities.\n- **API Layer**: Exposes endpoints for interacting with the system, including endpoints\nfor user authentication, recommendations, and data management.\n- **Business Logic Layer**: Contains the recommendation algorithms, including\ncollaborative filtering using scikit-surprise (KNN) and content-based filtering using\nscikit-learn (TF-IDF). Logic for interaction with products, cart manipulation, order\ncheckout and product rating are also included here.\n- **Data Layer**: MongoDB is used to store all persistent data, including user profiles,\nratings, product data, and recommendations. FastAPI interacts with the database\nusing Motor for asynchronous database queries.\n- **Authentication Layer**: Uses JWT (JSON Web Tokens) for secure user authentication.\nThe tokens are passed in API requests to authenticate and authorize user actions.\n\n#### Dependencies\n\n- Python Version: \u003e= `3.10` \u003c= `3.12` (`scikit-surprise` at the moment does not work well with Python version `3.13`)\n- fastapi==0.115.12\n- Jinja2==3.1.6\n- motor==3.7.0 and pymongo==4.11.3\n- pydantic==2.11.2\n- pydantic-settings==2.8.1\n- pydantic_core==2.33.1\n- PyJWT==2.10.1\n- bcrypt==4.3.0\n- emails==0.6\n- *And others listed in the `requirements.txt` file*\n\n#### Modular Monolith Architecture\n![system-architecture drawio](https://github.com/user-attachments/assets/f365b98f-0169-4044-9d41-50b0565a5c93)\n\n#### NoSQL Data Model Diagram\n![mongodb-erd drawio](https://github.com/user-attachments/assets/1ae98615-1c04-479b-8fe3-1159795dce4c)\n\n#### Running locally (macOS)?\n- `docker-compose up -d` to start docker services in the background detached from the terminal.\n- create a virtual environment: `python3 -m venv \u003cvirtual environment name\u003e`\n- enter your virtual environment: `source \u003cvirtual environment name\u003e/bin/activate`\n- install packages listed in the requirements.txt file: `pip install -r requirements.txt`\n- start server: `uvicorn app.main:application --host 0.0.0.0 --port 8000`, for reloads on code change the `--reload` flag can be added.\n\nThe server will now be running on port `8000`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkejiahp%2Ffastapi-ecom-recommendation-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkejiahp%2Ffastapi-ecom-recommendation-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkejiahp%2Ffastapi-ecom-recommendation-system/lists"}