A modern web application for discovering and exploring Islamic literature, built with Next.js 15 and PayloadCMS.
- π Book Library: Browse and search through a comprehensive collection of Islamic books
- βοΈ Author Profiles: Explore detailed author pages
- π Smart Search: Powerful search functionality for books and authors
- π¨ Modern UI: Built with Tailwind CSS and Radix UI components
- π Dark Mode: Theme switching with next-themes
- β‘ Fast Performance: Powered by Next.js 15 with Turbopack
- π Content Management: Admin panel powered by PayloadCMS
- βοΈ Cloud Storage: S3-compatible storage integration
- Framework: Next.js 15 with App Router
- React: React 19
- Styling: Tailwind CSS 4
- UI Components: shadcn/ui + Radix UI
- Icons: Lucide React
- Animations: react-type-animation
- CMS: PayloadCMS 3
- Database: PostgreSQL (via Supabase)
- Storage: S3-compatible storage (AWS S3)
- Rich Text Editor: Lexical Editor
- GraphQL: Built-in GraphQL API
- Language: TypeScript
- Package Manager: pnpm
- Linting: ESLint 9
- Image Processing: Sharp
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- pnpm (v8 or higher)
- PostgreSQL database (or Supabase account)
- S3-compatible storage (AWS S3, Cloudflare R2, etc.)
git clone https://github.com/yasiralamriki/sunnahreads.git
cd sunnahreadspnpm installCreate a .env.local file in the root directory with the following variables:
# Database
DATABASE_URI=postgresql://user:password@host:port/database
# Payload CMS
PAYLOAD_SECRET=your-secret-key-here
PAYLOAD_PUBLIC_SERVER_URL=/
# S3 Storage
S3_ENDPOINT=https://your-s3-endpoint.com
S3_REGION=auto
S3_ACCESS_KEY_ID=your-access-key
S3_SECRET_ACCESS_KEY=your-secret-key
S3_BUCKET=your-bucket-namepnpm devOpen http://localhost:3000 in your browser to see the application.
Navigate to http://localhost:3000/admin to access the PayloadCMS admin interface.
sunnahreads/
βββ public/ # Static assets
βββ src/
β βββ app/ # Next.js App Router
β β βββ (app)/ # Public-facing pages
β β β βββ page.tsx # Home page
β β β βββ books/ # Books listing
β β β βββ book/[slug]/ # Individual book pages
β β β βββ authors/ # Authors listing
β β β βββ author/[slug]/ # Individual author pages
β β βββ (payload)/ # PayloadCMS admin
β β βββ admin/ # Admin interface
β β βββ api/ # API routes
β βββ collections/ # PayloadCMS collections
β β βββ Authors.ts
β β βββ Books.ts
β β βββ Media.ts
β β βββ Users.ts
β βββ components/ # React components
β β βββ home/
β β βββ navbar/
β β βββ ui/ # Reusable UI components
β βββ lib/ # Utility functions
β βββ payload.config.ts # PayloadCMS configuration
β βββ index.css # Global styles
βββ components.json # shadcn/ui configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ package.json
- Title, author
- Cover images
- Name
- Image and file uploads
- S3 storage integration
- Automatic optimization
- Admin authentication
- Role-based access control
# Development with Turbopack
pnpm dev
# Production build
pnpm build
# Start production server
pnpm start
# Run linter
pnpm lintThis project uses shadcn/ui components. To add new components:
npx shadcn-ui@latest add [component-name]Edit collection files in src/collections/ to customize the data structure for your needs.
- Global styles:
src/index.css - Tailwind configuration:
tailwind.config.js - Component styles: Use Tailwind utility classes
- Push your code to GitHub
- Import the repository in Replit
- Configure environment variables
- Deploy
Build the production bundle:
pnpm buildStart the production server:
pnpm startMake sure to set all required environment variables on your hosting platform.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- PayloadCMS for the excellent headless CMS
- Next.js for the powerful React framework
Yasir Alamriki - @yasiralamriki
Project Link: https://github.com/yasiralamriki/sunnahreads