A modern web application template with a clean architecture, designed to accelerate development of future web projects.
- Modern Frontend: Clean, responsive HTML5/CSS3 design with vanilla JavaScript
- Python Backend: Flask-based backend with modular structure
- Template System: Jinja2 templating with base template and inheritance
- Responsive Design: Mobile-first approach that works on all devices
- API Ready: RESTful API structure with example endpoints
- Easy Configuration: Environment-based configuration system
srazy/
├── app/
│ ├── backend/
│ │ ├── __init__.py
│ │ ├── app.py # Main Flask application
│ │ └── config.py # Configuration settings
│ ├── static/
│ │ ├── css/
│ │ │ └── style.css # Main stylesheet
│ │ ├── js/
│ │ │ └── main.js # Main JavaScript file
│ │ └── images/ # Image assets
│ └── templates/
│ ├── base.html # Base template
│ ├── index.html # Home page
│ ├── about.html # About page
│ ├── contact.html # Contact page
│ ├── 404.html # 404 error page
│ └── 500.html # 500 error page
├── tests/ # Test directory
├── docs/ # Documentation
├── requirements.txt # Python dependencies
└── README.md # This file
- Python 3.8 or higher
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/borisim/srazy.git
cd srazy- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Run the application:
# Using the run script (recommended for development)
python run.py
# Or directly from the backend directory
cd app/backend
python app.pyNote: The development server runs in debug mode. For production deployment, use a production WSGI server (see Deployment section below).
- Open your browser and navigate to:
http://localhost:5000
The application uses environment-based configuration. You can set the following environment variables:
SECRET_KEY: Secret key for Flask sessions (change in production)FLASK_DEBUG: Set toFalsein productionDATABASE_URL: Database connection string (optional)
Create a .env file in the root directory for local development:
SECRET_KEY=your-secret-key-here
FLASK_DEBUG=Truecd app/backend
python app.pyThe application will run with debug mode enabled, providing detailed error messages and auto-reloading on code changes.
Tests can be added in the tests/ directory. Use pytest for running tests:
pip install pytest
pytestGET /- Home pageGET /about- About pageGET /contact- Contact pageGET /api/health- Health check endpoint
Edit /app/static/css/style.css to customize the appearance. The CSS uses CSS variables for easy theming:
:root {
--primary-color: #3498db;
--secondary-color: #2ecc71;
/* ... more variables */
}- Create a new template in
/app/templates/ - Add a route in
/app/backend/app.py - Update navigation in
/app/templates/base.htmlif needed
Add custom JavaScript in /app/static/js/main.js or create new JS modules as needed.
- Set
FLASK_DEBUG=False - Use a production WSGI server (gunicorn, uWSGI)
- Set a strong
SECRET_KEY - Use a production database (PostgreSQL, MySQL)
- Enable HTTPS
- Configure proper error logging
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:8000 app.backend.app:appContributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
For questions or issues, please open an issue on GitHub.