Skip to content

globalbibletools/platform

Repository files navigation

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

Docker

Both the database and dev server can be run from a docker container using the command:

docker compose up

If you have added new node_modules, you need to run:

docker compose up --build

To reset the database and rebuild from scratch, run:

docker compose down
docker volume rm platform_db-data
docker compose up

To get a shell in a container run:

docker exec -it [platform-db-1|platform-server-1] [bash|sh]

Database

Set up database

If you are running these from the db container, you can use an absolute URL (/db/data.dump) because the db directory is mounted at the root of the container.

Restore the database schema:

psql DATABASE_URL db/schema.sql

Restore the database seed data:

pg_restore -Fc --format=custom --dbname=DATABASE_URL db/data.dump

Export the latest database schema:

pg_dump --no-owner --schema-only DATABASE_URL > db/schema.sql

Export the latest database seed data:

pg_dump -Fc --data-only DATABASE_URL > db/data.dump

Migrations

Migrations are stored in db/migrations in order. The files are named with a timestamp and a description. We will run these manually in production as needed.

psql DATABASE_URL -f db/migrations/{migration}.sql

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun 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 Inter, a custom Google Font.

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.