A modern web application built with Flask, Webpack, and TailwindCSS. This setup provides a complete development environment with hot reloading, asset bundling, and utility-first CSS.
- Flask: Python web framework for backend
- Webpack: JavaScript bundler with CSS processing
- TailwindCSS: Utility-first CSS framework
- Hot Reloading: Automatic browser refresh during development
- Modern Build Process: Optimized production builds
├── app.py # Flask application
├── requirements.txt # Python dependencies
├── package.json # Node.js dependencies
├── webpack.config.js # Webpack configuration
├── tailwind.config.js # TailwindCSS configuration
├── postcss.config.js # PostCSS configuration
├── templates/ # Flask HTML templates
│ ├── base.html
│ ├── index.html
│ └── about.html
└── static/ # Static assets
├── src/ # Source files
│ ├── js/
│ │ └── main.js
│ └── css/
│ ├── main.css
│ └── input.css
├── js/ # Compiled JavaScript
├── css/ # Compiled CSS
└── images/ # Images
pip install -r requirements.txtnpm installFor development (with watch mode):
# Terminal 1: Build CSS
npm run build:css
# Terminal 2: Build JavaScript
npm run devFor production:
npm run buildpython app.pyThe application will be available at http://localhost:5000
- Start CSS watcher:
npm run build:css(watches for TailwindCSS changes) - Start Webpack watcher:
npm run dev(watches for JavaScript changes) - Start Flask server:
python app.py(runs the web server) - Edit files: Make changes to templates, JavaScript, or CSS
- See changes: Browser will automatically refresh
npm run build- Build production assetsnpm run dev- Build development assets with watch modenpm run build:css- Build TailwindCSS with watch mode
- Create new files in
static/src/js/ - Import them in
main.js - Webpack will automatically bundle them
- Create new files in
static/src/css/ - Import them in
main.css - TailwindCSS will process them
- Add routes in
app.py - Create corresponding templates in
templates/ - Update navigation in
base.html
- Build production assets:
npm run build - Set Flask environment:
export FLASK_ENV=production - Run with a production WSGI server like Gunicorn
- Assets not loading: Make sure to run both CSS and JS build processes
- TailwindCSS not working: Check that
tailwind.config.jscontent paths are correct - Webpack errors: Ensure all dependencies are installed with
npm install
If port 5000 is in use, modify app.py:
app.run(debug=True, port=5001)- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - feel free to use this project as a starting point for your own applications.