CivicCare is a single-page application (SPA) combined with a robust backend API designed to report, track, and automatically escalate local civic issues based on predefined time limits.
Follow these steps to get the project running locally.
The backend handles issue persistence and the core escalation logic.
# Replace with your actual repository URL
git clone [repository-url]
cd civiccare-backend
python3 -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
pip install -r requirements.txt
Create the Configuration File (.env
):
Create a file named .env
in the root of your backend directory and populate it with the required variables.
# .env file content
FLASK_APP=app.py
FLASK_ENV=development
DATABASE_URL=sqlite:///civiccare.db
SECRET_KEY="YOUR_SUPER_SECURE_SECRET_KEY"
# Escalation Timers (in hours)
ESCALATION_TIMER_1_HOURS=48
ESCALATION_TIMER_2_HOURS=96
# MOCK CREDENTIALS (for real-world integration)
EMAIL_API_KEY="YOUR_SENDGRID_API_KEY"
TWILIO_ACCOUNT_SID="ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Run the Flask Server:
The server will automatically create the SQLite database (civiccare.db
) on the first run and start the APScheduler background job.
python app.py
The API should be running at http://127.0.0.1:5000
.
The frontend is a single HTML file and should be served alongside the backend.
Placement: Ensure the index.html
file (the provided frontend code) is configured to send POST
requests to the correct backend endpoint (/api/report
).
(In a full setup, you would typically serve the HTML statically from the Flask app or use a proxy like Nginx to handle routing.)
Access: Open your browser and navigate to the location where the frontend is being served (e.g., http://127.0.0.1:5000/
if served by Flask).