Skip to content

Commit 324b2c8

Browse files
Merge pull request #116 from AustralianBioCommons/update-readme-for-local-db-guide
docs: add instructions on how to set up db locally
2 parents b615d28 + 5135473 commit 324b2c8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,37 @@ and run the migrations:
108108
uv run alembic upgrade head
109109
```
110110

111+
## Populating the Database on your Local Machine
112+
113+
You can populate your dev database with the users and memberships from the dev Auth0 tenant by running the sync tasks.
114+
115+
1. Remove the exisiting database (if it exists)
116+
117+
```bash
118+
cd aai-backend
119+
rm database.db
120+
```
121+
122+
2. Run the FastAPI app once to create the database
123+
124+
```bash
125+
uv run fastapi dev
126+
```
127+
128+
then hit `Ctrl + C` to exit
129+
130+
3. Sync Auth0 to local database
131+
132+
```bash
133+
uv run python run_scheduler.py --immediate
134+
```
135+
136+
4. Restart the backend service if needed
137+
138+
```bash
139+
uv run fastapi dev main.py
140+
```
141+
111142
# Job scheduler
112143

113144
We use the `apscheduler` library to schedule recurring jobs. Currently

0 commit comments

Comments
 (0)