A web application built using Python and Flask that allows users to register, log in, complete a questionnaire, and view their results. This application includes user authentication, data storage, and an admin panel for data export.
The "Flask Questionnaire" project is a web application designed to collect user responses to a series of questions. Users can register, log in, complete the questionnaire, and view their results. Admin users can export the collected data for further analysis.
-
Pull the Docker Image:
docker pull joeuzo/questionnaire:tagname
-
Prepare the
.env
File: Create a.env
file in your working directory with the following content:SECRET_KEY=your_secret_key DATABASE_URL=sqlite:///questionnaire.db # Or your preferred database URL EMAIL_KEY=your_email_app_key EMAIL_ADDRESS[email protected]
-
Run the Docker Container:
docker run --env-file .env -p 5000:5000 joeuzo/questionnaire:tagname
-
Clone the Repository:
git clone https://github.com/JoeUzo/Flask-User-Questionnaire.git cd Flask-User-Questionnaire
-
Create a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies:
pip install -r requirements.txt
-
Set up Environment Variables: Create a .env file in the root directory and add the following variables:
SECRET_KEY=your_secret_key DATABASE_URL=sqlite:///questionnaire.db # Or your preferred database URL EMAIL_KEY=your_email_app_key EMAIL_ADDRESS[email protected]
-
Initialize the Database:
flask db init flask db migrate -m "Initial migration." flask db upgrade
-
Run the Application:
flask run
Once the application is running, you can access it in your web browser at http://127.0.0.1:5000/. Users can register, log in, complete the questionnaire, and view their results. Admin users (with user ID 1) have additional privileges, such as exporting data and managing the questionnaire.
- User Authentication (Registration, Login, Logout)
- Questionnaire with dynamic questions and scoring
- Age group selection
- Data storage and export functionality
- Admin panel for managing the application
Contributions are welcome! If you would like to contribute, please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Make your changes and commit them (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature-branch
) - Create a new Pull Request
You can find the Docker image for this project on Docker Hub:
To run the Docker image:
docker pull joeuzo/questionnaire:tagname
docker run --env-file .env -p 5000:5000 joeuzo/questionnaire:tagname
This project is licensed under the MIT License. See the LICENSE file for details.