This repository includes a Vite TypeScript frontend and a Rust backend connected to a Postgres database.
- /app # rust server (poem, async-std)
- /web # frontend (vite, react)There are multiple ways you can run the project.
If you wish to modify the backend ensure you have read the app/ section.
For running the frontend connected to production you can:
cd ./web && pnpm dev:prodFor local development, clone the repo, install dependencies, and follow these instructions:
- pnpm and node for the frontend
- Rust/cargo for running the backend in development
- Docker for running the database and Meilisearch
To run the backend in development mode, first set up the environment by copying the example .env file and modifying it to your liking.
cd ./app
# Setup .env file
cp .env.example .env
# Start docker (ensure you are in the `app` directory)
docker compose up -d
# Setup database (development-only)
cargo sqlx migrate run
cargo sqlx prepareThis spins up a postgres database & meilisearch instance & ensures the tables are up to date.
cargo runInstall dependencies using pnpm, then run the dev script.
cd ./web
pnpm install
pnpm devIf you wish to run the frontend connected to the production backend you can:
cd ./web
pnpm dev:prodThe typescript types in the frontend (schema.gen.ts) are generated automatically when the dev server is running.
If you wish to generate the types manually you can:
cd ./web
pnpm api-schema