Skip to content

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

pnpm dev

Open 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.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

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.

Local + Vercel database setup

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.

  1. Configure database environment variables:
    • Local: prepare .env and set DATABASE_URL to your local PostgreSQL.
    • Vercel: add DATABASE_URL in Project Settings -> Environment Variables.
    • Recommended for Neon/Vercel Postgres: also add DIRECT_URL (unpooled connection) for migration commands.
  2. Initialize a new database schema:
pnpm run db:migrate:deploy
  1. (Optional) seed default APP bookmarks/tags:
pnpm run seed:app-content
  1. If your database was already initialized before migrations (for example using db push), run one-time baseline:
pnpm run db:migrate:baseline

Notes:

  • db:migrate:deploy prefers DIRECT_URL when present; otherwise it uses DATABASE_URL.
  • On Vercel, set Build Command to pnpm run build:with-db-migrate so each deployment applies migrations first.
  • db:setup still exists as a local fast path (prisma db push) for prototyping.
  • db:init / db:import are for SQL backup workflows and require PostgreSQL client tools (psql/pg_dump), typically run on local machines or CI.

Database backup and sync

This project uses PostgreSQL (DATABASE_URL in .env).

  1. Export current database (schema + data):
pnpm run db:export

Optional custom output path:

pnpm run db:export -- backups/my-snapshot.sql
  1. Import backup on another machine:
pnpm run db:import -- backups/my-snapshot.sql

If the target database does not exist yet, create it and import in one step:

pnpm run db:init -- backups/my-snapshot.sql
  1. One-command roundtrip verification (export -> clear APP bookmarks/tags -> import -> count check):
pnpm run db:roundtrip-test

Optional custom backup path:

pnpm run db:roundtrip-test -- backups/roundtrip-check.sql

Seed default APP bookmarks and tags

Seed curated APP scope data for Chinese developers/designers/engineers/AI researchers:

pnpm run seed:app-content

Data 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:sql

Optional output path:

pnpm run seed:app-content:sql -- scripts/seed-data/my-seed.sql

Apply generated SQL:

pnpm exec prisma db execute --file scripts/seed-data/seed-app-content.generated.sql --schema prisma/schema.prisma

Notes:

  • db:import applies SQL generated by pg_dump to the database pointed by DATABASE_URL.
  • db:init first creates the database from DATABASE_URL (if missing), then imports the backup.
  • db:roundtrip-test validates export/import recovery for APP scope bookmarks + tags.
  • Install PostgreSQL client tools (pg_dump, psql) and ensure they are available in PATH.
  • If PATH is unavailable in your environment, you can set PG_DUMP_PATH / PSQL_PATH to absolute executable paths.

About

bookmark-lite

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages