How daniiizita/disc_assessment works
Project Type and Purpose
• This is a full-stack web application built with Django (Python) that implements a behavioral assessment tool based on the DISC model.
• It comprises three Django “apps”:
• core – handles landing pages, contact, static assets and generic content
• disc – implements the interactive DISC questionnaire, processing logic, and result views
• user_auth – extends Django‐allauth for user registration, login/logout, profile management, and stores user results
File Structure
• Root:
• manage.py – Django CLI entry point
• assessment_disc_project/ – project settings (asgi.py, wsgi.py, settings.py, urls.py)
• requirements.txt – lists Python dependencies (Django, allauth, etc.)
• db.sqlite3 – development database
• Apps:
• core/, disc/, user_auth/ – each with models.py, views.py, urls.py, templates/, migrations/, (core also has static/)
• templates/account/ – overrides/allauth templates for signup, login, password reset
• Notice MVC / MTV pattern:
• Models → disc/models.py, user_auth/models.py, core/models.py
• Views → app/views.py handle HTTP, orchestrate business logic
• Templates → HTML under templates/ for each app
• Static assets served from core/static/ and possibly collected to a static root in production
Key Architectural Insights from README
• Backend: Django & Python
• Frontend: HTML5, CSS3 (custom + Bootstrap), minimal JavaScript
• Auth: allauth extended via custom forms and user model
• DB: SQLite for dev, MySQL for production
• Future: Integration with external recruitment APIs, admin dashboard, automated tests
a. Main Components
• Client (Web Browser)
• Web Server / Application Layer (Django)
– URL Dispatcher (assessment_disc_project/urls.py)
– Apps: core, disc, user_auth
– Django‐allauth Integration
• Data Layer
– Development: SQLite
– Production: MySQL
• Static File Server / CDN
• Email Service (SMTP) – for password resets, contact form notifications
• (Future) External Recruitment API
• (Future) Admin Dashboard & Reporting Module
b. Relationships & Interactions
1. Browser → HTTP(S) → Nginx/Gunicorn/Uvicorn → Django
2. URL Dispatcher routes to appropriate app’s view
3. Views call Models to query/update DB
4. Views render Templates, embed data (profile results, question forms)
5. Static requests served directly by Nginx or CDN
6. Auth flows: Browser ←→ Django-allauth ←→ user_auth.forms/models
7. Email notifications via SMTP relay
8. (Future) DISC result triggers REST call to Recruitment API
9. (Future) Admin Dashboard queries DB, generates reports
c. Architectural Patterns & Principles
• MTV (Model-Template-View) inherent to Django
• Separation of concerns: authentication, core pages, DISC logic in distinct apps
• Layered architecture: presentation, business logic, data access
• Extensibility: apps communicate through Django’s URL routing and signals (for future hooks)
d. Key Technologies & Libraries
• Django framework (ORM, routing, template engine)
• django-allauth for robust auth, extended via custom user model/forms
• SQLite/MySQL as relational DB
• Bootstrap + custom CSS for responsive UI
• Potential: Nginx or Apache as reverse proxy/static server; Gunicorn/Uvicorn as WSGI/ASGI server