A premium marketplace for handmade knives with integrated forum and real-time messaging features. Built with Next.js 16, React 19, TypeScript, and Prisma.
- 🛒 Marketplace: Buy and sell handmade knives with image galleries
- 💬 Real-time Messaging: Direct conversations with Soketi (self-hosted Pusher)
- 🗣️ Community Forums: Categorized discussions with moderation tools
- 💳 Payment Integration: PayPal, MyPOS, and Stripe support
- 🔐 Authentication: Email/password and OAuth (Google, Facebook)
- 🌍 Internationalization: English and Bulgarian translations
- 📸 Image Processing: Auto-resize and S3-compatible storage (MinIO)
- 👮 Moderation System: Thread pinning, locking, user bans, audit logs
- 📊 Admin Dashboard: User management, post moderation, analytics
- 🎨 Post System: Credits, boosts, free weekly posts, gallery mode
- Node.js 20+ and npm
- Docker and Docker Compose
git clone <repository-url>
cd godknife
npm installCreate a .env file in the root directory:
# Database
DATABASE_URL="postgresql://godknife:godknife_password@localhost:5432/godknife"
# Auth (generate with: openssl rand -base64 32)
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-32-char-secret-here"
# OAuth (optional)
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
FACEBOOK_APP_ID="your-facebook-app-id"
FACEBOOK_APP_SECRET="your-facebook-app-secret"
# MinIO Storage
MINIO_ENDPOINT="localhost"
MINIO_PORT="9009"
MINIO_USE_SSL="false"
MINIO_ROOT_USER="godknife"
MINIO_ROOT_PASSWORD="godknife_password"
MINIO_BUCKET_NAME="godknife-images"
# Pusher/Soketi (Real-time)
PUSHER_APP_ID="godknife-app"
PUSHER_KEY="godknife-key"
PUSHER_SECRET="godknife-secret"
PUSHER_CLUSTER="eu"
NEXT_PUBLIC_PUSHER_KEY="godknife-key"
NEXT_PUBLIC_PUSHER_CLUSTER="eu"
NEXT_PUBLIC_SOKETI_HOST="localhost"
NEXT_PUBLIC_SOKETI_PORT="6001"
# Redis
REDIS_URL="redis://localhost:6380"
# Payment (optional)
PAYPAL_CLIENT_ID="your-paypal-client-id"
PAYPAL_CLIENT_SECRET="your-paypal-secret"
PAYPAL_MODE="sandbox"
MYPOS_IPC_URL="https://mypos.com/vmp/checkout-test"
MYPOS_SID="your-mypos-sid"
MYPOS_WALLET="your-mypos-wallet"
MYPOS_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
STRIPE_SECRET_KEY="sk_test_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
# Pricing
POST_PURCHASE_PRICE="5"
BOOST_PRICE="10"# Start Docker services (PostgreSQL, MinIO, Redis, Soketi)
docker-compose up -d
# Run database migrations
npx prisma migrate dev
# Seed initial data (optional)
npx ts-node scripts/seed-forums.ts
npx ts-node scripts/seed-categories.ts
# Start development server
npm run dev| Service | URL | Credentials |
|---|---|---|
| App | http://localhost:3000 | - |
| MinIO Console | http://localhost:9001 | godknife / godknife_password |
| Prisma Studio | npx prisma studio → http://localhost:5555 |
- |
| PostgreSQL | localhost:5432 | godknife / godknife_password |
| Redis | localhost:6380 | - |
| Soketi | ws://localhost:6001 | - |
godknife/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ │ ├── auth/ # Authentication endpoints
│ │ ├── posts/ # Marketplace posts
│ │ ├── forums/ # Forum discussions
│ │ ├── payments/ # Payment processing
│ │ └── admin/ # Admin-only routes
│ ├── admin/ # Admin dashboard pages
│ ├── forums/ # Forum pages
│ └── auth/ # Auth pages (signin, register)
├── components/ # React components
├── hooks/ # Custom React hooks
├── lib/ # Utilities and configs
│ ├── auth.ts # NextAuth configuration
│ ├── prisma.ts # Database client
│ ├── minio.ts # S3 storage client
│ ├── pusher.ts # Real-time messaging
│ └── image-processor.ts # Image resizing
├── prisma/
│ ├── schema.prisma # Database schema
│ └── migrations/ # Migration history
├── messages/ # i18n translations (en, bg)
├── __tests__/ # Jest test suites
└── docker-compose.yml # Infrastructure services
# Development
npm run dev # Start dev server (http://localhost:3000)
npm run build # Production build
npm start # Production server (http://localhost:8888)
npm run lint # Run ESLint
# Database
npx prisma studio # Open database GUI
npx prisma migrate dev # Create & apply migration
npx prisma migrate reset # Reset database (⚠️ deletes data)
npx prisma generate # Regenerate Prisma Client
# Testing
npm test # Run all tests
npm run test:watch # Watch mode
# Docker
docker-compose up -d # Start all services
docker-compose down # Stop all services
docker-compose logs -f # View logs
docker-compose ps # List running containersThe platform uses NextAuth v5 with multiple providers:
- Start the app and register a new account at http://localhost:3000/auth/register
- Open Prisma Studio:
npx prisma studio - Navigate to the
Usertable - Find your user and set
isAdmintotrue - Save and refresh the app
- Google: Get credentials from Google Cloud Console
- Facebook: Get credentials from Facebook Developers
Core models:
- User: Authentication, roles (
isAdmin,isModerator), post credits - Post: Marketplace items with images, pricing, boosting
- Thread/ThreadComment: Forum discussions and replies
- Forum: Named discussion spaces with slugs
- Conversation/Message: Real-time private messaging
- Payment: Transaction tracking (PayPal, MyPOS, Stripe)
- ModerationLog: Audit trail for moderation actions
- UserBan: Temporary/permanent user bans
See prisma/schema.prisma for complete schema.
Images are automatically processed and stored in MinIO:
- Max 10 images per post
- Formats: JPEG, PNG, WebP, GIF
- Auto-resized: 3 sizes (150x150 thumb, 800x800 medium, 1920x1920 large)
- S3-compatible: Access at
http://localhost:9009/godknife-images/{filename}
- Free users: 1 post per week
- Paid credits: Buy 5 posts for $5
- Credits never expire
- $10 per post: Featured for 10 days
- Appears higher in search results
Configure pricing in .env:
POST_PURCHASE_PRICE="5" # USD for 5 credits
BOOST_PRICE="10" # USD for 10-day boost- 8 Main Categories: Folders, Fixed Blades, Chef Knives, etc.
- Forums: Named discussion spaces (e.g., "Beginner Tips")
- Threads: Individual discussions
- Moderation: Pin, lock, flag, delete threads and comments
- User Bans: Temporary or permanent
Moderators can access tools via /admin/forums.
Jest test suites cover:
- ✅ Authentication (credentials, OAuth, username generation)
- ✅ Post creation and limits
- ✅ Payment flows (PayPal, MyPOS, Stripe)
- ✅ Forum operations
npm test # Run all tests
npm run test:watch # Watch modeSupports English and Bulgarian:
- Translation files:
messages/en.json,messages/bg.json - Client-side: Use
useLanguage()hook - Server-side: Import translations directly
- Language switcher in navigation
Detailed documentation available:
- QUICKSTART.md: Commands and quick reference
- STATUS.md: Working features and URLs
- IMPLEMENTATION.md: Complete feature checklist
- FORUM_FEATURES.md: Forum API reference
- PAYMENT_SYSTEM.md: Payment integration guide
- USER_PROFILE_DOCUMENTATION.md: Profile system
- Test READMEs:
__tests__/{auth,posts,payments}/README.md
The docker-compose.yml file includes:
- PostgreSQL 17: Main database (port 5432)
- MinIO: S3-compatible object storage (ports 9009, 9001)
- Redis 7: Caching and sessions (port 6380)
- Soketi: Real-time WebSocket server (port 6001)
All services persist data in Docker volumes.
# Check PostgreSQL is running
docker-compose ps postgres
# View logs
docker-compose logs postgres
# Restart database
docker-compose restart postgres# Check MinIO is running
docker-compose ps minio
# Access console at http://localhost:9001
# Verify bucket "godknife-images" exists- Ensure MinIO is running:
docker-compose up -d minio - Check bucket initialization in logs
- Verify
MINIO_ENDPOINTandMINIO_PORTin.env
- Ensure Soketi is running:
docker-compose up -d soketi - Check WebSocket connection in browser console
- Verify Pusher credentials in
.env
npm run build
npm start # Runs on port 8888- Set production URLs for
NEXTAUTH_URL - Use production OAuth credentials
- Configure production MinIO/S3 bucket
- Set strong secrets for
NEXTAUTH_SECRET - Use production payment credentials
npx prisma migrate deploy # Apply pending migrations- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is private and proprietary.
For issues, questions, or feature requests, please create an issue in the repository.
Built with ❤️ using Next.js, React, and TypeScript