A Flask-based web survey application for collecting data on healthy lifestyle perceptions and habits.
- Multi-page survey form with text, radio, and checkbox inputs
- Server-side form validation with WTForms
- CSRF protection
- SQLite response storage
- Dockerized deployment
- GitHub Actions CI/CD pipeline for GHCR publish and remote host deployment
- Backend: Flask, Flask-WTF, WTForms
- Frontend: HTML, CSS, JavaScript
- Database: SQLite
- Deployment: Docker, docker-compose, Gunicorn
- CI/CD: GitHub Actions
- Python 3.12+
- uv (recommended) or pip
-
Clone the repository:
git clone <repository-url> cd WTFormsSurvey
-
Set up environment:
cp .example_env .env # Edit .env with your values -
Install dependencies:
uv sync
-
Run the app:
uv run python run.py
The app will be available at
http://localhost:43890.
docker build -t wtforms-survey .
docker run -p 43890:43890 --env-file .env wtforms-surveyOr using docker-compose:
docker-compose up -dapp/
├── factory.py # Flask application factory
├── forms/
│ └── survey_form.py # WTForms form definitions
├── lexicon_ru.py # Russian survey text content
├── models/
│ └── data_processor.py # Form data processing
├── routes/
│ └── main.py # Route handlers (Blueprint)
├── services/
│ ├── __init__.py
│ └── save_response.py # SQLite persistence
├── static/
│ ├── images/ # Static images
│ ├── script.js # Frontend logic
│ └── style.css # Styles
├── templates/
│ ├── success.html # Success page
│ └── survey.html # Survey form page
└── utils.py # Logging and env helpers
MIT