A dark, modern, NUS-only social matching app to get students meeting in minutes/hours. Built with Next.js, TypeScript, and Prisma.
- Dark Modern UI - Glassmorphism design with custom design tokens
- NUS-Only Access - Email verification with NUS domain preference
- Anonymous Posting - Optional anonymous mode with generated codes
- Ephemeral Communities - Self-disappearing group threads
- Trending Algorithm - Server-side scoring for content discovery
- Credit Score System - Trust metrics and reporting system
- Real-time Updates - Framer Motion animations and micro-interactions
- Frontend: Next.js 14, TypeScript, Tailwind CSS, Framer Motion
- Backend: Next.js API Routes, JWT Authentication
- Database: PostgreSQL with Prisma ORM
- UI Components: Headless UI, Heroicons
- Testing: Jest, React Testing Library
- Node.js 18+
- PostgreSQL database
- npm or pnpm
-
Clone the repository
git clone <repository-url> cd flux-app
-
Install dependencies
pnpm install # or npm install -
Set up environment variables
cp env.example .env.local
Update
.env.localwith your values:DATABASE_URL="postgresql://username:password@localhost:5432/flux_db" JWT_SECRET="your-super-secret-jwt-key-here" SMTP_HOST="smtp.gmail.com" SMTP_PORT="587" SMTP_USER="your-email@gmail.com" SMTP_PASS="your-app-password"
-
Set up the database
pnpm db:generate pnpm db:push
-
Run the development server
pnpm dev
Open http://localhost:3000 in your browser.
flux-app/
├── components/ # React components
│ ├── Layout.tsx # Main layout wrapper
│ ├── Navigation.tsx # Side navigation
│ ├── PostCard.tsx # Post display component
│ ├── CreateModal.tsx # Post creation modal
│ └── TrendingSidebar.tsx
├── pages/ # Next.js pages
│ ├── api/ # API routes
│ │ ├── auth/ # Authentication endpoints
│ │ ├── posts/ # Post management
│ │ ├── communities/ # Community management
│ │ ├── reports/ # Reporting system
│ │ └── admin/ # Admin endpoints
│ ├── auth/ # Auth pages
│ ├── index.tsx # Home page
│ ├── trending.tsx # Trending page
│ ├── communities.tsx # Communities page
│ ├── settings.tsx # Settings page
│ └── create.tsx # Create page
├── lib/ # Utility functions
│ ├── auth.ts # JWT utilities
│ ├── db.ts # Database connection
│ ├── middleware.ts # API middleware
│ └── utils.ts # Helper functions
├── styles/ # Styling
│ ├── globals.css # Global styles
│ └── tokens.ts # Design tokens
├── prisma/ # Database schema
│ └── schema.prisma # Prisma schema
└── __tests__/ # Test files
POST /api/auth/register- Register new userGET /api/auth/verify- Verify emailPOST /api/auth/login- Login userPOST /api/auth/logout- Logout user
GET /api/posts- List posts with filtersPOST /api/posts- Create new postGET /api/posts/[id]- Get post detailsPUT /api/posts/[id]- Update postPOST /api/posts/[id]/upvote- Upvote postPOST /api/posts/[id]/comments- Add comment
POST /api/communities/[id]/join- Join communityPOST /api/communities/[id]/leave- Leave community
GET /api/trending- Get trending posts
POST /api/reports- File reportGET /api/admin/reports- List reports (admin)POST /api/admin/reports/[id]/resolve- Resolve report (admin)
DELETE /api/jobs/cleanup- Cleanup expired content
- Basic profile information
- Anonymous code generation
- Credit score system
- Interests and preferences
- Content and metadata
- Ephemeral settings
- Upvote tracking
- Completion status
- Member management
- TTL settings
- Activity tracking
- Reporting system
- Moderation workflow
- Credit score impact
- Primary:
#0b0f14(background) - Elevated:
#0f1418(cards) - Accent:
#7C5CFF(primary) - Secondary:
#00D4A2(teal) - Text:
#E6EEF3(primary),#A6B2BD(secondary)
- Font: Inter
- Weights: 400 (body), 500 (medium), 600 (semibold), 700 (bold)
- Glassmorphism cards with backdrop blur
- Rounded corners (12px default, 20px large)
- Soft shadows and gradients
- Micro-interactions with Framer Motion
Run tests with:
pnpm testRun tests in watch mode:
pnpm test:watch- Connect your repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push
-
Build the application
pnpm build
-
Start the production server
pnpm start
For production, use a managed PostgreSQL service:
- Supabase (recommended)
- PlanetScale
- Railway
- Render
Required for production:
DATABASE_URL="postgresql://..."
JWT_SECRET="your-production-secret"
SMTP_HOST="your-smtp-host"
SMTP_PORT="587"
SMTP_USER="your-email"
SMTP_PASS="your-password"- Users can choose to post anonymously
- Generated codes (e.g., FLX-7G3K) replace names
- Email verification still required for safety
- Self-disappearing group threads
- Configurable TTL (default 48 hours)
- Automatic cleanup via cron jobs
score = 1.5 * log(1 + upvotes)
+ 1.0 * log(1 + comments)
+ 0.8 * recencyFactor
+ 5.0 * instantBoost- Default: 85 points
- Reports: -10 points
- Repeated reports: -20 points
- Positive completions: +2 points
- Low scores restrict features
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For questions or support, please open an issue on GitHub.
Flux - Normalising talking to strangers. Make real connections fast.