This repository uses surveys in the form of web application and printable forms to collect data analyze and help identify key issues in the localities of Cameroon
# Cameroon Daily Life Challenges — Survey Project
This repository uses surveys in the form of a web application and printable forms to collect data, analyze it, and help identify key issues in localities of Cameroon.
## Contents
- `index.htm` — Frontend survey (bilingual EN/FR). Sends JSON to backend `/api/submit`.
- `survey.md` — Printable English and French paper forms.
- `survey-backend/src` — Flask backend that accepts survey JSON and appends rows to a CSV.
- `survey-backend/data` — (ignored in git) storage for CSV responses.
- `.gitignore` — ignores virtualenv and data folders.
## Quick start (Linux)
1. Clone repo and enter project
```
cd /home/patrick/Documents/projects/personal/problems
```
2. Backend (recommended: create virtualenv)
```
python3 -m venv survey-backend/venv
source survey-backend/venv/bin/activate
pip install -r survey-backend/requirements.txt
```
3. Configure (optional)
- Set FRONTEND_ORIGIN to your GitHub Pages URL so CORS allows requests:
```
export FRONTEND_ORIGIN="
your-github-username.github…"
```
- Optionally set SURVEY_CSV to change CSV output location:
```
export SURVEY_CSV="/absolute/path/to/data/survey_responses.csv"
```
4. Run backend
- From repo root (so imports work):
```
PYTHONPATH=./survey-backend/src python -m survey-backend.src.app
```
- Or:
```
cd survey-backend
PYTHONPATH=./src python -m src.app
```
5. Frontend
- Open `index.htm` in a browser, or serve with a static server:
```
python3 -m http.server 8080
# then open
localhost
```
- The frontend POSTs JSON to `
localhost` by default. Update `BACKEND_URL` in `index.htm` if backend is remote.
## Notes
- No client-side persistent storage is used: responses are sent directly to the backend.
- Backend appends responses to a CSV (`survey-backend/data/survey_responses.csv` by default). The `data` folder is created automatically and is gitignored.
- Keep environment variables and production configuration secure (set `DEBU …