🌱 Ecologic - Public Issue Reporting System

A beautiful, modern Django web application for reporting and managing public issues in communities. Citizens can report issues like broken streetlights, garbage problems, water issues, and more, while staff members can efficiently manage and resolve these reports.

✨ Features

For Citizens

  • Easy Registration & Login - Quick account creation with role-based authentication
  • Issue Reporting - Report issues with photos, descriptions, and location details
  • Real-time Tracking - Monitor the status of reported issues (Pending → In Progress → Resolved)
  • Personal Dashboard - View statistics and manage all your reported issues
  • Mobile Responsive - Works perfectly on all devices

For Staff

  • Custom Staff Dashboard - Comprehensive overview with statistics and charts
  • Issue Management - View, filter, and manage all reported issues
  • Quick Status Updates - One-click status changes with AJAX functionality
  • Assignment System - Assign issues to specific staff members
  • Priority Management - Set and manage issue priorities
  • Detailed Reporting - Track resolution times and category breakdowns

Technical Features

  • Beautiful UI - Modern design with Bootstrap 5 and custom styling
  • Image Upload - Automatic image resizing and optimization
  • Advanced Filtering - Filter issues by status, category, and search terms
  • Role-based Access - Secure separation between citizen and staff functionality
  • Responsive Design - Mobile-first approach with beautiful animations
  • Real-time Updates - AJAX-powered status updates without page refresh

🚀 Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)

Installation

  1. Clone or download the project ```bash # If using git git clone cd ecologic

# Or extract the downloaded files and navigate to the directory


2. **Run the setup script**
   ```bash
   python setup.py

This will:

  • Install all required dependencies
  • Create database migrations
  • Set up static files
  • Generate a secure secret key
  • Optionally create a superuser account
  1. Start the development server

    python manage.py runserver
    
  2. Open your browser Navigate to http://127.0.0.1:8000

📱 Usage Guide

Getting Started as a Citizen

  1. Visit the homepage and click "Register"
  2. Fill out the registration form (you'll automatically be assigned the "Citizen" role)
  3. After registration, you'll be redirected to your citizen dashboard
  4. Click "Report New Issue" to submit your first issue report
  5. Track your issues from "My Issues" page

Setting Up Staff Users

  1. Access the Django admin panel at /admin/
  2. Login with your superuser account
  3. Go to "Users" and create new users
  4. Set their role to "Staff" in the user profile
  5. Staff users will see the staff dashboard when they log in

Managing Issues (Staff)

  1. Login as a staff user
  2. Use the staff dashboard to see overview statistics
  3. Click "View All Issues" to see the complete list
  4. Use filters to find specific issues
  5. Click on any issue to view details and update status
  6. Use quick action buttons for fast status updates

🎨 Customization

Styling

  • Custom CSS is located in static/css/custom.css
  • The app uses Bootstrap 5 with custom color schemes
  • Modify CSS variables in the base template for theme changes

Categories

To add new issue categories:

  1. Edit issues/models.py - update CATEGORY_CHOICES
  2. Update the category icons in the category_icon property
  3. Run migrations: python manage.py makemigrations && python manage.py migrate

Email Notifications (Optional)

Configure email settings in .env file to enable notifications:

EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-app-password

🏗️ Project Structure

ecologic/
├── ecologic/            # Main project settings
├── accounts/            # User authentication and management
├── issues/              # Issue reporting and management
├── templates/           # HTML templates
├── static/              # CSS, JavaScript, and images
├── media/               # User uploaded files
├── requirements.txt     # Python dependencies
├── manage.py           # Django management script
└── setup.py            # Project setup script

🔧 Configuration

Environment Variables

Copy .env.example to .env and configure:

  • SECRET_KEY - Django secret key (auto-generated by setup script)
  • DEBUG - Set to False in production
  • Database settings (SQLite used by default)
  • Email configuration (optional)

Production Deployment

For production deployment:

  1. Set DEBUG=False in .env
  2. Configure ALLOWED_HOSTS in settings
  3. Set up a proper database (PostgreSQL recommended)
  4. Configure a web server (nginx + gunicorn)
  5. Set up SSL certificates
  6. Configure email for notifications

🛠️ Development

Running Tests

python manage.py test

Creating Migrations

python manage.py makemigrations
python manage.py migrate

Collecting Static Files

python manage.py collectstatic

Creating Sample Data

Use the Django admin panel to create sample issues and users for testing.

📊 Models

User Model

  • Extends Django's AbstractUser
  • Adds role field (Citizen/Staff)
  • Additional fields: phone_number, address

Issue Model

  • Complete issue tracking with status workflow
  • Image upload with automatic resizing
  • Priority and category classification
  • Staff assignment and notes
  • Comprehensive timestamps

🎯 Key Features Explained

Role-based Authentication

  • Citizens: Can report and track their own issues
  • Staff: Can view and manage all issues
  • Automatic dashboard redirection based on role

Status Workflow

  1. Pending - Newly reported issue
  2. In Progress - Staff is working on the issue
  3. Resolved - Issue has been fixed

AJAX Functionality

  • Quick status updates without page refresh
  • Real-time dashboard updates
  • Smooth user experience

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

📄 License

This project is open source and available under the MIT License.

🆘 Support

If you encounter any issues:

  1. Check the console for error messages
  2. Ensure all dependencies are installed
  3. Verify database migrations are applied
  4. Check file permissions for media uploads

🌟 Screenshots

The application features:

  • Beautiful landing page with feature highlights
  • Intuitive citizen dashboard with statistics
  • Comprehensive staff management interface
  • Mobile-responsive design
  • Modern UI with smooth animations

Made with ❤️ for better communities

Share this project:

Updates