Architecture Overview
OWASP Nest is a full-stack application built with modern web technologies and follows a containerized microservices architecture for both development and production environments.Technology Stack
Backend Stack
Python 3.13
Modern Python with latest language features and performance improvements
Django 6.0
High-level Python web framework with batteries included
Django Ninja
Fast, modern REST API framework built on top of Django
Strawberry GraphQL
Code-first GraphQL library for Python with Django integration
PostgreSQL + pgvector
Relational database with vector similarity search for AI features
Redis
In-memory cache and message broker for background jobs
Django RQ
Redis Queue integration for asynchronous task processing
Gunicorn
Production WSGI HTTP server
Frontend Stack
Next.js 16
React framework with server-side rendering and app router
TypeScript
Type-safe JavaScript for enhanced developer experience
React 19
Latest React with concurrent features and improved hooks
Tailwind CSS 4
Utility-first CSS framework for rapid UI development
HeroUI
React component library built on Tailwind CSS
Apollo Client
GraphQL client with caching and state management
React Leaflet
Interactive maps for OWASP chapter locations
ApexCharts
Modern charting library for data visualization
External Services
Algolia
Fast, typo-tolerant search for projects, issues, and users
GitHub API
Sync OWASP organization data, repositories, and issues
Slack
NestBot integration for community communication
OpenAI
AI-powered issue summaries and contribution suggestions
Sentry
Real-time error tracking and performance monitoring
Backend Architecture
Django Apps Structure
The backend is organized into Django apps, each responsible for a specific domain:- ai
- api
- github
- owasp
- slack
- mentorship
AI & Machine Learning
- LangChain agent for natural language queries
- RAG (Retrieval-Augmented Generation) system
- Vector embeddings with pgvector
- OpenAI integration for summaries and suggestions
- Document chunking and context extraction
Database Schema
The application uses PostgreSQL with the following key models:GitHub Models
GitHub Models
GitHubOrganization- OWASP and related organizationsGitHubRepository- Project repositoriesGitHubIssue- Contribution opportunitiesGitHubUser- Contributor profilesGitHubPullRequest- Code contributions
OWASP Models
OWASP Models
Project- OWASP projects with metadataChapter- Geographic chaptersCommittee- OWASP committeesEvent- Conferences and meetupsSponsor- Corporate sponsors
AI Models
AI Models
Embedding- Vector embeddings for semantic searchContext- Document contexts for RAGChunk- Text chunks for AI processing
Mentorship Models
Mentorship Models
Mentor- Mentor profilesMentee- Mentee profilesMentorshipAssignment- Mentor-mentee relationships
Configuration Classes
Django settings are organized usingdjango-configurations:
DJANGO_CONFIGURATION environment variable.
API Design
- REST API
- GraphQL API
Django Ninja REST APIBase URL:
/api/v0/Key endpoints:/api/v0/projects/- Project listing and search/api/v0/chapters/- Chapter information/api/v0/committees/- Committee data/api/v0/issues/- Contribution opportunities/api/v0/users/- User profiles
- Automatic OpenAPI schema generation
- Request/response validation with Pydantic
- Built-in filtering and pagination
- JWT authentication support
Frontend Architecture
Next.js App Structure
Data Fetching Strategy
- Server Components
- Client Components
Next.js Server ComponentsUsed for static/SSR pages:
- Project listings
- Chapter directories
- Public profiles
- Zero client-side JavaScript
- SEO-friendly
- Fast initial page load
Authentication Flow
Deployment Architecture
Docker Compose Services
- Local
- Production
- Testing
Local Development (
docker-compose/local/compose.yaml)Services:backend- Django with hot reloadfrontend- Next.js with Turbopackdb- PostgreSQL with pgvectorcache- Redisworker- RQ worker with schedulerdocs- MkDocs documentation server
- Source code mounted for live editing
- Database persisted in Docker volume
- Poetry/pnpm dependencies cached
Build Process
Image Scanning
- Trivy for vulnerability scanning
- Semgrep for security patterns
- SBOM generation with CycloneDX
Performance Optimizations
Caching
- Redis for session storage
- Django cache framework
- API response caching
- CDN edge caching
Database
- Connection pooling
- Query optimization with select_related
- Database indexes on foreign keys
- pgvector for semantic search
Frontend
- Next.js Image optimization
- Code splitting and lazy loading
- Bundle size monitoring
- Tree shaking unused code
API
- GraphQL DataLoader for batching
- Request throttling
- Pagination on large datasets
- Gzip compression
Security Architecture
Authentication & Authorization
Authentication & Authorization
CSRF & CORS
CSRF & CORS
- CSRF tokens for state-changing requests
- CORS headers configured per environment
- SameSite cookie attributes
- Secure cookie flags in production
Secrets Management
Secrets Management
- Environment variables for secrets
- AWS Secrets Manager in production
- GitHub encrypted secrets in CI/CD
- No secrets in source code
Security Scanning
Security Scanning
- Semgrep for SAST
- Trivy for dependency vulnerabilities
- ZAP for DAST
- Snyk continuous monitoring
- GitHub Advanced Security
Monitoring & Observability
Error Tracking
Sentry for both backend and frontend error monitoring with:
- Real-time error alerts
- Stack traces and breadcrumbs
- Release tracking
- Performance monitoring
Application Tracing
AWS X-Ray for distributed tracing:
- Request flow visualization
- Latency analysis
- Service map
- Bottleneck identification
Logs
Centralized logging with:
- CloudWatch Logs
- Structured JSON logging
- Log retention policies
- Query and analysis tools
Metrics
CloudWatch metrics for:
- CPU and memory usage
- Request rates and latency
- Database connections
- Cache hit rates
Next Steps
Backend Development
Learn about Django backend development
Frontend Development
Learn about Next.js frontend development