Aggregated Public Information
Note: This page is mirrored from the aggregated-public-information README. Please make edits there.
This project uses Strapi as a CMS backend. For most information about contributing to DA (e.g. our dev process and asking for help), please refer to the general DA contributing guide.
Dev Environment Setup
Section titled “Dev Environment Setup”Clone this repository
Section titled “Clone this repository”git clone git@github.com:distributeaid/aggregated-public-information.gitcd aggregated-public-informationInstall nvm
Section titled “Install nvm”Node.js 18.17 or later is required.
Node Version Manager (nvm) is used to manage Node.js versions:
- macOS/Linux: Node Version Manager (nvm)
- Windows: Node Version Manager for Windows
Install yarn
Section titled “Install yarn”To build dependencies, you should also have yarn installed on your system. If it is not yet installed, you can run:
npm install --global corepackcorepack enablehash -rRunning a Local Site
Section titled “Running a Local Site”Once you have a development environment, you can set up your local site!
Set Up Local Private Keys
Section titled “Set Up Local Private Keys”./setup.bashInstall your packages
Section titled “Install your packages”yarn installStart Your Server
Section titled “Start Your Server”In one terminal, run develop, this will live rebuild your application as you make changes:
yarn developIf you want auto-reload disabled, you can just run build and then start:
yarn buildyarn startRun Server Tests
Section titled “Run Server Tests”yarn testNote: This depends on your application being built! If you don’t run
yarn developthen you must runyarn buildafter each change before runningyarn test. We have providedyarn test:without-buildas a convenience in this case.
View the Site and Set Up an Admin User
Section titled “View the Site and Set Up an Admin User”If you are running locally, your site should be available in the output after you run yarn develop - you will see something like:
One more thing...Create your first administrator by going to the administration panel at:┌─────────────────────────────┐│ http://localhost:1337/admin │└─────────────────────────────┘If you run into trouble, please check out:
- How to reset your password
- To recover the email address you used to sign up, run:
npx strapi consoleawait strapi.query('admin::user').findMany()Code Checks
Section titled “Code Checks”Before creating a pull request, test a final time and check for errors:
yarn check:allWe provide a couple of scripts to automatically fix linting and formatting issues, where possible:
yarn lint:fixyarn format:fixAPI Testing
Section titled “API Testing”We use Bruno to create and run API tests. See the Bruno test docs for setup and usage instructions.
Learn More About Strapi
Section titled “Learn More About Strapi”API Usage
Section titled “API Usage”- Populate relations – Learn how to populate nested and relational data in Strapi API responses.
Troubleshooting
Section titled “Troubleshooting”If you run into any issues, reach out to the team on the #tech channel on Slack!