{"id":50928369,"url":"https://github.com/persteenolsen/fastapi-jwt-auth-ml-three","last_synced_at":"2026-06-17T01:31:11.737Z","repository":{"id":352473285,"uuid":"1215228109","full_name":"persteenolsen/fastapi-jwt-auth-ml-three","owner":"persteenolsen","description":"Python FastAPI with JWT Auth using PostgreSQL serving ML for House Price Prediction (v3)","archived":false,"fork":false,"pushed_at":"2026-04-19T18:09:59.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-19T20:11:17.191Z","etag":null,"topics":["fastapi","machine-learning","postgresql","python"],"latest_commit_sha":null,"homepage":"https://fastapi-jwt-auth-ml-three.vercel.app/docs","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/persteenolsen.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-19T16:42:43.000Z","updated_at":"2026-04-19T18:10:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/persteenolsen/fastapi-jwt-auth-ml-three","commit_stats":null,"previous_names":["persteenolsen/fastapi-jwt-auth-ml-three"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/persteenolsen/fastapi-jwt-auth-ml-three","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persteenolsen%2Ffastapi-jwt-auth-ml-three","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persteenolsen%2Ffastapi-jwt-auth-ml-three/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persteenolsen%2Ffastapi-jwt-auth-ml-three/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persteenolsen%2Ffastapi-jwt-auth-ml-three/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/persteenolsen","download_url":"https://codeload.github.com/persteenolsen/fastapi-jwt-auth-ml-three/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persteenolsen%2Ffastapi-jwt-auth-ml-three/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34430688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fastapi","machine-learning","postgresql","python"],"created_at":"2026-06-17T01:31:10.668Z","updated_at":"2026-06-17T01:31:11.639Z","avatar_url":"https://github.com/persteenolsen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏠 v3 - House Price Prediction API (FastAPI + JWT + ML)\n\nLast updated:\n\n- 20-04-2026\n\nA production-style Machine Learning API built with FastAPI, JWT authentication, PostgreSQL (Neon), SQLAlchemy, and Alembic migrations.\n\n---\n\n# 🚀 Features\n\n- JWT authentication\n- FastAPI REST API\n- ML model (scikit-learn pipeline)\n- PostgreSQL (Neon)\n- SQLAlchemy ORM\n- Alembic migrations\n- User prediction history\n- Clean modular architecture\n\n---\n\n# 🧱 Project Structure\n\n```\nfastapi-jwt-auth-ml-three/\n│\n├── app/\n│   ├── main.py\n│   ├── database.py\n│   ├── models.py\n│   ├── schemas.py\n│   ├── crud.py\n│   ├── auth.py\n│   ├── dependencies.py\n│   │\n│   ├── routers/\n│   │   ├── auth.py\n│   │   ├── predict.py\n│   │   └── history.py\n│   │\n│   └── ml/\n│       ├── predictor.py\n│       └── model.pkl\n│\n├── ml/\n│   ├── train.py\n│   └── housing_v2.csv\n│\n├── alembic/\n├── alembic.ini\n├── requirements.txt\n├── .env\n└── README.md\n```\n---\n\n# ⚙️ Installation\n\n## 1. Clone repository\n\ngit clone \u003cyour-repo-url\u003e\ncd fastapi-jwt-auth-ml-three\n\n---\n\n## 2. Create virtual environment\n\nCreate the virtual environment:\npython -m venv venv\n\nActivate it:\n\nWindows:\nvenv\\Scripts\\activate\n\nMac/Linux:\nsource venv/bin/activate\n\n---\n\n## 3. Install dependencies\n\npip install -r requirements.txt\n\n---\n\n# 🔐 Environment variables (.env)\n\nDATABASE_URL=postgresql://user:password@your-neon-host.neon.tech/dbname?sslmode=require\nSECRET_KEY=your_secret_key\n\n---\n\n# 🧠 Train ML model\n\npython ml/train.py\n\nThis generates:\nml/model.pkl\n\n---\n\n# 🚀 Run database migrations (Alembic)\n\nalembic revision --autogenerate -m \"init\"\nalembic upgrade head\n\n---\n\n# ▶️ Run API\n\nuvicorn app.main:app --reload\n\nAPI runs at:\nhttp://127.0.0.1:8000\n\n---\n\n# 📡 API Endpoints\n\n## Login\nPOST /login\n\n{\n  \"username\": \"admin\",\n  \"password\": \"1234\"\n}\n\n---\n\n## Predict\nPOST /predict\nAuthorization: Bearer \u003ctoken\u003e\n\n{\n  \"size\": 140,\n  \"rooms\": 4,\n  \"year_built\": 2005,\n  \"location\": \"suburb\",\n  \"condition\": \"good\"\n}\n\n---\n\n## History\nGET /history\nAuthorization: Bearer \u003ctoken\u003e\n\n---\n\n# 🧠 Tech Stack\n\nFastAPI  \nPostgreSQL (Neon)  \nSQLAlchemy  \nAlembic  \nscikit-learn  \npandas  \nPyJWT  \nUvicorn  \n\n---\n\n# 📈 What this project demonstrates\n\n- ML deployment architecture\n- JWT authentication\n- PostgreSQL persistence\n- Database migrations\n- Modular backend design\n\n---\n\n# 🚀 Future improvements\n\n- timestamps\n- pagination\n- user registration (disabled for Vercel)\n- Docker deployment\n- frontend dashboard\n\n---\n\n# 👨‍💻 Author\n\nLearning project for combining ML + backend engineering with FastAPI","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpersteenolsen%2Ffastapi-jwt-auth-ml-three","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpersteenolsen%2Ffastapi-jwt-auth-ml-three","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpersteenolsen%2Ffastapi-jwt-auth-ml-three/lists"}