Live App: https://branch-django.up.railway.app/
Original Streamlit Version: https://branch-app.streamlit.app/
GitHub: https://github.com/nategalit/branch-django
Branch is a community connection platform that bridges the gap between volunteers and people in need of resources across Spokane, WA. Volunteers use the app to find opportunities and log hours, while community members use it to locate essential services like food pantries, shelters, and clothing drives.
This Django version is a full rebuild of an original Streamlit prototype β adding real user authentication, a production-grade admin panel, and cloud deployment.
| Page | URL |
|---|---|
| Dashboard | https://branch-django.up.railway.app/ |
| Resource Finder | https://branch-django.up.railway.app/resources/ |
| Log Activity | https://branch-django.up.railway.app/log/ |
| Sign Up | https://branch-django.up.railway.app/signup/ |
| Admin Panel | https://branch-django.up.railway.app/admin/ |
| Feature | Streamlit Version | Django Version |
|---|---|---|
| User authentication | β None | β Full login/signup/logout |
| Admin interface | Built manually (Page 4) | β Django admin (free, built-in) |
| Form validation | Manual if checks |
β
Django ModelForms with clean() |
| Database queries | Raw SQL via psycopg2 | β Django ORM |
| URL routing | File-based (pages/) |
β
urls.py with named routes |
| Deployment | Streamlit Cloud | β Railway (production-grade) |
| Templates | Python widgets | β HTML templates with Bootstrap 5 |
- Backend: Python 3.14, Django 6.0
- Database: PostgreSQL (Neon.tech)
- Frontend: Bootstrap 5 (CDN)
- Deployment: Railway
- Auth: Django's built-in
django.contrib.auth
Three tables power the app:
users β Tracks both Volunteers and Community Members, storing contact info and gamification points (1 hour = 100 points).
locations β Stores active community resources (Food Pantries, Shelters, Clothing drives, General Volunteering) and their addresses.
visits β The junction table linking users and locations, tracking when a user volunteers or receives resources.
- Community Impact Dashboard β Live metrics showing total volunteers, community members, hours logged, and active locations. Recent activity feed with joined data across all three tables.
- Resource Finder β Filter locations by service type or search by name. Powered by Django ORM's
__icontainslookup (equivalent to SQLILIKE). - Log Activity β Form with server-side validation: volunteers must log hours > 0, community members get hours set to null automatically. Successful volunteer submissions award points and update the user's total.
- Gamification β 100 points per volunteer hour, tracked on each user's profile.
- Django Admin β Full CRUD for Profiles, Locations, and Visits with search, filter, and list display. Replaces the manually-built "Manage Directory" page from the Streamlit version.
- User Auth β Signup creates both a Django
auth.Userand a linkedProfilein one transaction. Login/logout with session management and password hashing handled by Django.
git clone https://github.com/nategalit/branch-django.git
cd branch-djangopython -m venv venv
# Windows
.\venv\Scripts\Activate.ps1
# Mac/Linux
source venv/bin/activatepip install -r requirements.txtDB_NAME=your_db_name
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_HOST=your_db_host
DB_PORT=5432
SECRET_KEY=your-secret-key
DEBUG=True
python manage.py runserverVisit http://localhost:8000
branch-django/
βββ core/ # Main Django app
β βββ migrations/
β βββ templates/
β β βββ core/
β β β βββ base.html # Shared navbar + layout
β β β βββ dashboard.html # Home page
β β β βββ resource_finder.html
β β β βββ log_activity.html
β β β βββ signup.html
β β βββ registration/
β β βββ login.html
β βββ admin.py # Admin panel config
β βββ forms.py # VisitForm + SignupForm
β βββ models.py # Profile, Location, Visit
β βββ urls.py # URL routing
β βββ views.py # View functions
βββ myapp/ # Django project config
β βββ settings.py
β βββ urls.py
β βββ wsgi.py
βββ .env # Local secrets (not committed)
βββ .gitignore
βββ Procfile # Railway deployment
βββ railway.json # Railway config
βββ requirements.txt
βββ manage.py
Moving from Streamlit to Django taught me how real web frameworks actually work:
- Separation of concerns β Models, views, templates, and URLs each have a specific job. In Streamlit everything runs top-to-bottom in one file; Django forces you to think in layers.
- Django ORM vs raw SQL β Writing
Profile.objects.filter(account_type='Volunteer').count()is safer and more readable than raw psycopg2 queries, and handles SQL injection automatically. - Forms and validation β Django's
ModelFormandclean()methods replace manualifchecks and make validation reusable and testable. - What frameworks are for β Django's built-in admin, auth system, and CSRF protection are things I would have had to build from scratch in Streamlit. Frameworks exist so you can focus on your app's unique logic, not boilerplate security and CRUD.
The biggest challenge was deployment β specifically, discovering that PythonAnywhere's free tier blocks outbound PostgreSQL connections (port 5432). Debugging that required reading error logs, testing connectivity with curl, and ultimately switching to Railway, which has no such restrictions. This kind of environment-specific debugging is something you don't encounter in a classroom but is completely normal in real software development.
Built as part of BMIS 444 β Project 1 | Gonzaga University






