{"id":14065241,"url":"https://github.com/app-generator/api-server-flask","last_synced_at":"2025-04-11T04:42:50.934Z","repository":{"id":59856289,"uuid":"382551255","full_name":"app-generator/api-server-flask","owner":"app-generator","description":"Flask API Server - Open-Source API Server | AppSeed","archived":false,"fork":false,"pushed_at":"2024-07-22T08:41:17.000Z","size":64,"stargazers_count":106,"open_issues_count":0,"forks_count":35,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-11T04:42:45.835Z","etag":null,"topics":["api-server","appseed-sample","flask","flask-api","flask-api-sample","flask-restapi","flask-restx","flask-template","free-api","open-source-api"],"latest_commit_sha":null,"homepage":"https://appseed.us/boilerplate-code/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/app-generator.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-07-03T07:14:15.000Z","updated_at":"2025-04-06T02:16:28.000Z","dependencies_parsed_at":"2024-08-13T07:08:34.552Z","dependency_job_id":"6a6eb915-cd92-4107-9bfa-c16ff47b267a","html_url":"https://github.com/app-generator/api-server-flask","commit_stats":null,"previous_names":[],"tags_count":9,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fapi-server-flask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fapi-server-flask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fapi-server-flask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fapi-server-flask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/app-generator","download_url":"https://codeload.github.com/app-generator/api-server-flask/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345281,"owners_count":21088242,"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":["api-server","appseed-sample","flask","flask-api","flask-api-sample","flask-restapi","flask-restx","flask-template","free-api","open-source-api"],"created_at":"2024-08-13T07:04:23.109Z","updated_at":"2025-04-11T04:42:50.913Z","avatar_url":"https://github.com/app-generator.png","language":"Python","readme":"## [Flask API Server](https://github.com/app-generator/api-server-flask)\n\nSimple **Flask API Boilerplate** enhanced with `JWT` authentication, `OAuth` via **GitHub**, `SqlAlchemy`, **SQLite** persistence, and deployment scripts via Docker. It has all the `ready-to-use` bare minimum essentials.\n\n- 👉 [Support](https://appseed.us/support/) via **Discord \u0026 Email**\n- 🚀 [Custom Development Services](https://appseed.us/custom-development/) for `StartUPs`, `Small Businesses`, and `Solo-developers`\n\n\u003cbr /\u003e\n\n\u003e Features:\n\n- ✅ `Up-to-date dependencies` \n- ✅ [API Definition](https://docs.appseed.us/boilerplate-code/api-unified-definition) - the unified API structure implemented by this server\n- ✅ API powered by `Flask-restX` \n- ✅ `JWT Authentication` (login, logout, register) via `Flask-jwt_extended`\n- 🆕 `OAuth` for **Github**\n  - Full-stack ready with [React Soft Dashboard](https://github.com/app-generator/react-soft-ui-dashboard)\n- ✅ **Docker**, `Unitary tests`\n  \n\u003cbr /\u003e\n\n\u003e Can be used with other [React Starters](https://appseed.us/apps/react) for a complete **Full-Stack** experience:\n\n| [React Node JS Berry](https://appseed.us/product/berry-dashboard/api-server-nodejs/react/) | [React Node Soft Dashboard](https://appseed.us/product/soft-ui-dashboard/api-server-nodejs/react/) | [React Node Horizon](https://appseed.us/product/horizon-ui/api-server-nodejs/) |\n| --- | --- | --- |\n| [![React Node JS Berry](https://user-images.githubusercontent.com/51070104/176936514-f1bccb21-bafe-4b43-9e4c-b6fe0ec9511d.png)](https://appseed.us/product/berry-dashboard/api-server-nodejs/react/) | [![React Node Soft Dashboard](https://user-images.githubusercontent.com/51070104/176936814-74386559-4e05-43d5-b9a4-8f70ce96a610.png)](https://appseed.us/product/soft-ui-dashboard/api-server-nodejs/react/) | [![React Node Horizon](https://user-images.githubusercontent.com/51070104/174428337-181e6dea-0ad9-4fe1-a35f-25e5fa656a9d.png)](https://appseed.us/product/horizon-ui/api-server-nodejs/)\n\n\u003cbr /\u003e\n\n![Flask API Server - Open-source Flask Starter provided by AppSeed.](https://user-images.githubusercontent.com/51070104/126349643-264d4cf4-6d0b-4c24-8185-adf69409fa4e.png)\n\n\u003cbr /\u003e\n\n## ✨ Quick Start in `Docker`\n\n\u003e Get the code\n\n```bash\n$ git clone https://github.com/app-generator/api-server-flask.git\n$ cd api-server-flask\n```\n\n\u003e Start the app in Docker\n\n```bash\n$ docker-compose up --build  \n```\n\nThe API server will start using the PORT `5000`.\n\n\u003cbr /\u003e\n\n## ✨ Table of Contents\n\n1. [Getting Started](#getting-started)\n2. [Project Structure](#project-structure)\n3. [Modules](#modules)\n4. [Testing](#testing)\n\n\u003cbr /\u003e\n\n## ✨ How to use the code\n\n\u003e **Step #1** - Clone the project\n\n```bash\n$ git clone https://github.com/app-generator/api-server-flask.git\n$ cd api-server-flask\n```\n\n\u003cbr /\u003e\n\n\u003e **Step #2** - create virtual environment using python3 and activate it (keep it outside our project directory)\n\n```bash\n$ # Virtualenv modules installation (Unix based systems)\n$ virtualenv env\n$ source env/bin/activate\n$\n$ # Virtualenv modules installation (Windows based systems)\n$ # virtualenv env\n$ # .\\env\\Scripts\\activate\n```\n\n\u003cbr /\u003e\n\n\u003e **Step #3** - Install dependencies in virtualenv\n\n```bash\n$ pip install -r requirements.txt\n```\n\n\u003cbr /\u003e\n\n\u003e **Step #4** - setup `flask` command for our app\n\n```bash\n$ export FLASK_APP=run.py\n$ export FLASK_ENV=development\n```\n\n For **Windows-based** systems\n\n```powershell\n$ (Windows CMD) set FLASK_APP=run.py\n$ (Windows CMD) set FLASK_ENV=development\n$\n$ (Powershell) $env:FLASK_APP = \".\\run.py\"\n$ (Powershell) $env:FLASK_ENV = \"development\"\n```\n\n\u003cbr /\u003e\n\n\u003e **Step #5** - Create a new `.env` file using sample `env.sample`\n\nThe meaning of each variable can be found below: \n\n- `DEBUG`: if `True` the app runs in develoment mode\n  - For production value `False` should be used\n- `SECRET_KEY`: used in assets management\n- `GITHUB_CLIENT_ID`: For GitHub social login\n- `GITHUB_SECRET_KEY`: For GitHub social login\n\n\u003cbr /\u003e\n\n\u003e **Step #6** - start test APIs server at `localhost:5000`\n\n```bash\n$ flask run\n```\n\nUse the API via `POSTMAN` or Swagger Dashboard.\n\n![Flask API Server - Swagger Dashboard.](https://user-images.githubusercontent.com/51070104/141950891-ea315fca-24c2-4929-841c-38fb950a478d.png) \n\n\u003cbr /\u003e\n\n## ✨ Project Structure\n\n```bash\napi-server-flask/\n├── api\n│   ├── config.py\n│   ├── __init__.py\n│   ├── models.py\n│   └── routes.py\n├── Dockerfile\n├── README.md\n├── requirements.txt\n├── run.py\n└── tests.py\n```\n\n\u003cbr /\u003e\n\n## ✨ API\n\nFor a fast set up, use this `POSTMAN` file: [api_sample](https://github.com/app-generator/api-unified-definition/blob/main/api.postman_collection.json)\n\n\u003e **Register** - `api/users/register` (**POST** request)\n\n```\nPOST api/users/register\nContent-Type: application/json\n\n{\n    \"username\":\"test\",\n    \"password\":\"pass\", \n    \"email\":\"test@appseed.us\"\n}\n```\n\n\u003cbr /\u003e\n\n\u003e **Login** - `api/users/login` (**POST** request)\n\n```\nPOST /api/users/login\nContent-Type: application/json\n\n{\n    \"password\":\"pass\", \n    \"email\":\"test@appseed.us\"\n}\n```\n\n\u003cbr /\u003e\n\n\u003e **Logout** - `api/users/logout` (**POST** request)\n\n```\nPOST api/users/logout\nContent-Type: application/json\nauthorization: JWT_TOKEN (returned by Login request)\n\n{\n    \"token\":\"JWT_TOKEN\"\n}\n```\n\n\u003cbr /\u003e\n\n## ✨ Testing\n\nRun tests using `pytest tests.py`\n\n\u003cbr /\u003e\n\n---\n**[Flask API Server](https://github.com/app-generator/api-server-flask)** - provided by [AppSeed](https://appseed.us)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapp-generator%2Fapi-server-flask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapp-generator%2Fapi-server-flask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapp-generator%2Fapi-server-flask/lists"}