A modern, multilingual website built with Payload CMS and Next.js featuring internationalization (i18n) support. This application demonstrates how to implement localization in a Payload CMS website using the next-intl library.
- Tech Stack & Features
- Prerequisites
- Installation & Setup
- Database Seeding
- Available Scripts
- Localization
- Production Deployment
- Docker Support
- Documentation
- Framework: Next.js with Payload CMS
- Database: SQLite with Payload's SQLite adapter
- Email Service: Resend for contact forms and notifications
- Internationalization: Multi-language support with next-intl
- Styling: Tailwind CSS with responsive design
- UI Components: Modern components built with Radix UI
- Editor: Rich text editing with Lexical
- Search: Built-in search functionality
- SEO: SEO optimization with meta management
- Preview: Live preview capabilities
- Node.js 18.20.2+ or 20.9.0+
- pnpm (recommended) or npm
-
Clone and install dependencies:
pnpm install
-
Set up environment variables:
cp .env.example .env
Then edit the
.envfile with your specific values. Key variables include:PAYLOAD_SECRET: A secure secret key for Payload CMSNEXT_PUBLIC_SERVER_URL: Your application URL (http://localhost:3000 for development)RESEND_API_KEY: Your Resend API key for email functionality (optional)
-
Start the development server:
pnpm dev
-
Access the application:
- Frontend: http://localhost:3000
- Admin Panel: http://localhost:3000/admin
To populate your database with sample content:
- Navigate to the admin panel at http://localhost:3000/admin
- Click the "Seed Database" button in the dashboard
- This will create sample pages, posts, and a demo user
Demo User Credentials:
- Email:
[email protected] - Password:
password
Warning: Seeding is destructive and will replace all existing data. Only use on fresh installations or when you can afford to lose current data.
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLintpnpm lint:fix- Fix ESLint errorspnpm generate:types- Generate Payload types
This app supports multiple languages through next-intl. The seed script creates content in English and Turkish by default.
For detailed instructions on adding new languages, see ADDING_LANGUAGES.md
Quick overview to add more languages:
- Add translations in the admin panel
- Configure additional locales in the Payload config
- Add corresponding message files in
src/i18n/messages/
- Build the application:
pnpm build - Set production environment variables
- Start the production server:
pnpm start
A Docker configuration is included for containerized deployment:
docker-compose up