Skip to content

code0-tech/cygnus

Repository files navigation

Next.js Standalone Start

npm run build automatically prepares standalone assets via postbuild (.next/static and public are copied into .next/standalone).

Database migrations

If you connect the project to a fresh or different Postgres database, run the Payload migrations before building or starting the standalone server.

Check migration status:

npm run migrate:status

Apply all pending migrations:

npm run migrate

Create a new migration after schema/config changes:

npm run migrate:create your-migration-name

Notes:

  • npm run dev can be more forgiving during development, but npm run standalone expects the Payload tables to exist.
  • /admin requires the Payload auth tables such as users to exist.
  • Run migrations against the same database that is configured in DATABASE_URL.

1) Build

After the database schema exists, build the app:

npm run build

2) Start the standalone server

npm run standalone

Recommended order for a fresh database:

npm run migrate
npm run build
npm run standalone

Data Export

Exports all import/export-enabled Payload collections as JSON files into Export/.

npm run export-data

Notes:

  • The script requires a valid Payload user.
  • The script loads environment variables from your Next.js .env files.
  • Existing JSON files in export/ are overwritten.

Data Import

Imports all *.json files from export/ into the matching Payload collections.

npm run import-data

Optional: import with a specific Payload user

$env:PAYLOAD_IMPORT_USER_EMAIL="you@example.com"
npm run import-data

Notes:

  • The database schema / tables must already exist before running the import.
  • Run npm run migrate first if the target database is still empty.
  • The script uses upsert with matchField: "id".
  • If a document with the same id already exists, it is updated.
  • If no document with that id exists, it is created.
  • Existing documents with different IDs remain untouched.
  • JSON files without a matching import-enabled collection are skipped.

Releases

No releases published

Packages

 
 
 

Contributors

Languages