A monorepo for Raffles Interact's administrative application.
Built with:
(+ Minio, TypeOrm, and more...)
Ensure that you have the docker daemon running, along with bun
, make
and docker
installed in the CLI.
Clone with git clone https://github.com/raffles-interact/interapp.git
Obtain both files (containing secret keys and the like) interapp-backend/.env.local
and interapp-frontend/.env.local
from the current set of maintainers.
-
Put in both secret files
.env.local
in both theinterapp-backend
andinterapp-frontend
directories. Note that they are different files. -
Install packages in both the
interapp-backend
andinterapp-frontend
directories (do not install in the root directory). Note that these 2 directories act as different project folders and are only unified during the build process with docker. -
Set up the dev server with
make build && make run
. Go onto the website and create an account with any username and id you want. Note down this username. -
Run
docker exec -it interapp-postgres sh
(you should see ‘/ #’ pop up) to enter into a interactive shell after the containers are up. RunPGPASSWORD=postgres psql -U postgres -d interapp
and then run the queryINSERT INTO "user_permission" ('username', 'permission_id', 'userUsername') VALUES ('<username>', 6, '<username>')
to give yourself admin permissions. Exit the interactive shell afterwards.
Run make build
and make run
for the development server.
If you'd like HMR on the backend/scheduler, use make watch
instead of make run
to use docker compose watch functionality, but this may take additional resources. If you are working on the frontend, make run
is just fine.
If needed, add version=(test|prod)
for test and production servers respectively, eg. make build version=test
Go to localhost:3000
for frontend and localhost:3000/api
for api routes
Put in both secret files .env.local
in both the interapp-backend
and interapp-frontend
directories. Note that they are different files, which contain sensitive information that should not be shared. Ask the maintainers how to do this if unsure.
-
If you're just testing the UI/frontend, just have
docker
installed in your terminal and have Docker desktop running. You can install docker here. -
Download the ZIP file (Scroll to the green button 'Code' > 'Local' tab > Download ZIP) and unzip it in your directory of choice.
-
Right click the folder which you unzipped and copy its path (the location where the folder is stored at). Open a new terminal (command prompt on windows/terminal on Mac), and type
cd <path-to-the-directory-which-you-copied>
. -
Verify docker is installed with
docker -v
(If the terminal saysdocker
is not recognised, try reopening another terminal, failing which, restart your computer) and ensure that you have docker desktop open (important!). -
Run
docker compose -f docker-compose.prod.yml up --build -d
. -
Verify the containers are running by going to docker desktop and ensuring all container icons are green.
-
Go to
localhost:3000
on your browser, and verify that you can see the site. -
For contributing, see CONTRIBUTING.md
thank you for coming here :kekw: