This repository stores the code used for roryashfordbentley.dev.
The site is built using Next.js as its underlying React framework.
The site uses PayloadCMS as its CMS
The site deploys to Vercel. IMPORTANT: it's only possible to use PNPM to install Sharp successfully on Vercel
The site Database engine is MongoDB.
The site requires that the user has mongodb-database-tools installed locally to migrate the database between local and remote server environments.
Clone this repository:
git clone git@github.com:roryashfordbentley/rab-website-cms.dev.gitInstall dependencies
cd app
pnpm installRun local development environment
pnpm run devAll commands are run from the root of the project, from a terminal:
| Command | Action |
|---|---|
pnpm install |
Installs dependencies |
pnpm run dev |
Starts local dev server at localhost:4321 |
pnpm run dev-storybook |
Runs local dev server and storybook instance |
pnpm run build |
Runs a Next build |
pnpm run create-component [NAME] |
Scaffolds a new component with stories and css |
pnpm run create-block [NAME] |
Scaffolds a new block with stories and css |
To move the database from local to remote server, or visa-versa the following commands can be used.
mongodump --uri="mongodb://127.0.0.1:27017/<local_database_name>" --out ~/Desktop/mongodb-backupmongorestore --uri="mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<database_name>" ~/Desktop/mongodb-backup/<database_name> --dropmongodump --uri="mongodb+srv://<username>:<password>@<host>/<remote_database_name>" --out ~/Desktop/mongodb-backupmongorestore --uri="mongodb://127.0.0.1:27017/<local_database_name>" ~/Desktop/mongodb-backup/<local_database_name> --drop