An open API service indexing awesome lists of open source software.

https://github.com/powerappsdarren/my-payload-app


https://github.com/powerappsdarren/my-payload-app

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# ๐Ÿš€ My Payload App

[![Payload CMS](https://img.shields.io/badge/Payload%20CMS-3.40.0-blue?style=flat-square)](https://payloadcms.com)
[![Next.js](https://img.shields.io/badge/Next.js-15.3.3-black?style=flat-square)](https://nextjs.org)
[![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?style=flat-square&logo=docker&logoColor=white)](https://docker.com)
[![MongoDB](https://img.shields.io/badge/MongoDB-7.0-47A248?style=flat-square&logo=mongodb&logoColor=white)](https://mongodb.com)

> ๐ŸŽฏ A modern, headless CMS built with Payload, Next.js, and Docker. Perfect for content management that doesn't get in your way!

## โœจ Features

- ๐ŸŽจ **Modern Admin Interface** - Beautiful, intuitive content management
- ๐Ÿ” **Authentication Ready** - User management out of the box
- ๐Ÿ“ **Rich Text Editor** - Powered by Lexical for amazing content creation
- ๐Ÿณ **Docker Compose** - One-command development environment
- ๐Ÿ—„๏ธ **MongoDB** - Flexible, scalable database with admin interface
- ๐Ÿ”’ **Secure by Default** - Environment variables and proper authentication
- โšก **TypeScript** - Full type safety throughout
- ๐ŸŽฏ **API First** - REST and GraphQL endpoints ready to go

## ๐Ÿ—๏ธ Tech Stack

| Technology | Purpose | Version |
|------------|---------|---------|
| ๐ŸŽฏ [Payload CMS](https://payloadcms.com) | Headless CMS | 3.40.0 |
| โšก [Next.js](https://nextjs.org) | React Framework | 15.3.3 |
| ๐Ÿณ [Docker](https://docker.com) | Containerization | Latest |
| ๐Ÿƒ [MongoDB](https://mongodb.com) | Database | 7.0 |
| ๐Ÿ“˜ [TypeScript](https://typescriptlang.org) | Type Safety | 5.6.3 |
| โš›๏ธ [React](https://reactjs.org) | UI Library | 19.0.0 |

## ๐Ÿš€ Quick Start

### Prerequisites
- ๐Ÿณ Docker & Docker Compose
- ๐Ÿ“ฆ Node.js 18+ (for local development)

### ๐ŸŽฌ Get Started in 3 Steps

```bash
# 1๏ธโƒฃ Clone and navigate
git clone
cd my-payload-app

# 2๏ธโƒฃ Fire up the engines! ๐Ÿš€
npm run docker:up

# 3๏ธโƒฃ Open your browser and enjoy! ๐ŸŽ‰
# http://localhost:3000
```

That's it! ๐ŸŽŠ Your CMS is ready to rock!

## ๐ŸŒ Available Services

| Service | URL | Description |
|---------|-----|-------------|
| ๐ŸŽฏ **Main App** | http://localhost:3000 | Your beautiful frontend |
| ๐Ÿ‘ค **Admin Panel** | http://localhost:3000/admin | Content management magic |
| ๐Ÿ—„๏ธ **Database Admin** | http://localhost:8081 | MongoDB management |
| ๐Ÿ”Œ **API Endpoint** | http://localhost:3000/api | REST & GraphQL APIs |

## ๐Ÿ”ง Development Commands

```bash
# ๐Ÿš€ Start everything (recommended)
npm run docker:up

# ๐Ÿ—๏ธ Rebuild and start
npm run docker:up:build

# ๐Ÿ›‘ Stop all services
npm run docker:down

# ๐Ÿ“‹ View logs
npm run docker:logs

# ๐Ÿ”„ Generate types (when config changes)
npm run generate:types

# ๐Ÿงน Lint your code
npm run lint
```

## ๐Ÿ“ Project Structure

```
my-payload-app/
โ”œโ”€โ”€ ๐ŸŽฏ payload.config.ts # Payload configuration
โ”œโ”€โ”€ ๐Ÿ”ง next.config.mjs # Next.js setup
โ”œโ”€โ”€ ๐Ÿณ docker-compose.yml # Docker services
โ”œโ”€โ”€ ๐Ÿ“ฆ package.json # Dependencies & scripts
โ”œโ”€โ”€ ๐Ÿ”’ .env # Environment variables
โ”œโ”€โ”€ ๐Ÿ“ payload-types.ts # Generated types
โ””โ”€โ”€ ๐Ÿ“‚ src/
โ””โ”€โ”€ ๐Ÿ“‚ app/
โ”œโ”€โ”€ ๐Ÿ  layout.tsx # Root layout
โ”œโ”€โ”€ ๐Ÿ“„ page.tsx # Home page
โ”œโ”€โ”€ ๐Ÿ”Œ api/ # API routes
โ””โ”€โ”€ ๐Ÿ‘ค (payload)/ # Admin interface
```

## ๐ŸŽจ Collections

### ๐Ÿ‘ฅ Users
- ๐Ÿ” Authentication enabled
- ๐Ÿ“ง Email-based login
- ๐Ÿ›ก๏ธ Role-based permissions

### ๐Ÿ“„ Pages
- ๐Ÿ“ Rich text content with Lexical editor
- ๐Ÿท๏ธ Title and content fields
- ๐ŸŽฏ Perfect for websites and blogs

## ๐Ÿ”’ Environment Variables

Create your `.env` file (check `.env.example` for reference):

```bash
# ๐Ÿ—„๏ธ Database
DATABASE_URI=mongodb://mongodb:27017/payload-app

# ๐Ÿ” Security
PAYLOAD_SECRET=your-super-secret-key

# ๐ŸŒ App
NEXT_PUBLIC_SERVER_URL=http://localhost:3000
```

## ๐Ÿณ Docker Services

| Service | Purpose | Port |
|---------|---------|------|
| ๐ŸŽฏ **app** | Next.js + Payload | 3000 |
| ๐Ÿƒ **mongodb** | Database | 27017 |
| ๐Ÿ–ฅ๏ธ **mongo-express** | DB Admin UI | 8081 |

## ๐Ÿ”ง Customization

### Adding New Collections

1. ๐Ÿ“ Edit `payload.config.ts`
2. ๐Ÿ”„ Run `npm run generate:types`
3. ๐Ÿš€ Restart with `npm run docker:up:build`

### Custom Fields & Components

Check out the [Payload documentation](https://payloadcms.com/docs) for:
- ๐ŸŽจ Custom field types
- ๐Ÿงฉ Custom components
- ๐ŸŽฃ Hooks and lifecycle events
- ๐Ÿ”Œ Plugin development

## ๐Ÿšจ Troubleshooting

### ๐Ÿ› Common Issues

**Admin panel shows config error?**
```bash
# Try rebuilding
npm run docker:down
npm run docker:up:build
```

**Database connection issues?**
```bash
# Check if MongoDB is running
docker ps
# Restart services
npm run docker:down && npm run docker:up
```

**Port conflicts?**
- ๐ŸŽฏ App: Change port 3000 in docker-compose.yml
- ๐Ÿƒ MongoDB: Change port 27017
- ๐Ÿ–ฅ๏ธ Mongo Express: Change port 8081

## ๐Ÿ”„ Staying Updated

### ๐Ÿ“ฆ Check for Updates
```bash
# See available updates
npm outdated

# Check specific Payload packages
npm outdated payload @payloadcms/next @payloadcms/db-mongodb
```

### ๐Ÿš€ Update Payload
```bash
# Update all Payload packages
npm update payload @payloadcms/next @payloadcms/db-mongodb @payloadcms/richtext-lexical

# Update to latest stable
npm install payload@latest

# After updates, always regenerate types!
npm run generate:types
npm run docker:up:build
```

### ๐Ÿ”” Stay Informed
- โญ [Star Payload on GitHub](https://github.com/payloadcms/payload) for release notifications
- ๐Ÿ“– Follow the [Payload Blog](https://payloadcms.com/blog) for major updates
- ๐Ÿ’ฌ Join [Discord Community](https://discord.com/invite/payload) for discussions
- ๐Ÿฆ Follow [@payloadcms](https://twitter.com/payloadcms) on Twitter

### โš ๏ธ Update Best Practices
```bash
# 1. Create update branch
git checkout -b update-payload

# 2. Update and test
npm update payload
npm run docker:up:build

# 3. Test admin panel & API endpoints

# 4. If all good, merge
git checkout main && git merge update-payload
```

> ๐Ÿ’ก **Pro Tip**: Always read release notes for breaking changes before major updates!

## ๐Ÿค Contributing

1. ๐Ÿด Fork the repo
2. ๐ŸŒŸ Create your feature branch
3. โœจ Make your changes
4. ๐Ÿงช Test everything works
5. ๐Ÿš€ Submit a pull request

## ๐Ÿ“š Resources

- ๐Ÿ“– [Payload CMS Docs](https://payloadcms.com/docs)
- โšก [Next.js Documentation](https://nextjs.org/docs)
- ๐Ÿณ [Docker Documentation](https://docs.docker.com)
- ๐Ÿƒ [MongoDB Documentation](https://docs.mongodb.com)

## ๐Ÿ“„ License

MIT License - feel free to use this for your awesome projects! ๐ŸŽ‰

---

**Made with โค๏ธ and lots of โ˜•**

*Happy coding! ๐Ÿš€*