{"id":16174932,"url":"https://github.com/app-generator/sample-flask-api-restx","last_synced_at":"2025-03-19T00:31:02.157Z","repository":{"id":45729166,"uuid":"454068054","full_name":"app-generator/sample-flask-api-restx","owner":"app-generator","description":"Flask API Sample - Open-Source API Server | AppSeed","archived":false,"fork":false,"pushed_at":"2022-04-01T04:47:11.000Z","size":22,"stargazers_count":8,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-11T05:55:55.046Z","etag":null,"topics":["appseed-sample","flask-restx","flask-sample"],"latest_commit_sha":null,"homepage":"https://blog.appseed.us/simple-flask-api-server/","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/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}},"created_at":"2022-01-31T15:49:05.000Z","updated_at":"2023-12-10T17:49:57.000Z","dependencies_parsed_at":"2022-09-08T10:11:06.282Z","dependency_job_id":null,"html_url":"https://github.com/app-generator/sample-flask-api-restx","commit_stats":null,"previous_names":[],"tags_count":2,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-api-restx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-api-restx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-api-restx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-api-restx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/app-generator","download_url":"https://codeload.github.com/app-generator/sample-flask-api-restx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955701,"owners_count":20374373,"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":["appseed-sample","flask-restx","flask-sample"],"created_at":"2024-10-10T04:43:47.858Z","updated_at":"2025-03-19T00:31:01.862Z","avatar_url":"https://github.com/app-generator.png","language":"Python","readme":"# Flask API Sample\n\nSimple [Flask API Server](https://blog.appseed.us/simple-flask-api-server/) powered by Flask-RestX, SqlAlchemy, **SQLite** persistence - Provided by **AppSeed**. \n\n\u003cbr /\u003e\n\n\u003e Features:\n\n- `Up-to-date dependencies` \n- Simple, intuitive codebase - can be extended with ease. \n- `Flask-restX`\n- `Docker` support \n- Free [support](https://appseed.us/support) via email and [Discord](https://discord.gg/fZC6hup) (1k+ community).\n\n\u003cbr /\u003e\n\n## ✨ API Definition\n\n| Route  | Verb | Info | Status | \n|    --- | ---  | --- | --- | \n| `/datas`    | **GET**    | return all items  | ✔️ | \n|             | **POST**   | create a new item | ✔️ |\n| `/datas:id` | **GET**    | return one item   | ✔️ | \n|             | **PUT**    | update item       | ✔️ |\n|             | **DELETE** | delete item       | ✔️ |\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/flask-api-sample.git\n$ cd flask-api-sample\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![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## ✨ How to use the code\n\n\u003e **Step #1** - Clone the project\n\n```bash\n$ git clone https://github.com/app-generator/flask-api-sample.git\n$ cd flask-api-sample\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\u003e Or 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** - 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 Sample - Swagger Dashboard.](https://user-images.githubusercontent.com/51070104/151857217-ec364df4-cc90-413f-8bbe-a65e45dc8c35.png)\n\n\u003cbr /\u003e\n\n## ✨ Project Structure\n\n```bash\napi-server-flask/\n├── api\n│   ├── __init__.py\n│   ├── config.py\n│   ├── models.py\n│   └── routes.py\n├── README.md\n├── requirements.txt\n└── run.py\n```\n\u003cbr /\u003e\n\n---\n**[Flask API Sample](https://appseed.us/boilerplate-code/flask-api-boilerplate)** - provided by AppSeed [App Generator](https://appseed.us)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapp-generator%2Fsample-flask-api-restx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapp-generator%2Fsample-flask-api-restx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapp-generator%2Fsample-flask-api-restx/lists"}