Full Setup
For more information about the details of each component, refer to each individual page:
This guide only contains the preliminary steps to get the WebApp running locally. Further configuration like Discord support etc. are not covered here.
Prerequisites
Ensure the following prerequisites are installed first:
-
Entity framework CLI
dotnet tool install --global dotnet-ef
Additionally, setup Firebase as instructed in the developer guide.
Steps
First, we have to setup the database first.
- Create a database locally with
<name> -
Clone the backend repository
git clone https://github.com/nushackers/hnr-api.git -
Change to project directory
cd hnr-api/ -
Migrate the database to create all tables
DATABASE_URL=postgres://postgres:root@localhost:5432/<name> dotnet ef database update
Then, setup the backend.
-
Create
.envwith the following minimal variables:DATABASE_URL=postgres://postgres:root@localhost:5432/<name> # Project name when setting up Firebase FIREBASE_PROJECT_ID= -
Load
.envto the terminalexport $(cat .env | xargs) -
Edit the
launchSettings.json’sDATABASE_URLfield to have the same value as the one supplied in the.envfile -
Start the backend
dotnet run
The backend will run on localhost:5134 by default. To change this, modify the launchSettings.json file under the applicationUrl property.
Finally, setup the frontend.
-
Return to home directory
cd ../ -
Clone the frontend repository
git clone https://github.com/nushackers/hnr-frontend.git -
Change to project directory
cd hnr-frontend/ -
Install dependencies
yarn install -
Setup
.envwith relevant details, refer to this section for the fields neededThe key fields needed will be
NEXT_PUBLIC_FIREBASE_API_KEY,NEXT_PUBLIC_FIREBASE_PROJECT_ID, andNEXT_PUBLIC_FIREBASE_APP_IDThe values of
NEXT_PUBLIC_API_URLandNEXT_PUBLIC_FLAGS_URLshould both be blank as well. -
Start the frontend
yarn devyarn devmust be used to setNODE_ENVtodevelopment. Otherwise, the frontend will try using production values instead.
Lastly, validate the setup by visiting localhost:3000/register and attempting to create a new account. If all goes well, you should be able to view the newly created account in Firebase and a new database entry should be found under the "Users" table of the database after you fill in your details for setting up.