https://github.com/powerappsdarren/my-payload-app
https://github.com/powerappsdarren/my-payload-app
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/powerappsdarren/my-payload-app
- Owner: PowerAppsDarren
- Created: 2025-05-31T23:49:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-01T00:31:11.000Z (about 1 year ago)
- Last Synced: 2025-06-01T10:20:40.389Z (about 1 year ago)
- Language: TypeScript
- Size: 65.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ My Payload App
[](https://payloadcms.com)
[](https://nextjs.org)
[](https://docker.com)
[](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! ๐*