NextJs application for Nrcs community website.
Before you start, create .env.local file:
touch .env.localSet these environment variables:
PORT=3055
NEXT_PUBLIC_GRAPHQL_CODEGEN_ENDPOINT=./backend/schema.graphql
NEXT_PUBLIC_GRAPHQL_DOMAIN=<api-endpoint>pnpm install
# This prefetches latest data from Nrcs database for projects and generate type
pnpm prebuild
# Start web app
pnpm startBefore creating a pull request, all lint and type issues must be fixed. To check for issues:
pnpm lint
pnpm typecheckpnpm build-
Crete a Pull Request to the develop branch:
-
Push your feature branch to the remote repository
git checkout develop git checkout -b <your-feature-branch> git push -u origin <your-feature-branch>
-
Open a Pull Request targeting the develop branch.
-
Once approved and merged, your changes will be included in the develop branch.
-
-
Trigger the staging deployment:
-
The staging deployment is managed through this repository: 🔗 https://github.com/NRCS-NRCS/stage-nrcs-client
-
Anything pushed to
developbranch will trigger immediate deployment to configured stage github io page. -
You can manually trigger the deployment workflow here: 🔗 Staging Workflow – stage.yml
-
Note: The staging environment also auto-deploys every day at 01:00 UTC.
Deployments will be triggered in 2 ways:
- Anything pushed to
mainbranch will trigger immediate deployment to configured github io page. - Every day at UTC 00:01, deployment will be triggered with latest data from NRCS database.
We use a docker-compose.yml file (located at ./backend/docker-compose.yml).
To run it, you need to add this with the following content in .env.local:
# Include the backend services
COMPOSE_FILE=./backend/docker-compose.yaml:docker-compose.yml
# Use the same .env file for both backend and web-app
BACKEND_ENV_FILE=../.env
NOTE:
../refers to the web-app folder, relative to./backend/docker-compose.yml(the main Docker Compose file).