Next.js app for Bransby Equine Training Tracker Application.
- Node
- Docker
- Git clone the repo.
- Git clone the Springboot API and run with Docker. See repository README.md.
- Set up an .env file as below to enable authentication with Azure AD using NextAuth.js.
NEXT_PUBLIC_URL= # REST API domain
# env variables required for NextAuth authentication. Values taken from auth token provider - Azure AD.
AZURE_AD_CLIENT_ID=
AZURE_AD_CLIENT_SECRET=
AZURE_AD_TENANT_ID=
NEXTAUTH_URL= # canonical url of site
NEXTAUTH_SECRET= # generate random key - openssl rand -base64 32
About the Equine upload tool
Use upload-equines.js in ./devtools to populate the database with test data (requires SpringBoot api and Postgres to be running).
-
Ensure the api and postgres DB are running on the back-end
-
Run
npm install
to add the axios library (which simplifies making http requests in node) -
To run the script from the project's root folder, type
node devtools/upload-equines.js <"fields">
into the command line.fields
: Determines if the script populates the DB with skill, category, programme and yard entries. This has to be passed the first time.
On first instance, pass "fields" to the script to add the required data. (Note: The API might throw an error if the DB contains duplicate fields - just ignore it).
node devtools/upload-equines.js "fields"
Then run the script without any arguments to upload 100 equines:
node devtools/upload-equines.js