FERN
- Firebase
- Express
- React
- Nextjs
- install node v21.6.2 (or >= v14.17.3)
- install yarn
- in ./api run yarn, then yarn build, then yarn dev (local host backend)
- in ./web run yarn, then yarn build, then yarn dev (local host frontend)
- One Branch per Task
- Name branch VOL-<task_number>/what-is-being-done, e.g. VLT-001/add-user-authentication
-
Create a new repository with UoAWDCC as owner
-
Select repository template as
UoAWDCC/react-template
-
Clone the app to your local machine
-
In
/api/fly.production.toml
change the app name towdcc-app-name-api
. For example, passport will bewdcc-passport-api
Then create the app on fly with this command:PS C:\Users\alexw\OneDrive\Documents\GitHub\UoAWDCC\passport> fly apps create --name wdcc-passport-api --org wdcc-projects New app created: wdcc-passport-api
-
In the
/api
directory runPS C:\Users\alexw\OneDrive\Documents\GitHub\UoAWDCC\passport\api> fly tokens create deploy --config fly.production.toml FlyV1 ...IFIc=
- Copy the output to your clipboard
- Go to repository settings on Github
- In secrets and variables select actions
- Create a new repository secret
- Name it
FLY_API_PRODUCTION_API_TOKEN
and paste in the secret
-
In
/api/fly.staging.toml
change the app name towdcc-app-name-api-staging
Then create the app on fly with this commandPS C:\Users\alexw\OneDrive\Documents\GitHub\UoAWDCC\passport> fly apps create --name wdcc-passport-api-staging --org wdcc-projects New app created: wdcc-passport-api-staging
-
In the
/api
directory runPS C:\Users\alexw\OneDrive\Documents\GitHub\UoAWDCC\passport\api> fly tokens create deploy --config fly.staging.toml FlyV1 ...IFIc=
- Copy the output to your clipboard
- Go to repository settings on Github
- In secrets and variables select actions
- Create a new repository secret
- Name it
FLY_API_STAGING_API_TOKEN
and paste in the secret
-
In
/web/Dockerfile.production
changeENV VITE_API_URL="https://react-template-api.fly.dev"
to
ENV VITE_API_URL="https://wdcc-app-name-api.fly.dev"
(change it to to the name of your production api app that you just created before
-
In
/web/Dockerfile.staging
changeENV VITE_API_URL="https://react-template-api-staging.fly.dev"
to
ENV VITE_API_URL="https://wdcc-app-name-api-staging.fly.dev"
(change it to to the name of your staging api app that you just created before
-
In
/web/fly.production.toml
change the name of the app towdcc-app-name
and runfly apps create --name wdcc-app-name --org wdcc-projects
-
Now run
fly tokens create deploy --config fly.production.toml
and save that as a Github repository secret with the nameFLY_WEB_PRODUCTION_API_TOKEN
-
In
/web/fly.staging.toml
change the name of the app towdcc-app-name-staging
and runfly apps create --name wdcc-app-name-staging --org wdcc-projects
-
Now run
fly tokens create deploy --config fly.staging.toml
and save that as a Github repository secret with the nameFLY_WEB_STAGING_API_TOKEN