Skip to content

Repository files navigation

WTForms Survey

A Flask-based web survey application for collecting data on healthy lifestyle perceptions and habits.

Features

  • 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

Tech Stack

  • Backend: Flask, Flask-WTF, WTForms
  • Frontend: HTML, CSS, JavaScript
  • Database: SQLite
  • Deployment: Docker, docker-compose, Gunicorn
  • CI/CD: GitHub Actions

Quick Start

Prerequisites

  • Python 3.12+
  • uv (recommended) or pip

Local Development

  1. Clone the repository:

    git clone <repository-url>
    cd WTFormsSurvey
  2. Set up environment:

    cp .example_env .env
    # Edit .env with your values
  3. Install dependencies:

    uv sync
  4. Run the app:

    uv run python run.py

    The app will be available at http://localhost:43890.

Docker

docker build -t wtforms-survey .
docker run -p 43890:43890 --env-file .env wtforms-survey

Or using docker-compose:

docker-compose up -d

Project Structure

app/
├── 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

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages