Follow these steps to set up the OWASP Nest application:
-
Clone the Repository:
-
Clone the repository code from GitHub using the following command:
git clone https://github.com/owasp/nest
-
-
Create Environment Files:
-
Create a local environment file in the
backend
directory:touch backend/.env/local
-
Copy the contents from the template file into your new local environment file:
cp backend/.env/template backend/.env/local
-
Create a local environment file in the
frontend
directory:cp frontend/.env.example frontend/.env
-
-
Configure Environment Variables:
-
Open the
backend/.env/local
file in your preferred text editor and change theDJANGO_CONFIGURATION
value toLocal
:DJANGO_CONFIGURATION=Local
-
-
Set Up Algolia:
- Go to Algolia and create a free account.
- After creating an account, create an Algolia app.
- Update your
.env/local
file with the following keys from your Algolia app:
DJANGO_ALGOLIA_API_KEY=<your_algolia_api_key> DJANGO_ALGOLIA_APPLICATION_ID=<your_algolia_application_id>
- Ensure that your API key has index write permissions. You can ignore any onboarding wizard instructions provided by Algolia.
-
Run the Application:
- In your terminal, navigate to the project directory and run the following command to start the application:
make run
- Leave this terminal session running and wait until you see that Nest local is responding.
-
Load Initial Data:
- Open a new terminal session and run the following command to populate the database with initial data from fixtures:
make load-data
-
Index Data:
- In the same terminal session, run the following command to index the data:
make index-data
-
Verify API Endpoints:
- Check that the data is available via these API endpoints:
If you plan to fetch GitHub OWASP data locally, follow these additional steps:
- Create a Super User:
- Run the following command to create a super user for accessing the admin interface:
make setup
-
Generate a GitHub Personal Access Token:
- Create a GitHub personal access token.
-
Update Environment Variables with GitHub Token:
-
Open
backend/.env/local
again and update it with your GitHub token:GITHUB_TOKEN=<your_github_token>
-
-
Sync Local Database Data:
- Now you should be able to run the following command to sync your local database data with GitHub:
make sync