We use pnpm
to manage this monorepo.
To set the repository up:
Steps | Command |
---|---|
1. Install Node.js, using the latest LTS | - |
2. Install pnpm | npm i -g pnpm |
3. Install dependencies under the project root | pnpm i |
Package is located at packages/animegarden
.
# Build project
pnpm -C packages/animegarden build
# Run test
pnpm -C packages/animegarden test
Package is located at packages/app
.
This package is built on the Astro.
# Build app
pnpm -C packages/app build
# Start dev server
pnpm -C packages/app dev
Make sure you have setup the environment.
pnpm animegarden fetch dmhy --output output/dmhy
pnpm animegarden fetch moe --output output/moe
These two commands will fetch data from the remote and write to files in the dir output/dmhy
and output/moe
.
Fetching all the data usually takes several hours. You can use the --from <page>
and --to <page>
arguments to specify the fetching range.
Start dev postgres, meilisearch and redis with docker-compose.yml
docker compose --file=docker-compose.dev.yml up
Then migrate the dev postgres database and meilisearch.
pnpm animegarden db migrate --uri "postgres://root:[email protected]:5432/animegarden"
pnpm animegarden meili migrate --meili-url "http://0.0.0.0:7700" --meili-key "example"
Then insert the data to the database.
pnpm animegarden db insert dmhy output/dmhy \
--uri "postgres://root:[email protected]:5432/animegarden" \
--meili-url "http://0.0.0.0:7700" --meili-key "example"
pnpm animegarden db insert moe output/moe \
--uri "postgres://root:[email protected]:5432/animegarden" \
--meili-url "http://0.0.0.0:7700" --meili-key "example"