Out of the box, we support loading the data into a PostgreSQL database.
Note: You can always load it into another database, in which case, you need to modify the code to support your database. You can checkout:
git clone git@github.com:Acrylic125/fntu.git then cd scraper and pnpm i.Below we have some recommended ways to setup a PostgreSQL database.
| Method | Steps | |||
|---|---|---|---|---|
Refer to this Guide | ||||
For a local setup,
Your Optional, but we recommend setting up Docker Compose, with a mounted volume. Run | ||||
We will use Supabase to host the database without using their SDKs.
Once you are in the project, at the top of the nav bar, click
| ||||
Once cloned and you have a database ready, Copy .env.example and name it .env. Configure it based on the instructions in .env.
Example:
DATABASE_URL=postgresql://myuser:mysecretpassword@localhost:5432/fntu-db
First, push the schema to the database. You will need to do this if the table schemas ever change.
pnpm drizzle-kit push
RLS is required for every table in the schema. Annoyingly, everytime you do a push to the database, you need to enable RLS again. To do so:
SQL Editor in Supabase, paste the script and run it.Go Download the Data, unzip it, and put the unzipped download folder somewhere.
Then, run the insertion script.
pnpm run start insert /path/to/download