A modern, full-featured forum application built with Next.js 15
Featuring user authentication, post management, file uploads, and real-time interactions
π Live Website β’ π Documentation β’ π Report Bug β’ β¨ Request Feature
Secure authentication with multiple providers and comprehensive user profiles
| Feature | Description |
|---|---|
| π NextAuth.js Integration | Secure authentication with multiple providers |
| π Google OAuth | Social login support |
| π€ User Profiles | Customizable user profiles with avatars |
| π Password Management | Forgot password and reset functionality |
| π― Username Generation | Automatic username generation from names/emails |
Rich content creation and management system
| Feature | Description |
|---|---|
| βοΈ Post Creation | Rich text posts with categories |
| π Category System | Organized discussion categories |
| π¬ Comment System | Nested comments with replies |
| π Search Functionality | Full-text search across posts |
| π Pagination | Efficient content loading |
Built with shadcn/ui and Radix UI for exceptional user experience
| Feature | Description |
|---|---|
| π± Responsive Design | Mobile-first responsive layout |
| π Dark/Light Mode | Theme switching with system preference detection |
| π shadcn/ui Components | Beautiful, accessible UI components |
| βΏ Accessibility | WCAG compliant components |
| β‘ Loading States | Smooth loading animations |
Scalable file storage and management
| Feature | Description |
|---|---|
| βοΈ Cloudflare R2 Storage | Scalable file storage |
| π€ File Upload | Drag & drop file uploads |
| πΌοΈ Image Optimization | Automatic image optimization |
| π CDN Integration | Custom domain support for assets |
Enterprise-level security and validation
| Feature | Description |
|---|---|
| β Zod Validation | Comprehensive input validation |
| π‘οΈ API Security | CORS protection and origin validation |
| π Environment Validation | Secure environment variable handling |
| π― Type Safety | Full TypeScript support |
Optimized for search engines and performance
| Feature | Description |
|---|---|
| π SEO Optimization | Meta tags, structured data, sitemaps |
| β‘ Performance | Optimized images and code splitting |
| π Analytics Ready | Google Analytics integration ready |
| π± Social Sharing | Open Graph and Twitter Card support |
- Node.js 18+
- PostgreSQL database
- Cloudflare R2 account (for file storage)
- SMTP email service (Gmail, SendGrid, etc.)
# Clone the repository
git clone https://github.com/FakeErrorX/errorx-forum.git
cd errorx-forum
# Install dependencies
npm install
# or
yarn install
# or
pnpm installCreate a .env file in the root directory:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/errorx_forum"
# NextAuth.js
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key-here"
# Google OAuth (optional)
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
# Site Configuration
SITE_URL="http://localhost:3000"
SITE_NAME="ErrorX Forum"
SITE_DESCRIPTION="A modern forum for developers and tech enthusiasts"
# Social Media URLs
TWITTER_HANDLE="@FakeErrorX"
TWITTER_SITE="@FakeErrorX"
TWITTER_URL="https://twitter.com/FakeErrorX"
GITHUB_URL="https://github.com/FakeErrorX"
TELEGRAM_URL="https://t.me/ErrorX_BD"
FACEBOOK_URL="https://facebook.com/ErrorX.GG"
# Cloudflare R2 Storage
S3_REGION="auto"
S3_ENDPOINT="https://your-account-id.r2.cloudflarestorage.com"
S3_ACCESS_KEY="your-access-key"
S3_SECRET_KEY="your-secret-key"
S3_BUCKET_NAME="your-bucket-name"
S3_BUCKET_URL="https://your-custom-domain.com"
# API Security
ALLOWED_ORIGINS="http://localhost:3000,https://yourdomain.com"
# Development Configuration
LOCALHOST_PORT="3000"
# Email Configuration (SMTP)
SMTP_HOST="smtp.gmail.com"
SMTP_PORT="587"
SMTP_SECURE="false"
SMTP_USER="your-email@gmail.com"
SMTP_PASS="your-app-password"
SMTP_FROM="ErrorX Community <noreply@yourdomain.com>"# Generate Prisma client
npx prisma generate
# Run database migrations
npx prisma db push
# (Optional) Seed the database
npx prisma db seednpm run dev
# or
yarn dev
# or
pnpm devπ Open http://localhost:3000 to view the application!
errorx-forum/
βββ π app/ # Next.js App Router
β βββ π api/ # API routes
β β βββ π auth/ # Authentication endpoints
β β βββ π posts/ # Post management
β β βββ π users/ # User management
β β βββ π files/ # File upload endpoints
β βββ π create-post/ # Post creation page
β βββ π profile/ # User profile pages
β βββ π settings/ # User settings
β βββ π signin/ # Authentication pages
βββ π components/ # React components
β βββ π ui/ # shadcn/ui components
β βββ π layout/ # Layout components
β βββ π seo/ # SEO components
βββ π lib/ # Utility libraries
β βββ π auth.ts # Authentication configuration
β βββ π prisma.ts # Database client
β βββ π validations.ts # Zod validation schemas
β βββ π s3.ts # File storage utilities
βββ π hooks/ # Custom React hooks
βββ π prisma/ # Database schema
βββ π docs/ # Documentation
β βββ π README.md # Main documentation
β βββ π API.md # API reference
β βββ π DEPLOYMENT.md # Deployment guide
βββ π .github/ # GitHub templates
β βββ π ISSUE_TEMPLATE/ # Issue templates
β βββ π DISCUSSION_TEMPLATE/ # Discussion templates
βββ π public/ # Static assets
| Command | Description |
|---|---|
npm run dev |
π Start development server |
npm run build |
ποΈ Build for production |
npm run start |
π― Start production server |
npm run lint |
π Run ESLint |
npx prisma studio |
ποΈ Open Prisma Studio |
npx prisma db push |
π€ Push schema changes |
npx prisma generate |
βοΈ Generate Prisma client |
| π‘οΈ Security Feature | π Description |
|---|---|
| Input Validation | All inputs validated with Zod |
| CORS Protection | API endpoints protected from external access |
| Environment Validation | Required environment variables validated |
| Password Security | Strong password requirements |
| SQL Injection Protection | Prisma ORM prevents SQL injection |
| XSS Protection | Input sanitization and validation |
| β‘ Performance Feature | π Description |
|---|---|
| Image Optimization | Next.js automatic image optimization |
| Code Splitting | Automatic code splitting for better performance |
| Static Generation | Pre-rendered pages where possible |
| CDN Integration | Cloudflare R2 for fast asset delivery |
| Caching | Optimized caching strategies |
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Main Documentation - Complete project documentation
- API Reference - Detailed API documentation
- Deployment Guide - Production deployment instructions
- Bug Report - Report bugs and issues
- Feature Request - Suggest new features
- Question - Ask questions
- General Discussion - General project discussions
- Ideas & Brainstorming - Share ideas and brainstorm
- Q&A - Ask questions and get answers
This project is licensed under the MIT License - see the LICENSE file for details.
| π οΈ Tool | π Description |
|---|---|
| Next.js | The React framework |
| Prisma | Database toolkit |
| shadcn/ui | Beautiful UI components |
| Radix UI | Accessible UI primitives |
| Tailwind CSS | Utility-first CSS |
| NextAuth.js | Authentication for Next.js |
| Zod | TypeScript-first schema validation |
Need help? We're here for you!
π Report Bug β’ β¨ Request Feature β’ π¬ Discussions
Built with β€οΈ by ErrorX