Skip to content

AlessioGr/payload-template-bun

Repository files navigation

Payload Blank Template

A blank template for Payload and Bun - a faster alternative to Node.JS - to help you get up and running quickly.

Click on "Use this template" to get started by initializing a new repository from this template:

Screenshot 2024-01-03 at 21 20 46

Features of this template

  • Full compatibility with Bun
  • Fully-working Dockerfile which uses Bun to install, build and serve your project
  • Fully-configured, opinionated eslint and prettier configurations which are used inside of payload core and in my own projects
  • Optimal IntelliJ & VS Code run configs
  • Optimal tsconfig settings
  • New lexical-based richtext editor (Beta) enabled by default
  • Everything else is identical to the payload "blank" template, so you have a clean project to get started with

Development

To spin up the project locally, follow these steps:

  1. Make sure you have bun and node installed (there could be issues when trying to build the project if you only have bun and not node installed)
  2. Clone the repo
  3. Then cd YOUR_PROJECT_REPO && cp .env.example .env
  4. Next bun i && bun dev
  5. Now open http://localhost:3000/admin to access the admin panel
  6. Create your first admin user using the form on the page

That's it! Changes made in ./src will be reflected in your app.

Docker

This template comes with a Dockerfile which uses Bun to serve your project.

Production

To run Payload in production, you need to build and serve the Admin panel. To do so, follow these steps:

  1. First invoke the payload build script by running bun run build in your project root. This creates a ./build directory with a production-ready admin bundle and a ./dist directory.
  2. Then run bun serve to run Bun in production and serve Payload from the ./build directory.

Questions

If you have any issues or questions, reach out to us on Discord or start a GitHub discussion.

About

Payload x Bun starter template

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published