This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
pnpm devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
This project supports both local deployment and Vercel deployment with Prisma migrations.
You can keep multiple backup env files with any names you prefer, and switch by updating .env to the target values.
- Configure database environment variables:
- Local: prepare
.envand setDATABASE_URLto your local PostgreSQL. - Vercel: add
DATABASE_URLin Project Settings -> Environment Variables. - Recommended for Neon/Vercel Postgres: also add
DIRECT_URL(unpooled connection) for migration commands.
- Local: prepare
- Initialize a new database schema:
pnpm run db:migrate:deploy- (Optional) seed default APP bookmarks/tags:
pnpm run seed:app-content- If your database was already initialized before migrations (for example using
db push), run one-time baseline:
pnpm run db:migrate:baselineNotes:
db:migrate:deployprefersDIRECT_URLwhen present; otherwise it usesDATABASE_URL.- On Vercel, set Build Command to
pnpm run build:with-db-migrateso each deployment applies migrations first. db:setupstill exists as a local fast path (prisma db push) for prototyping.db:init/db:importare for SQL backup workflows and require PostgreSQL client tools (psql/pg_dump), typically run on local machines or CI.
This project uses PostgreSQL (DATABASE_URL in .env).
- Export current database (schema + data):
pnpm run db:exportOptional custom output path:
pnpm run db:export -- backups/my-snapshot.sql- Import backup on another machine:
pnpm run db:import -- backups/my-snapshot.sqlIf the target database does not exist yet, create it and import in one step:
pnpm run db:init -- backups/my-snapshot.sql- One-command roundtrip verification (export -> clear APP bookmarks/tags -> import -> count check):
pnpm run db:roundtrip-testOptional custom backup path:
pnpm run db:roundtrip-test -- backups/roundtrip-check.sqlSeed curated APP scope data for Chinese developers/designers/engineers/AI researchers:
pnpm run seed:app-contentData and logic are separated:
- Data file:
scripts/seed-data/app-initial-content.mjs(10 tags + 150 real URLs) - Seeder logic:
scripts/seed-data/seed-app-content.mjs
Generate equivalent SQL from the same seed data:
pnpm run seed:app-content:sqlOptional output path:
pnpm run seed:app-content:sql -- scripts/seed-data/my-seed.sqlApply generated SQL:
pnpm exec prisma db execute --file scripts/seed-data/seed-app-content.generated.sql --schema prisma/schema.prismaNotes:
db:importapplies SQL generated bypg_dumpto the database pointed byDATABASE_URL.db:initfirst creates the database fromDATABASE_URL(if missing), then imports the backup.db:roundtrip-testvalidates export/import recovery forAPPscope bookmarks + tags.- Install PostgreSQL client tools (
pg_dump,psql) and ensure they are available inPATH. - If
PATHis unavailable in your environment, you can setPG_DUMP_PATH/PSQL_PATHto absolute executable paths.