Skip to content

Commit a6af9aa

Browse files
authored
Merge branch 'main' into mslwang/LLSC-51-add-startup-logs
2 parents 653804a + cac206f commit a6af9aa

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ git clone https://github.com/uwblueprint/llsc.git
6464
cd llsc
6565
```
6666

67-
- Create a .env file in the root directory based on the .env.sample file. Update
67+
- Create a .env file in `./backend` and `./frontend` based on the .env.sample file. Update
6868
the environment variables as needed. Consult the [Secrets](#secrets) section
6969
for detailed instructions.
7070

7171
```bash
7272
cp .env.sample .env
7373
```
7474

75-
- Build and start the Docker containers
75+
- Build and start the Docker containers (in detached mode)
7676

7777
```bash
78-
docker-compose up --build
78+
docker-compose up -d
7979
```
8080

8181
- Install pdm (this is a global installation, so location doesn't matter)
@@ -85,6 +85,14 @@ brew install pdm
8585
```
8686
Otherwise, feel free to follow install instructions [here](https://pdm-project.org/latest/#installation)
8787

88+
- Install postgresql (this is for local development)
89+
On macOS:
90+
```bash
91+
brew install postgresql
92+
```
93+
Otherwise, feel free to follow install instructions [here](https://www.postgresql.org/download/)
94+
Note: you will need this for `psycopg2`, which requires a config file that is part of postgresql.
95+
8896
You will then need to go into each directory individually to install dependencies.
8997

9098
FastAPI backend

backend/app/server.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
from contextlib import asynccontextmanager
33
from typing import Union
44

5+
from backend.app.routes import send_email
6+
from dotenv import load_dotenv
57
from fastapi import FastAPI
68

7-
from . import models
8-
from .routes import send_email, user
9+
load_dotenv()
10+
11+
# we need to load env variables before initialization code runs
12+
from . import models # noqa: E402
13+
from .routes import user # noqa: E402
914
from .utilities.constants import LOGGER_NAME
10-
from .utilities.firebase_init import initialize_firebase
15+
from .utilities.firebase_init import initialize_firebase # noqa: E402
1116

1217
log = logging.getLogger(LOGGER_NAME("server"))
1318

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ services:
3636
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
3737
POSTGRES_DB: ${POSTGRES_DATABASE}
3838
healthcheck:
39-
test: ["CMD-SHELL", "pg_isready -U postgres"]
39+
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
4040
interval: 5s
4141
timeout: 5s
4242
retries: 5

0 commit comments

Comments
 (0)