This is a Bun server using Elysia for the API and Drizzle ORM for a Postgres DB. It crawls data from https://dora-world.com/wallpaper and upload it to my personal Uploadthing directory.
- Install dependencies
bun install
- Start a Docker container for the Postgres database
docker run --name dev-postgres -p 5432:5432 -e POSTGRES_PASSWORD=12345678 -d postgres
- Add the
DATABASE_URL
env variable to a .env file
DATABASE_URL="postgresql://postgres:12345678@localhost:5432/postgres?schema=public"
UPLOADTHING_SECRET="YOUR_KEY_HERE"
UPLOADTHING_APP_ID="YOUR_KEY_HERE"
-
Add your tables to
src/db/schema/index.ts
. -
Generate migrations
bun run generate
- Run migrations
bun run migrate
- To start the development server run:
bun run dev
Open http://localhost:3000/ with your browser to see the result.