{"id":51075363,"url":"https://github.com/codestorm-official/flask-starter-pack","last_synced_at":"2026-06-23T13:41:18.457Z","repository":{"id":309842628,"uuid":"1037107558","full_name":"codestorm-official/flask-starter-pack","owner":"codestorm-official","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-20T23:06:38.000Z","size":37,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-23T22:49:19.191Z","etag":null,"topics":["flask","flask-application"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/codestorm-official.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-08-13T04:42:37.000Z","updated_at":"2025-08-19T06:18:20.000Z","dependencies_parsed_at":"2025-08-16T07:31:17.507Z","dependency_job_id":null,"html_url":"https://github.com/codestorm-official/flask-starter-pack","commit_stats":null,"previous_names":["asepscareer/flask-starter-pack","codestorm-official/flask-starter-pack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codestorm-official/flask-starter-pack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fflask-starter-pack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fflask-starter-pack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fflask-starter-pack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fflask-starter-pack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codestorm-official","download_url":"https://codeload.github.com/codestorm-official/flask-starter-pack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fflask-starter-pack/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-application"],"created_at":"2026-06-23T13:41:17.625Z","updated_at":"2026-06-23T13:41:18.449Z","avatar_url":"https://github.com/codestorm-official.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask Starter Pack\n\nA clean and organized Flask application starter template with authentication, blueprints, and modern UI components.\n\n## 🚀 Features\n\n- **✅ Blueprint Organization**: Separate modules for main, auth, and API functionality\n- **✅ Authentication System**: Complete login/registration with Flask-Login and User model\n- **✅ Database Integration**: SQLAlchemy ORM with migrations and User model implemented\n- **✅ Modern UI**: Bootstrap 5 with responsive design and custom components\n- **✅ API Ready**: RESTful endpoints with JSON responses and health checks\n- **✅ Form Handling**: Working registration and login forms with validation\n- **✅ Error Handling**: Custom 404 and 500 error pages\n- **✅ Configuration Management**: Environment-based configuration with .env support\n- **✅ Production Ready**: Gunicorn WSGI server configuration\n- **✅ Railway Deployment**: Ready for Railway.app deployment\n\n## 📁 Project Structure\n\n```\nflask-starter-pack/\n├─ app/\n│  ├─ __init__.py           # Flask app factory with user_loader\n│  ├─ config.py            # Configuration classes\n│  ├─ extensions.py        # Flask extensions (db, migrate, login_manager)\n│  ├─ models.py            # User model with authentication\n│  ├─ main/                # Main blueprint\n│  │  ├─ __init__.py\n│  │  └─ routes.py         # Home, about routes\n│  ├─ auth/                # Authentication blueprint  \n│  │  ├─ __init__.py\n│  │  └─ routes.py         # Login, register, logout routes\n│  ├─ api/                 # API blueprint\n│  │  ├─ __init__.py\n│  │  └─ routes.py         # Health, version, users API\n│  ├─ templates/           # Jinja2 templates\n│  │  ├─ base.html         # Base template with Bootstrap\n│  │  ├─ main/             # Main page templates\n│  │  │  ├─ index.html\n│  │  │  └─ about.html\n│  │  ├─ auth/             # Auth page templates\n│  │  │  ├─ login.html\n│  │  │  └─ register.html\n│  │  ├─ errors/           # Error page templates\n│  │  │  ├─ 404.html\n│  │  │  └─ 500.html\n│  │  ├─ partials/         # Reusable components\n│  │  │  ├─ _navbar.html\n│  │  │  ├─ _footer.html\n│  │  │  └─ _flash.html\n│  │  └─ macros/           # Jinja2 macros\n│  │     ├─ forms.html\n│  │     └─ components.html\n│  └─ static/              # Static assets\n│     ├─ css/app.css       # Custom CSS\n│     ├─ js/app.js         # Custom JavaScript\n│     └─ img/              # Images\n├─ migrations/             # Database migrations\n├─ instance/               # Instance folder (gitignored)\n├─ .env                    # Environment variables (gitignored)\n├─ .gitignore             # Git ignore rules\n├─ wsgi.py                 # WSGI entry point\n├─ run.py                  # Development server runner\n├─ requirements.txt        # Python dependencies\n├─ railway.json           # Railway deployment config\n├─ LICENSE                # MIT License\n└─ README.md\n```\n\n## 🛠️ Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd flask-starter-pack\n   ```\n\n2. **Create virtual environment**\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. **Install dependencies**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Set environment variables**\n   Create a `.env` file in the root directory:\n   ```env\n   SECRET_KEY=your-secret-key-here\n   FLASK_APP=wsgi.py\n   FLASK_ENV=development\n   DATABASE_URL=sqlite:///app.db\n   ```\n\n5. **Initialize database**\n   ```bash\n   flask db init        # Already done - creates migrations folder\n   flask db migrate -m \"Initial migration with User model\"  # Already done\n   flask db upgrade     # Already done - creates tables\n   ```\n\n6. **Run the application**\n   ```bash\n   flask run\n   # Or for development with auto-reload:\n   python run.py\n   ```\n\n7. **Test the application**\n   - Homepage: http://127.0.0.1:5000\n   - Register: http://127.0.0.1:5000/auth/register  \n   - Login: http://127.0.0.1:5000/auth/login\n   - API Health: http://127.0.0.1:5000/api/health\n\n## 🔧 Configuration\n\nThe application supports multiple configuration environments:\n\n- **Development**: Debug mode enabled, SQLite database, detailed error messages\n- **Production**: Debug disabled, secure cookies, production database  \n- **Testing**: In-memory database, CSRF disabled, fast testing\n\n**Environment Variables (.env file):**\n```env\nSECRET_KEY=your-secret-key-here\nFLASK_APP=wsgi.py  \nFLASK_ENV=development\nDATABASE_URL=sqlite:///app.db\n```\n\n**Set Configuration Environment:**\n```bash\nexport FLASK_CONFIG=development  # or production, testing\nflask run\n```\n\n## 📝 Usage\n\n### 🔐 Authentication System\n\nThe application includes a complete authentication system:\n\n**User Registration:**\n```bash\n# Visit: http://127.0.0.1:5000/auth/register\n# Required fields: username, email, password, confirm password\n```\n\n**User Login:**\n```bash\n# Visit: http://127.0.0.1:5000/auth/login  \n# Required fields: username, password\n# Optional: remember me checkbox\n```\n\n**User Model Features:**\n- Password hashing with Werkzeug\n- Flask-Login integration\n- Unique username and email validation\n- Active user status tracking\n\n### 🗄️ Database Operations\n\n**Access Flask Shell:**\n```bash\nflask shell\n\u003e\u003e\u003e from app.models import User\n\u003e\u003e\u003e from app.extensions import db\n\n# Create a user programmatically\n\u003e\u003e\u003e user = User(username='admin', email='admin@example.com')\n\u003e\u003e\u003e user.set_password('admin123')\n\u003e\u003e\u003e db.session.add(user)\n\u003e\u003e\u003e db.session.commit()\n\n# Query users\n\u003e\u003e\u003e users = User.query.all()\n\u003e\u003e\u003e user = User.query.filter_by(username='admin').first()\n\u003e\u003e\u003e print(user.email)\n```\n\n### 🔌 API Endpoints\n\nThe application provides several API endpoints:\n\n**Health Check:**\n```bash\nGET /api/health\n# Response: {\"status\": \"healthy\", \"message\": \"Flask Starter Pack API is running\"}\n```\n\n**Version Info:**\n```bash\nGET /api/version  \n# Response: {\"version\": \"1.0.0\", \"name\": \"Flask Starter Pack API\"}\n```\n\n**User Management:**\n```bash\nGET /api/users\n# Response: {\"users\": [{\"id\": 1, \"username\": \"testuser\", \"email\": \"test@example.com\", \"is_active\": true}]}\n\nPOST /api/test-user\n# Creates a test user for development\n```\n\n### 📄 Adding New Blueprints\n\n1. Create a new directory in `app/`\n2. Add `__init__.py` with blueprint definition:\n```python\nfrom flask import Blueprint\nbp = Blueprint('new_module', __name__)\nfrom app.new_module import routes\n```\n3. Create `routes.py` with route handlers\n4. Register the blueprint in `app/__init__.py`:\n```python\nfrom app.new_module import bp as new_module_bp\napp.register_blueprint(new_module_bp, url_prefix='/new_module')\n```\n\n### 🎨 Template Structure\n\nTemplates are organized hierarchically:\n- `base.html` - Main layout with Bootstrap\n- `partials/` - Reusable components (navbar, footer, flash messages)\n- `main/` - Homepage and about page templates  \n- `auth/` - Login and registration templates\n- `errors/` - Custom error page templates\n\n### Using Macros\n\nThe starter pack includes useful Jinja2 macros in `templates/macros/`:\n```html\n{% from 'macros/forms.html' import render_field %}\n{% from 'macros/components.html' import alert, card %}\n\n{{ render_field(form.email) }}\n{{ alert('Success message', 'success') }}\n```\n\n## 🚀 Deployment\n\n### Railway.app\n\nThis starter pack is ready for deployment on Railway:\n\n1. Connect your GitHub repository to Railway\n2. Set environment variables in Railway dashboard\n3. Deploy automatically on push to main branch\n\n### Manual Deployment\n\n1. **Set production environment variables**\n2. **Install dependencies**: `pip install -r requirements.txt`\n3. **Run with Gunicorn**: `gunicorn wsgi:app`\n\n## 🔒 Security Features\n\n- CSRF protection on all forms\n- Secure session cookies\n- SQL injection prevention with SQLAlchemy\n- XSS protection with Jinja2 auto-escaping\n- Security headers with Flask-Talisman (optional)\n\n## 🎨 Customization\n\n### Styling\n\n- Modify `app/static/css/app.css` for custom styles\n- Bootstrap 5 classes available throughout templates\n- CSS custom properties defined for consistent theming\n\n### JavaScript\n\n- Custom utilities available in `window.FlaskApp`\n- Bootstrap components initialized automatically\n- AJAX helper functions included\n\n## 📚 API Endpoints\n\nThe starter pack includes these working API endpoints:\n\n**Core Endpoints:**\n- `GET /api/health` - Application health check\n- `GET /api/version` - API version information  \n- `GET /api/users` - List all registered users (development)\n- `POST /api/test-user` - Create test user (development)\n\n**Example API Usage:**\n```bash\n# Test health endpoint\ncurl http://127.0.0.1:5000/api/health\n\n# Create test user\ncurl -X POST http://127.0.0.1:5000/api/test-user\n\n# List users  \ncurl http://127.0.0.1:5000/api/users\n```\n\n## � Testing\n\n### Quick Test Checklist\n\n**✅ Application Startup:**\n```bash\nflask run\n# Should start without errors on http://127.0.0.1:5000\n```\n\n**✅ Core Pages:**\n- Homepage: http://127.0.0.1:5000 ✅\n- About: http://127.0.0.1:5000/about ✅  \n- Login: http://127.0.0.1:5000/auth/login ✅\n- Register: http://127.0.0.1:5000/auth/register ✅\n\n**✅ API Endpoints:**\n- Health: http://127.0.0.1:5000/api/health ✅\n- Version: http://127.0.0.1:5000/api/version ✅\n- Users: http://127.0.0.1:5000/api/users ✅\n\n**✅ Authentication Flow:**\n1. Register new user via form\n2. Login with registered credentials  \n3. Verify navbar shows logout option\n4. Test logout functionality\n\n**✅ Database:**\n```bash\nflask shell\n\u003e\u003e\u003e from app.models import User\n\u003e\u003e\u003e User.query.count()  # Should show registered users\n```\n\n## �🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n**Copyright (c) 2025 Asep Saputra**\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n## 🆘 Support\n\nIf you encounter any issues or have questions:\n\n1. Check the documentation\n2. Search existing issues\n3. Create a new issue with detailed information\n\n## 🙏 Acknowledgments\n\n**Author:** Asep Saputra  \n**Created:** August 2025  \n**Flask Starter Pack** - A comprehensive template for modern Flask applications\n\n**Special Thanks:**\n- Flask and its ecosystem for the amazing framework\n- Bootstrap team for the beautiful UI components  \n- Railway.app for the excellent hosting platform\n- Python community for continuous innovation\n\n**Technology Stack:**\n- Python 3.8+\n- Flask 2.3+\n- SQLAlchemy \u0026 Flask-Migrate\n- Flask-Login for authentication\n- Bootstrap 5 for responsive UI\n- Jinja2 templating engine\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodestorm-official%2Fflask-starter-pack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodestorm-official%2Fflask-starter-pack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodestorm-official%2Fflask-starter-pack/lists"}