About the Project
Nest is a full-stack web application built using:- Backend: Python, Django
- Frontend: TypeScript, Next.js, React, Tailwind CSS
- Search: Algolia
Prerequisites
Before contributing, ensure you have the following installed:- Docker: Required for running the Nest instance - Docker documentation
- pre-commit: Required to automate code checks - pre-commit documentation
- WSL (Windows Subsystem for Linux): Required for Windows users to enable Linux compatibility - WSL documentation
Starring and Forking
Before you begin:- Star the project: OWASP/Nest
- Fork the repository: Fork OWASP/Nest
Environment Setup
Set Up Algolia
- Go to Algolia and create a free account
- An Algolia app is automatically created for you when you sign up
- During sign up, you can skip the data import step
- Update your
backend/.envfile with your Algolia credentials:
The default write API key should have index write permissions (addObject permission). If you use a different API key, ensure it has this permission.
Run the Application
Navigate to the project root directory (not Leave this terminal session running and wait until Nest local is responding.
backend or frontend subdirectories) and run:As we use a containerized approach, this command must run in parallel to other Nest commands. Keep it running in the current terminal and use another terminal session for your work.
Environment Variables Reference
For a complete list of environment variables, see the sections below:Frontend Variables
NEXT_PUBLIC_API_URL- The base URL for the application’s internal APINEXT_PUBLIC_CSRF_URL- Endpoint for fetching CSRF tokensNEXT_PUBLIC_ENVIRONMENT- Current environment (development,production)NEXT_PUBLIC_GRAPHQL_URL- GraphQL API endpointNEXT_PUBLIC_GTM_ID- Google Tag Manager container IDNEXT_PUBLIC_RELEASE_VERSION- Current release versionNEXT_PUBLIC_SENTRY_DSN- Sentry error tracking DSN
Backend Variables
DJANGO_ALGOLIA_APPLICATION_ID- Algolia application IDDJANGO_ALGOLIA_WRITE_API_KEY- Algolia write API keyDJANGO_ALLOWED_HOSTS- Comma-separated list of allowed hostsDJANGO_CONFIGURATION- Django configuration class to loadDJANGO_DB_HOST,DJANGO_DB_NAME,DJANGO_DB_PASSWORD,DJANGO_DB_PORT,DJANGO_DB_USER- Database configurationDJANGO_SECRET_KEY- Django secret key for cryptographic signingDJANGO_SENTRY_DSN- Sentry DSN for backend error trackingGITHUB_TOKEN- GitHub personal access token (optional, for data sync)
Optional Setup Steps
GitHub Data Fetch
If you plan to fetch GitHub OWASP data locally:Generate a GitHub Token
Create a GitHub personal access token
NestBot Development
To setup NestBot development environment:Set Up ngrok
- Go to ngrok and create a free account
- Install and configure ngrok using these instructions
- Create your static domain at ngrok domains
- Edit ngrok configuration:
- Start ngrok:
Update Environment Variables
Update
backend/.env with your Slack application tokens:- Bot User OAuth Token from
Settings -- Install App -- OAuth Tokens - Signing Secret from
Settings -- Basic Information -- App Credentials
Configure Slack Application
Configure your Slack application using the NestBot manifest file:
- Copy its contents and save it into
Features -- App Manifest - Replace slash commands endpoint with your ngrok static domain path
- Reinstall your Slack application using
Settings -- Install App
Local Access to Internal Dashboards
When running locally, some UI sections require specific backend roles configured via Django Admin.Project Health Dashboard (Staff Access)
The Project Health Dashboard is visible only to users marked as staff.Open Django Admin
Navigate to http://localhost:8000/a and log in with your superuser credentials
Enable Staff Permissions
- Navigate to GitHub Users and open your user record
- In the Permissions section, enable the custom
is_owasp_stafffield - Save the changes
Clear Authentication Cookies
- Open http://localhost:3000
- Open browser DevTools → Application / Storage
- Clear Cookies for the site
- Refresh and sign in again with GitHub
Mentorship Portal (“My Mentorship”)
The “My Mentorship” menu item is shown only if the user is a Project Leader or a Mentor. Option 1: Grant access as a Project Leader (recommended)Open Django Admin
Navigate to http://localhost:8000/a → OWASP → Projects
Configure Project
- Open an existing project or create a test project
- In the
leaders_rawfield, add your exact GitHub username - Save the project
Refresh Session
- Open http://localhost:3000
- Clear Cookies for the site
- Refresh and sign in again with GitHub
Create Mentor Record
- Open Django Admin → Mentorship → Mentors
- Click Add Mentor
- Select your GitHub user in the
github_userfield - Fill in required fields and save
Code Quality Checks
Nest enforces code quality standards to ensure consistency and maintainability. Run automated checks locally before pushing changes:Testing
Our CI/CD pipelines automatically run tests against every Pull Request. Run tests locally before submitting a PR:Test Coverage Requirements
- There is a minimum test coverage requirement for the backend code (see pyproject.toml)
- There is a minimum test coverage requirement for the frontend code (see jest.config.ts)
- Ensure your changes do not drop the overall test coverage percentage
- If adding new functionality, include relevant test cases
Security Scanning
Run security scans for vulnerabilities and anti-patterns:- Performs local Semgrep and Trivy scans
- Outputs findings to the terminal for immediate review
- Review the output for specific file paths and line numbers
- Follow the documentation links provided for remediation guidance
- Use
# NOSEMGREPto suppress confirmed false positives while adding a short comment explaining each suppression
E2E Tests
Run frontend e2e tests:Fuzz Tests
Run fuzz tests:Contributing Workflow
The following diagram illustrates the complete contribution workflow:Keep Your Fork in Sync
To avoid working on an outdated copy of Nest (and reduce merge conflicts), keep your fork synchronized with the main repository. Setting up the upstream remote: If you haven’t added the upstream remote yet:origin (your fork) and upstream (the main repository) remotes.
Before working on a new feature or issue:
Update your local main branch from upstream/main:
Step-by-Step Contribution Process
Find Something to Work On
- Check the Issues tab for open issues
- Found a bug or have a feature request? Open a new issue
- Want to work on an existing issue? Ask the maintainers to assign it to you before submitting a pull request
- New to the project? Start with issues labeled
good first issue
Make Changes and Commit
- Check that your commits include only related and intended changes
- Follow best practices for code style and testing
- Add tests for any new functionality
- Run the code quality checks and tests:
- Write meaningful commit messages:
Open a Pull Request
- Submit a Pull Request (PR) to the
mainbranch - Your PR will trigger CI/CD pipelines that run automated checks and tests
Troubleshooting
”Unexpected character” Error
This error is usually caused by incorrect encoding of.env files.
Solution:
- Open the
.envfiles in a text editor (e.g., VS Code) - Save them as “UTF-8 without BOM”:
- Click on the encoding information in the bottom-right corner
- Select “Save with Encoding”
- Choose “UTF-8” (ensure it’s not “UTF-8 with BOM”)
- Restart the application with
make run