Skip to content

FakeErrorX/errorx-forum

Repository files navigation

πŸš€ ErrorX Forum

A modern, full-featured forum application built with Next.js 15

Next.js TypeScript Tailwind CSS Prisma

Featuring user authentication, post management, file uploads, and real-time interactions

🌐 Live Website β€’ πŸ“– Documentation β€’ πŸ› Report Bug β€’ ✨ Request Feature


✨ Features

πŸ” Authentication & User Management

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

πŸ“ Content Management

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

🎨 Modern UI/UX

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

πŸ“ File Management

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

πŸ”’ Security & Validation

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

πŸ“Š SEO & Performance

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

πŸ› οΈ Tech Stack

Frontend

Next.js TypeScript Tailwind CSS shadcn/ui Radix UI

Backend

Prisma PostgreSQL NextAuth.js

Services

Cloudflare R2 Zod Nodemailer


πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • Cloudflare R2 account (for file storage)
  • SMTP email service (Gmail, SendGrid, etc.)

1️⃣ Clone & Install

# Clone the repository
git clone https://github.com/FakeErrorX/errorx-forum.git
cd errorx-forum

# Install dependencies
npm install
# or
yarn install
# or
pnpm install

2️⃣ Environment Setup

Create 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>"

3️⃣ Database Setup

# Generate Prisma client
npx prisma generate

# Run database migrations
npx prisma db push

# (Optional) Seed the database
npx prisma db seed

4️⃣ Start Development

npm run dev
# or
yarn dev
# or
pnpm dev

πŸŽ‰ Open http://localhost:3000 to view the application!


πŸ“ Project Structure

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

πŸ”§ Available Scripts

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 Features

πŸ›‘οΈ 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 Features

⚑ 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

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Quick Start for Contributors

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“š Documentation

πŸ› Report Issues

πŸ’¬ Discussions


πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

πŸ› οΈ 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

πŸ“ž Support

Need help? We're here for you!

πŸ› Report Bug β€’ ✨ Request Feature β€’ πŸ’¬ Discussions


Built with ❀️ by ErrorX

GitHub Twitter

About

A modern, full-featured forum application built with Next.js

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Languages