Files
payload/templates/blank
Alessio Gravili 4458f74cef ci: template errors not being caught due. fix: error due to updated generated-types User type (#12973)
This PR consists of two separate changes. One change cannot pass CI
without the other, so both are included in this single PR.


## CI - ensure types are generated

Our website template is currently failing to build due to a type error.
This error was introduced by a change in our generated types.

Our CI did not catch this issue because it wasn't generating types /
import map before attempting to build the templates. This PR updates the
CI to generate types first.

It also updates some CI step names for improved clarity.

## Fix: type error

![Screenshot 2025-06-29 at 12 53
49@2x](https://github.com/user-attachments/assets/962f1513-bc6c-4e12-9b74-9b891c49900b)


This fixes the type error by ensuring we consistently use the _same_
generated `TypedUser` object within payload, instead of `BaseUser`.
Previously, we sometimes used the generated-types user and sometimes the
base user, which was causing type conflicts depending on what the
generated user type was.

It also deprecates the `User` type (which was essentially just
`BaseUser`), as consumers should use `TypedUser` instead. `TypedUser`
will automatically fall back to `BaseUser` if no generated types exists,
but will accept passing it a generated-types User.

Without this change, additional properties added to the user via
generated-types may cause the user object to not be accepted by
functions that only accept a `User` instead of a `TypedUser`, which is
what failed here.

## Templates: re-generate templates to update generated types

---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
  - https://app.asana.com/0/0/1210668927737258
2025-06-29 14:27:50 -07:00
..
2024-11-18 16:38:36 -05:00

Payload Blank Template

This template comes configured with the bare minimum to get started on anything you need.

Quick start

This template can be deployed directly from our Cloud hosting and it will setup MongoDB and cloud S3 object storage for media.

Quick Start - local setup

To spin up this template locally, follow these steps:

Clone

After you click the Deploy button above, you'll want to have standalone copy of this repo on your machine. If you've already cloned this repo, skip to Development.

Development

  1. First clone the repo if you have not done so already

  2. cd my-project && cp .env.example .env to copy the example environment variables. You'll need to add the MONGODB_URI from your Cloud project to your .env if you want to use S3 storage and the MongoDB database that was created for you.

  3. pnpm install && pnpm dev to install dependencies and start the dev server

  4. open http://localhost:3000 to open the app in your browser

That's it! Changes made in ./src will be reflected in your app. Follow the on-screen instructions to login and create your first admin user. Then check out Production once you're ready to build and serve your app, and Deployment when you're ready to go live.

Docker (Optional)

If you prefer to use Docker for local development instead of a local MongoDB instance, the provided docker-compose.yml file can be used.

To do so, follow these steps:

  • Modify the MONGODB_URI in your .env file to mongodb://127.0.0.1/<dbname>
  • Modify the docker-compose.yml file's MONGODB_URI to match the above <dbname>
  • Run docker-compose up to start the database, optionally pass -d to run in the background.

How it works

The Payload config is tailored specifically to the needs of most websites. It is pre-configured in the following ways:

Collections

See the Collections docs for details on how to extend this functionality.

  • Users (Authentication)

    Users are auth-enabled collections that have access to the admin panel.

    For additional help, see the official Auth Example or the Authentication docs.

  • Media

    This is the uploads enabled collection. It features pre-configured sizes, focal point and manual resizing to help you manage your pictures.

Docker

Alternatively, you can use Docker to spin up this template locally. To do so, follow these steps:

  1. Follow steps 1 and 2 from above, the docker-compose file will automatically use the .env file in your project root
  2. Next run docker-compose up
  3. Follow steps 4 and 5 from above to login and create your first admin user

That's it! The Docker instance will help you get up and running quickly while also standardizing the development environment across your teams.

Questions

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