brand-ing / study-group-finder

0 stars 2 forks source link

Basic backend setup with demo & Devcontainers #5

Closed jjketten closed 4 weeks ago

jjketten commented 1 month ago

Needs someone to test

See installation steps for devcontainers here: https://code.visualstudio.com/docs/devcontainers/containers I am on Windows, so I am using WSL2 and then Docker Desktop with the WSL2 engine. Docker Desktop will need to be running before you open VSCode.

After this is done, open the backend folder with VSCode (not the root project folder) and it should prompt to "Reopen in Container" because of the .devcontainer folder that is present.

Once the container is built, use the Spring Boot Dashboard extension to try running the application. VSCode should automatically forward the appropiate ports to the local machine, so you can try visiting http://localhost:8080/test in your web browser to see if it is working.

Also implements #7

Environment variables: The devcontainer.env stores an environment variable called SECRET_LOCATION that specifies the location of secrets. The current directory it is set to, backend/secret/, has been added to gitignore. For the Firestore database, the secret is a JSON file that specifies which database to connect to and the authentication keys required. You must use console.firebase.google.com and go to Project Settings > Service Accounts > Generate new private key to obtain the file and rename it to serviceAccountKey.json