{"id":51075362,"url":"https://github.com/codestorm-official/flask-postgres-starter","last_synced_at":"2026-06-23T13:41:18.207Z","repository":{"id":340162662,"uuid":"1018367932","full_name":"codestorm-official/flask-postgres-starter","owner":"codestorm-official","description":"Flask Starter Project with PostgreSQL","archived":false,"fork":false,"pushed_at":"2026-02-20T22:17:50.000Z","size":10,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-23T22:49:19.146Z","etag":null,"topics":["flask","flask-api","flask-starter"],"latest_commit_sha":null,"homepage":"","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/codestorm-official.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":"2025-07-12T05:41:42.000Z","updated_at":"2025-07-12T05:42:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/codestorm-official/flask-postgres-starter","commit_stats":null,"previous_names":["codestorm-official/flask-postgres-starter"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/codestorm-official/flask-postgres-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fflask-postgres-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fflask-postgres-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fflask-postgres-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fflask-postgres-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codestorm-official","download_url":"https://codeload.github.com/codestorm-official/flask-postgres-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fflask-postgres-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34692769,"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-23T02:00:07.161Z","response_time":65,"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":["flask","flask-api","flask-starter"],"created_at":"2026-06-23T13:41:17.343Z","updated_at":"2026-06-23T13:41:18.199Z","avatar_url":"https://github.com/codestorm-official.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask Starter Pack (w/ Postgres) 🚀\n\n![Python](https://img.shields.io/badge/python-3.9+-blue.svg)\n![License](https://img.shields.io/badge/license-MIT-green.svg)\n\nA robust starter pack or boilerplate for building production-ready APIs using Flask and PostgreSQL. This project is designed with **Clean Architecture** and **SOLID** principles in mind to ensure scalability and maintainability.\n\nThe main goal of this starter pack is to accelerate the development process by providing a well-structured foundation, allowing you to focus directly on business logic.\n\n## ✨ Core Features \u0026 Tech Stack\n\n* **Framework**: [Flask](https://flask.palletsprojects.com/)\n* **Database**: [PostgreSQL](https://www.postgresql.org/)\n* **Production Server**: [Gunicorn](https://gunicorn.org/)\n* **Architecture**: **Layered Architecture** (API, Services, Models) that separates concerns.\n* **ORM**: [Flask-SQLAlchemy](https://flask-sqlalchemy.palletsprojects.com/) for elegant database interaction.\n* **Database Migrations**: [Flask-Migrate](https://flask-migrate.readthedocs.io/) (using Alembic) to safely manage schema changes.\n* **Validation \u0026 Serialization**: [Flask-Marshmallow](https://flask-marshmallow.readthedocs.io/) for clean request validation and response serialization.\n* **API Documentation**: [Flasgger](https://github.com/flasgger/flasgger) automatically generates **OpenAPI 3.0 (Swagger UI)** documentation.\n* **Configuration**: Uses a `.env` file for secure management of environment variables.\n\n---\n\n## 🏛️ Project Structure\n\nThe directory structure is designed for scalability and code readability.\n\n```sh\nflask-postgres-starter/\n├── app/\n│   ├── __init__.py\n│   ├── api/\n│   ├── core/\n│   ├── models/\n│   ├── schemas/\n│   ├── services/\n│   └── utils/\n├── migrations/\n├── .env.example \n├── .gitignore\n├── .railway.json\n├── run.py\n└── requirements.txt\n```\n\n---\n\n## ⚙️ Getting Started\n\nFollow these steps to get the project running in your local environment.\n\n### 1. Prerequisites\n* Python 3.9+\n* PostgreSQL installed and running.\n* Create a new database in PostgreSQL for this project (e.g., `starter_db`).\n\n### 2. Installation\n1.  **Clone this repository:**\n    ```bash\n    git clone https://github.com/asepscareer/flask-postgres-starter.git\n    cd flask-postgres-starter\n    ```\n\n2.  **Create and activate a virtual environment:**\n    ```bash\n    python -m venv venv\n    source venv/bin/activate  # or `venv\\Scripts\\activate` on Windows\n    ```\n\n3.  **Install all dependencies:**\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n4.  **Configure Environment Variables:**\n    * Copy the `.env.example` file to `.env`.\n        ```bash\n        cp .env.example .env\n        ```\n    * Open the `.env` file and adjust the values, especially `DATABASE_URL` and `SECRET_KEY`.\n        ```env\n        # Format: postgresql://\u003cuser\u003e:\u003cpassword\u003e@\u003chost\u003e:\u003cport\u003e/\u003cdbname\u003e\n        DATABASE_URL=\"postgresql://postgres:password@localhost:5432/starter_db\"\n        SECRET_KEY=\"change-me-to-a-very-secret-key\"\n        ```\n\n5.  **Run Database Migrations:**\n    This command will create all the necessary tables in your database.\n    ```bash\n    # Set FLASK_APP environment variable\n    export FLASK_APP=run.py # (use 'set' on Windows CMD)\n\n    # Initialize migrations (only once at the start of the project)\n    flask db init\n\n    # Create a migration file\n    flask db migrate -m \"Initial migration.\"\n\n    # Apply the migration to the database\n    flask db upgrade\n    ```\n\n6.  **Run the Development Server:**\n    ```bash\n    flask run\n    ```\n    The application is now running at `http://127.0.0.1:5000`.\n\n---\n\n## 📚 API Usage\n\nThe primary guide for using the API is the interactive Swagger UI documentation.\n\n* **API Documentation (Swagger)**: Open your browser and navigate to `http://127.0.0.1:5000/apidocs`\n\nYou can see all available endpoints, data models, and even try the API directly from your browser.\n\n### cURL Example: Creating a New User\n\n```bash\ncurl -X POST [http://127.0.0.1:5000/api/v1/users/](http://127.0.0.1:5000/api/v1/users/) \\\n-H \"Content-Type: application/json\" \\\n-H \"X-Request-ID: 12345\" \\\n-d '{\n    \"username\": \"cool_boss\",\n    \"email\": \"boss@cool.com\"\n}'\n```\n\n---\n\n## 🚀 Running in Production\n\nFor a production environment, use Gunicorn as the WSGI server.\n\n```bash\ngunicorn --bind 0.0.0.0:8000 run:app\n```\n\n---\n\n## 📄 License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodestorm-official%2Fflask-postgres-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodestorm-official%2Fflask-postgres-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodestorm-official%2Fflask-postgres-starter/lists"}