Initial Commit

This commit is contained in:
2025-08-18 21:04:22 +05:30
commit f6ebcb570a
32 changed files with 521 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
civicenv
+1
View File
@@ -0,0 +1 @@
RECOVERY_CODE = 'QNMHFLRJTNFEB8VCG3WB8U3P'
+1
View File
@@ -0,0 +1 @@
.env
View File
Binary file not shown.
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
"""
ASGI config for civicfix project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'civicfix.settings')
application = get_asgi_application()
+115
View File
@@ -0,0 +1,115 @@
import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-wa6p9d+go#+evjql%m(+e5eti$%z7yx2o#cbq8bsh!==icxua3'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'core',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'civicfix.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'civicfix.wsgi.application'
# Database
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'civixfix_db',
'USER': 'civicfix_user',
'PASSWORD': 'Gokul@2001',
'HOST': 'localhost',
'PORT': '5432',
}
}
# Password validation
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/5.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.2/howto/static-files/
STATIC_URL = 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
+12
View File
@@ -0,0 +1,12 @@
from django.contrib import admin
from django.urls import path, include
from django.contrib.auth import views as auth_views
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('core.urls')),
path('login/', auth_views.LoginView.as_view(template_name='core/login.html'), name='login'),
path('logout/', auth_views.LogoutView.as_view(), name='logout'),
path('register/', auth_views.LoginView.as_view(template_name='core/register.html'), name='register'),
]
+16
View File
@@ -0,0 +1,16 @@
"""
WSGI config for civicfix project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'civicfix.settings')
application = get_wsgi_application()
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+6
View File
@@ -0,0 +1,6 @@
from django.apps import AppConfig
class CoreConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'core'
+3
View File
@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.
+107
View File
@@ -0,0 +1,107 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Civixfix - {% block title %}Community Issue Reporting Platform{% endblock %}</title>
<!-- Bootstrap 5 CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<!-- Custom CSS -->
<style>
.hero-section {
background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?ixlib=rb-4.0.3');
background-size: cover;
background-position: center;
color: white;
padding: 100px 0;
margin-bottom: 30px;
}
.feature-icon {
font-size: 2.5rem;
margin-bottom: 1rem;
color: #0d6efd;
}
.issue-card {
transition: transform 0.3s;
}
.issue-card:hover {
transform: translateY(-5px);
}
</style>
{% block extra_css %}{% endblock %}
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top">
<div class="container">
<a class="navbar-brand" href="{% url 'home' %}">
<i class="fas fa-bullhorn me-2"></i>Civixfix
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link active" href="{% url 'home' %}">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#features">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#how-it-works">How It Works</a>
</li>
</ul>
<div class="d-flex">
<a href="{% url 'login' %}" class="btn btn-outline-light me-2">Login</a>
<a href="{% url 'register' %}" class="btn btn-primary">Register</a>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main>
{% block content %}{% endblock %}
</main>
<!-- Footer -->
<footer class="bg-dark text-white py-4 mt-5">
<div class="container">
<div class="row">
<div class="col-md-4 mb-3">
<h5><i class="fas fa-bullhorn me-2"></i>Civixfix</h5>
<p class="text-muted">Empowering communities through transparent issue reporting and resolution.</p>
</div>
<div class="col-md-4 mb-3">
<h5>Quick Links</h5>
<ul class="list-unstyled">
<li><a href="#features" class="text-decoration-none text-muted">Features</a></li>
<li><a href="#how-it-works" class="text-decoration-none text-muted">How It Works</a></li>
<li><a href="#" class="text-decoration-none text-muted">Privacy Policy</a></li>
</ul>
</div>
<div class="col-md-4 mb-3">
<h5>Contact</h5>
<ul class="list-unstyled text-muted">
<li><i class="fas fa-envelope me-2"></i> support@civixfix.com</li>
<li><i class="fas fa-phone me-2"></i> +1 (555) 123-4567</li>
</ul>
</div>
</div>
<hr class="my-4 bg-secondary">
<div class="text-center text-muted">
<small>&copy; {% now "Y" %} Civixfix. All rights reserved.</small>
</div>
</div>
</footer>
<!-- Bootstrap 5 JS Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
{% block extra_js %}{% endblock %}
</body>
</html>
+189
View File
@@ -0,0 +1,189 @@
{% extends "core/base.html" %}
{% block content %}
<!-- Hero Section -->
<section class="hero-section text-center">
<div class="container">
<h1 class="display-4 fw-bold mb-4">Report. Resolve. Rejoice.</h1>
<p class="lead mb-5">Your voice matters in making our community better. Report local issues and track their resolution in real-time.</p>
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
<a href="{% url 'register' %}" class="btn btn-primary btn-lg px-4 gap-3">Report an Issue</a>
<a href="#how-it-works" class="btn btn-outline-light btn-lg px-4">Learn More</a>
</div>
</div>
</section>
<!-- Stats Section -->
<section class="container mb-5">
<div class="row text-center">
<div class="col-md-3">
<h3 class="fw-bold text-primary">403+</h3>
<p class="text-muted">Issues Reported</p>
</div>
<div class="col-md-3">
<h3 class="fw-bold text-primary">403+</h3>
<p class="text-muted">Issues Resolved</p>
</div>
<div class="col-md-3">
<h3 class="fw-bold text-primary">403+</h3>
<p class="text-muted">Active Users</p>
</div>
<div class="col-md-3">
<h3 class="fw-bold text-primary">403+</h3>
<p class="text-muted">Municipal Departments</p>
</div>
</div>
</section>
<!-- Features Section -->
<section id="features" class="container mb-5">
<div class="text-center mb-5">
<h2 class="fw-bold">Why Choose Civixfix?</h2>
<p class="lead text-muted">Transparent, efficient, and community-driven problem solving</p>
</div>
<div class="row g-4">
<div class="col-md-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center p-4">
<div class="feature-icon">
<i class="fas fa-map-marked-alt"></i>
</div>
<h5 class="card-title">Location-Based Reporting</h5>
<p class="card-text text-muted">Pinpoint issues on an interactive map for accurate location tracking and faster resolution.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center p-4">
<div class="feature-icon">
<i class="fas fa-tasks"></i>
</div>
<h5 class="card-title">Real-Time Tracking</h5>
<p class="card-text text-muted">Follow your reported issues through every stage from reporting to resolution.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center p-4">
<div class="feature-icon">
<i class="fas fa-users"></i>
</div>
<h5 class="card-title">Community Engagement</h5>
<p class="card-text text-muted">Vote and comment on issues to help prioritize what matters most to your neighborhood.</p>
</div>
</div>
</div>
</div>
</section>
<!-- How It Works Section -->
<section id="how-it-works" class="bg-light py-5 mb-5">
<div class="container">
<div class="text-center mb-5">
<h2 class="fw-bold">How Civixfix Works</h2>
<p class="lead text-muted">Simple steps to make your community better</p>
</div>
<div class="row g-4">
<div class="col-md-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center p-4">
<span class="badge bg-primary rounded-circle mb-3" style="width: 50px; height: 50px; line-height: 50px; font-size: 1.5rem;">1</span>
<h5 class="card-title">Report an Issue</h5>
<p class="card-text text-muted">Take a photo, add details, and drop a pin on the map to report problems in your area.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center p-4">
<span class="badge bg-primary rounded-circle mb-3" style="width: 50px; height: 50px; line-height: 50px; font-size: 1.5rem;">2</span>
<h5 class="card-title">Community Support</h5>
<p class="card-text text-muted">Others can vote and comment to show support and add details to your report.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center p-4">
<span class="badge bg-primary rounded-circle mb-3" style="width: 50px; height: 50px; line-height: 50px; font-size: 1.5rem;">3</span>
<h5 class="card-title">Official Response</h5>
<p class="card-text text-muted">Municipal authorities receive, prioritize, and work on resolving the issues.</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Recent Issues Section -->
<section class="container mb-5">
<div class="d-flex justify-content-between align-items-center mb-4">
<h2 class="fw-bold">Recently Reported Issues</h2>
<a href="#" class="btn btn-outline-primary">View All Issues</a>
</div>
<div class="row g-4">
<div class="col-md-4">
<div class="card issue-card h-100">
<img src="https://images.unsplash.com/photo-1604176354204-92658cb65a8a?ixlib=rb-4.0.3" class="card-img-top" alt="Pothole">
<div class="card-body">
<span class="badge bg-warning text-dark mb-2">Roads</span>
<h5 class="card-title">Large pothole on Main Street</h5>
<p class="card-text text-muted">A dangerous pothole near the intersection causing damage to vehicles.</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted"><i class="fas fa-map-marker-alt me-1"></i> 0.3 miles away</small>
<small class="text-muted"><i class="fas fa-thumbs-up me-1"></i> 24 votes</small>
</div>
</div>
<div class="card-footer bg-transparent">
<small class="text-success"><i class="fas fa-check-circle me-1"></i> In Progress</small>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card issue-card h-100">
<img src="https://images.unsplash.com/photo-1584473457406-6240486418e9?ixlib=rb-4.0.3" class="card-img-top" alt="Garbage">
<div class="card-body">
<span class="badge bg-success mb-2">Sanitation</span>
<h5 class="card-title">Overflowing garbage bins</h5>
<p class="card-text text-muted">Trash bins at the park haven't been emptied in over a week.</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted"><i class="fas fa-map-marker-alt me-1"></i> 0.7 miles away</small>
<small class="text-muted"><i class="fas fa-thumbs-up me-1"></i> 42 votes</small>
</div>
</div>
<div class="card-footer bg-transparent">
<small class="text-info"><i class="fas fa-clock me-1"></i> Acknowledged</small>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card issue-card h-100">
<img src="https://images.unsplash.com/photo-1508514177221-188b1cf16e9d?ixlib=rb-4.0.3" class="card-img-top" alt="Streetlight">
<div class="card-body">
<span class="badge bg-info mb-2">Electricity</span>
<h5 class="card-title">Broken streetlight on Oak Ave</h5>
<p class="card-text text-muted">Dark intersection creating safety concerns for pedestrians.</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted"><i class="fas fa-map-marker-alt me-1"></i> 1.2 miles away</small>
<small class="text-muted"><i class="fas fa-thumbs-up me-1"></i> 18 votes</small>
</div>
</div>
<div class="card-footer bg-transparent">
<small class="text-success"><i class="fas fa-check-circle me-1"></i> Resolved</small>
</div>
</div>
</div>
</div>
</section>
<!-- Call to Action -->
<section class="bg-primary text-white py-5">
<div class="container text-center">
<h2 class="fw-bold mb-4">Ready to make a difference in your community?</h2>
<p class="lead mb-4">Join thousands of citizens who are actively improving their neighborhoods.</p>
<a href="{% url 'register' %}" class="btn btn-light btn-lg px-4">Get Started Now</a>
</div>
</section>
{% endblock %}
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+6
View File
@@ -0,0 +1,6 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='home'),
]
+4
View File
@@ -0,0 +1,4 @@
from django.shortcuts import render
def home(request):
return render(request, 'core/index.html')
Binary file not shown.
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'civicfix.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
+16
View File
@@ -0,0 +1,16 @@
<!-- base.html -->
{% load static %}
<!DOCTYPE html>
<html>
<head>
<title>Civixfix - {% block title %}{% endblock %}</title>
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
</head>
<body>
<div class="container mt-4">
{% block content %}{% endblock %}
</div>
<script src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
</body>
</html>