Version: 0.3.0 | Status: Production Ready β
CommFlock is a Lightning-powered community platform where users discover and create communities, coordinate events, and connect with others. Built with Next.js 15, Prisma, PostgreSQL, and shadcn/ui.
- π Week 1-2 Complete: Code quality and performance optimizations (87% done)
- β‘ Performance Optimized: Database indexes, image optimization, mobile responsiveness verified
- π¨ UX Improvements: Skeleton loaders, better error messages, success toasts
- π Performance Audited: Lighthouse testing on all key pages
- β¨ New Landing Page with animated hero section and community discovery
- π Phase 1-5 Complete: Testing, password reset, rate limiting, CI/CD, and error monitoring
- π Full i18n Support: English and Spanish throughout entire site
- π Load More Pagination: Discover communities with infinite scroll
- π Security Hardened: Rate limiting, password reset, Sentry monitoring
- π€ CI/CD Pipeline: Automated testing and deployment
- Multi-tenant Communities: Each community has its own space with custom settings and policies
- Lightning Payments: Built-in Lightning Network support for community creation and event payments (simulated in v1)
- Lightning Address Integration: Users can optionally provide Lightning addresses for seamless payments
- Nostr Integration: Users can optionally provide Nostr public keys for decentralized identity
- Events & Polls: Coordinate activities with events, polls, and community announcements
- Flexible Join Policies: Auto-join, approval-required, or closed communities
- Member Management: Points, badges, and leaderboards
- Internationalization: English and Spanish support
- Modern UI: Built with shadcn/ui and Tailwind CSS
- Frontend: Next.js 15 (App Router) + TypeScript
- Database: PostgreSQL + Prisma ORM
- Authentication: Auth.js with credentials provider
- UI: Tailwind CSS + shadcn/ui
- Internationalization: next-intl
- Validation: Zod
- Forms: react-hook-form
- Node.js 18+
- PostgreSQL 14+ (for local development)
- npm or pnpm
- Clone the repository:
git clone <repository-url>
cd CommFlock- Install dependencies:
npm install- Set up environment variables:
cp env.example .envEdit .env with your database credentials:
For open source contributors (SQLite):
DATABASE_URL="file:./dev.db"
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="dev-secret-change-later"For shared development (Neon PostgreSQL):
DATABASE_URL="postgresql://USER:PASSWORD@HOST-POOLER.neon.tech/DB?sslmode=require&pgbouncer=true"
DIRECT_URL="postgresql://USER:PASSWORD@HOST.neon.tech/DB?sslmode=require"
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="dev-secret-change-later"- Set up the database:
# Run migrations
npm run db:migrate
# Generate Prisma client
npm run db:generate
# Seed the database (optional)
npm run seed- Start the development server:
npm run dev- Open http://localhost:3000 in your browser.
- Create a new project in Neon Console
- Copy your connection strings:
- Pooled URL (for runtime):
postgresql://USER:PASSWORD@HOST-POOLER.neon.tech/DB?sslmode=require&pgbouncer=true - Direct URL (for migrations):
postgresql://USER:PASSWORD@HOST.neon.tech/DB?sslmode=require
- Pooled URL (for runtime):
- Connect your GitHub repository to Netlify
- Set environment variables in Netlify dashboard:
DATABASE_URL=postgresql://USER:PASSWORD@HOST-POOLER.neon.tech/DB?sslmode=require&pgbouncer=true DIRECT_URL=postgresql://USER:PASSWORD@HOST.neon.tech/DB?sslmode=require NEXTAUTH_URL=https://your-site.netlify.app NEXTAUTH_SECRET=your-secret-key-here - Deploy! Netlify will automatically:
- Run
prisma migrate deploy - Generate Prisma client
- Build the Next.js app
- Deploy using OpenNext
- Run
- Health Check: Visit
https://your-site.netlify.app/api/health - Database Test: Create a test community
- Authentication: Test sign-in functionality
- i18n: Verify language switching works
- Health endpoint returns 200
- Database connection successful
- Home page loads correctly
- Language switching works (/en β /es)
- Community creation works
- Authentication flow works
- Images load properly
- API routes respond correctly
src/
βββ app/ # Next.js App Router
β βββ [locale]/ # Internationalized routes
β β βββ (auth)/ # Authentication pages
β β βββ (public)/ # Public pages
β β βββ [slug]/ # Community pages
β βββ api/ # API routes
β βββ globals.css # Global styles
βββ components/ # React components
β βββ ui/ # shadcn/ui components
βββ lib/ # Utility libraries
β βββ auth.ts # Auth.js configuration
β βββ db.ts # Prisma client
β βββ i18n.ts # Internationalization
β βββ validators.ts # Zod schemas
β βββ slug.ts # URL slug utilities
βββ messages/ # i18n message files
β βββ en.json
β βββ es.json
βββ middleware.ts # Next.js middleware
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run prisma:studio- Open Prisma Studionpm run db:migrate- Run database migrationsnpm run db:generate- Generate Prisma clientnpm run seed- Seed the database
The project uses Prisma as the ORM with PostgreSQL. Database schema is defined in prisma/schema.prisma.
Key models:
- User: Users with username and optional email
- Community: Multi-tenant communities with various settings
- CommunityMember: User memberships with roles and status
- Event: Community events with capacity and pricing
- Poll: Community polls with voting
- Payment: Simulated Lightning payments
Secure authentication with Auth.js:
- Username + password (required)
- Email (optional, for password reset)
- Lightning Address (optional, for payments)
- Nostr Pubkey (optional, for decentralized identity)
- Password reset flow with email tokens
- Rate limiting on auth endpoints
The app supports English and Spanish with next-intl:
- Default locale: English (en)
- URL structure:
/en/...or/es/... - Message files in
src/messages/ - Language switcher in header
- Full translation coverage (100%)
- Testing framework (Vitest + Playwright)
- Password reset with email
- Rate limiting (Upstash Redis)
- CI/CD pipeline (GitHub Actions)
- Error monitoring (Sentry)
- CSRF protection
- Authorization audit
- Input sanitization
- Session security improvements
- Database indexes
- Caching strategy
- Image optimization
- Performance monitoring
- Notifications system
- Image uploads
- Advanced search
- Analytics dashboard
- Real Lightning payments via NWC
- Payment webhooks
- Automatic refunds
See PROJECT_ROADMAP.md for full details.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
MIT License - see LICENSE file for details