We need to install a few programs before we can get started. Here are the links to all the programs required:
- Node JS - click yes if it asks you to install
- Docker - To run the containerised database
- Git
- VS Code - recommended IDE
- If you have PGAdmin installed, it can cause problems, troubleshooting information below
- Install all required programs
- Open a terminal and navigate to where you would like to save the files, using the command
cd "{directory where you want to save the files}"
- Clone the repository using
git clone https://github.com/UoaWDCC/auis-portal.git
- Navigate to correct directory by typing
cd auis-portal
(we will require four terminals open in this directory, for the rest of this guide I will label them Terminal 1-4) - Create a file with the name exactly of ".env" within the API folder and copy the contents from the #resources channel on the discord server. DO NOT SHARE ANY OF THE INFORMATION ON THIS FILE PUBLICALLY
- Create a file with the name exactly of ".env" within the web folder and copy the contents from the #resources channel on the discord server. DO NOT SHARE ANY OF THE INFORMATION ON THIS FILE PUBLICALLY
- Create a file with the name exactly of ".env" within the strapi folder and copy the contents from the #resources channel on the discord server. DO NOT SHARE ANY OF THE INFORMATION ON THIS FILE PUBLICALLY
- Open Docker
- In Terminal 1 run the following commands
cd database
,docker compose up
this will turn on the docker container. In Docker you should be able to see the container running. - In Terminal 2 run the following commands
cd strapi
,yarn
,yarn develop
then click the link in terminal to go to the strapi page - Create an account, this is local, so don't need to worry too much. REMEBER THE EMAIL AND PASSWORD OR YOU WILL LOOSE ACCESS TO CMS LOCALLY. Next time you run it, you can use it to login locally. You can now add data and remove data from the CMS, add types and make other modifications
- On Strapi, click "Settings" on the sidebar, click "Roles" under "User & Permission Plugin" under "Authenticated" click the edit button and enable the permission required. This allows the admin user that you are logged in as, to make modifications to those certain areas. This needs to be done everytime a new account is created or a new field is added - this is mostly relevant to the backend team
- In Terminal 3 run the following commands
cd api
,yarn
,yarn db:generate
,yarn db:migrate
,yarn db
,yarn db:seed
. If you want to visualise the data runyarn db:visualise
if not, you can just runyarn dev
to start the backend server. If you have added new types to the backend and want them to be autogenerated in the frontend then runyarn watch-types
. You don't need to run all commands when you are running the backend a second time, unless changes have been made, but there is no harm in running all again, if you are unsure what everything does. More detailed explanation in the README.md file within the API folder if you are curious. - In Terminal 4 run
cd web
,yarn
,yarn dev
. If you want to run the tests then runyarn test
Troubleshooting
If you get an error along the lines of "Incorrect Password when connecting to the database". It is caused by the port 5432 being in use. Either uninstall PGAdmin, and restart to fix that. Or change the port mapping for your computer. Within the database folder, the docker-compose.yaml file, change line 12 to say - 5435:5432
and then go through all '.env' files and update anywhere that says 'PORT:5432' to 'PORT:5435'.
On VS Code install the extensions: TailwindCSS Intellisense, and Biome
- Harsheel
- Emma
- Karmveer
- Nick
- Devesh
- Chalisa
- Tarun
- Diya
- Gury
- Sai Kiran
- Naren