A minimalist, mobile-first research platform built with Next.js 14, Tailwind CSS, Shadcn UI, and Supabase.
- ๐ Invite-Only Authentication - Secure signup with invitation codes via Supabase Auth
- ๐ Content Publishing - Articles, Questions, and Events with Markdown support
- ๐ค User Profiles - Dynamic profiles with gamification, badges, and research history
- ๐ท๏ธ Tag System - Organize and discover content by categories
- ๐ฌ Comments & Replies - Threaded discussions with reply-to functionality
- ๐ Citations & Forking - Academic referencing with content forking and attribution
- ๐ Real-time Notifications - Notification center for comments, mentions, and updates
- ๐ค AI Question Advisor - OpenAI-powered research question refinement
- ๐ Surveys - Professional survey builder with analytics
- ๐ Polls - Create and vote on research polls
- ๐ Knowledge Graph - Topic visualization with D3.js
- ๐ Statistics Tools - Data visualization with Recharts
- ๐ Event Creation - Conferences, workshops, and webinars
- โ RSVP System - Going/Not Going/Maybe status tracking
- ๐๏ธ Calendar Integration - Add events to personal calendars
- ๐ Full-text Search - PostgreSQL-powered search with filters
- ๐ External API Integration - ReliefWeb, HDX, and World Bank data
- ๐ Search Analytics - Query tracking and analysis
- ๐ก๏ธ Role-Based Access Control - Admin, Moderator, Researcher, and Member roles
- ๐ฉ Content Moderation - Report system with appeals workflow
- ๐ค AI Moderation - Automated content scanning with OpenAI/Perspective API
- โ๏ธ Jury System - Community-based content review
- ๐ XP & Levels - Earn experience points for contributions
- ๐๏ธ Badges & Achievements - Unlock milestones and special recognition
- ๐ Progress Tracking - Visual progress with configurable visibility
- ๐ Bilingual Support - Full English and Arabic translations (800+ keys)
โ๏ธ RTL Support - Complete right-to-left layout for Arabic- ๐ Onboarding Wizard - Localized 4-step guided onboarding
- ๐ง Epistemic Diversity - Recommendations across 5 diversity categories
- ๐ Session-Bounded Context - Research trail without long-term profiling
- ๐ Related Research - Terminology designed for academic contexts
- Framework: Next.js 14+ (App Router)
- Styling: Tailwind CSS
- UI Components: Shadcn UI
- Icons: Lucide React
- Database & Auth: Supabase (PostgreSQL + Auth)
- API: RESTful with RBAC middleware (NEW!)
- Language: TypeScript (strict mode)
- Node Version: 20+
- Deployment: Vercel-ready (Edge Runtime compatible)
Configure the same variables locally and in Vercel. The .env.example file lists every supported flag.
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL |
โ | Supabase project URL (Project Settings โ API) |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
โ | Supabase anon/public key |
OPENAI_API_KEY |
Enables AI-powered moderation (leave unset to disable) | |
PERSPECTIVE_API_KEY |
optional | Alternative moderation provider |
When deploying to Vercel, add the same variables in Project Settings โ Environment Variables for the Development, Preview, and Production environments.
- Node.js 20+ installed
- A Supabase account and project (supabase.com)
- npm or pnpm package manager
- Git for version control
- Clone the repository:
git clone https://github.com/lAvArt/SyriaHub.git
cd SyriaHub- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.localEdit .env.local and add your Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
OPENAI_API_KEY=sk-your-openai-api-key # For AI moderation
See .env.example for all available configuration options.
- Set up the database:
Option A: Automated Setup (Recommended)
# Windows PowerShell
cd supabase
.\setup.ps1
# macOS/Linux
cd supabase
chmod +x setup.sh
./setup.shOption B: Manual Setup
- Install Supabase CLI (see instructions below)
- For local development:
supabase start - For remote:
supabase link --project-ref YOUR_PROJECT_REF - Apply migrations:
supabase db pushorsupabase db reset(local) - See
supabase/README.mdfor detailed instructions
Windows (PowerShell):
# Using Scoop (recommended)
scoop bucket add supabase https://github.com/supabase/scoop-bucket.git
scoop install supabase
# Or download directly from GitHub releases
# Visit: https://github.com/supabase/cli/releasesmacOS:
brew install supabase/tap/supabaseLinux:
# Using Homebrew on Linux
brew install supabase/tap/supabase
# Or download binary from GitHub releasesFor other installation methods, visit: https://github.com/supabase/cli#install-the-cli
-
Enable Supabase Auth:
- Go to your Supabase project dashboard
- Navigate to Authentication โ Providers
- Enable Email provider
- Configure email templates (optional)
-
Run the development server:
npm run dev- Open http://localhost:3000 in your browser
If you need to set up a new GitHub repository named syrealize-web:
-
Create a new repository on GitHub:
- Go to github.com/new
- Repository name:
syrealize-web - Description: "SyriaHub - A minimalist research platform"
- Choose Public or Private
- Do NOT initialize with README (already exists)
-
Push your local repository:
git remote add origin https://github.com/YOUR_USERNAME/syrealize-web.git git branch -M main git push -u origin main
Replace YOUR_USERNAME with your GitHub username.
The platform uses a comprehensive PostgreSQL schema with Row Level Security (RLS). See supabase/README.md for complete documentation.
-
users - Extended user profiles (linked to
auth.users)- Stores: name, email, role, bio, affiliation
- Roles: researcher (default), moderator, admin
-
posts - Research posts and articles
- Supports: title, content, tags array, author_id
- Auto-updates: created_at, updated_at timestamps
-
comments - Comments on posts
- Links: user_id, post_id
-
reports - Content moderation system
- Status: pending, reviewing, resolved, dismissed
- Links: post_id, reporter_id
-
roles - Role definitions with JSONB permissions
-
citations - Post-to-post citations/references
-
tags - Content categorization
- Includes: label, discipline, color
- โ Row Level Security (RLS) on all tables
- โ Automatic user profile creation on signup
- โ Auto-updating timestamps
- โ Role-based access control
- โ Pre-seeded tags and roles
- โ Helper views for statistics
For detailed schema documentation, migration instructions, and queries, see: ๐ supabase/README.md
For a single, all-encompassing guide covering every feature, system architecture, API, and user guide, please refer to: ๐ COMPREHENSIVE_PLATFORM_DOCUMENTATION.md
Complete RESTful API with Role-Based Access Control (RBAC):
- Authentication:
/api/auth/*- Login, signup, logout, user info - Posts:
/api/posts/*- CRUD operations with filtering and search - Comments:
/api/comments/*- Create and manage comments - Reports:
/api/reports/*- Content moderation system (moderators) - Users:
/api/users/*- User management (admins) - Roles:
/api/roles/*- Role management (admins) - Tags:
/api/tags/*- Tag management - Citations:
/api/citations/*- Academic references
- Researcher (default): Create/manage own content
- Moderator: Review reports, moderate all content, manage tags
- Admin: Full system access, user management, role management
For complete API documentation with examples: ๐ API_DOCUMENTATION.md
- Push your work to GitHub (
git remote add originif needed). - In Vercel, click New Project โ Import Git Repository, choose
lAvArt/SyriaHub, and grant access.
- In Settings โ Environment Variables, add the variables listed in the Environment Variables table.
- Repeat the setup for
Development,Preview, andProductionscopes so preview builds behave the same way as production.
- Vercel automatically builds a preview for every pull request/branch once the repo is linked.
- Branch protection tip: require the CI workflow (lint + typecheck) to pass before merging.
- Vercel Analytics runs automatically thanks to
@vercel/analyticsinapp/layout.tsx. - CDN caching headers are managed via
vercel.jsonand API helpers so static assets and selected/apiresponses are cached safely.
- The API Smoke Test workflow (
.github/workflows/api-smoke-test.yml) runs whenever Vercel reports a successful deployment and pings/api/health. - You can run the same check locally with PowerShell:
Invoke-WebRequest https://<your-domain>/api/health | Select-Object -Expand Content.
- Push to
mainfor production or any branch for a preview deploymentโVercel handles the rest. - Optional: attach a custom domain in Settings โ Domains after the first deploy.
- Lint & Type Check:
.github/workflows/ci.ymlrunsnpm run lintandnpm run typecheckon pushes tomainandfeature/**branches and on every pull request. - API Smoke Test:
.github/workflows/api-smoke-test.ymlcurls the deployed/api/healthendpoint after Vercel reports a successful deployment. - Local parity: run
npm ci && npm run lint && npm run typecheckbefore committing to match CI behaviour.
โโโ app/
โ โโโ auth/ # Authentication pages (login, signup, signout)
โ โโโ editor/ # Post editor page
โ โโโ feed/ # Post feed page
โ โโโ post/
โ โ โโโ [id]/ # Dynamic post detail page
โ โโโ profile/
โ โ โโโ [id]/ # Dynamic user profile page
โ โโโ globals.css # Global styles with Tailwind
โ โโโ layout.tsx # Root layout with metadata
โ โโโ page.tsx # Landing page with hero section
โโโ components/
โ โโโ ui/ # Shadcn UI components (future additions)
โโโ lib/
โ โโโ supabase/ # Supabase client configuration (server, client, middleware)
โ โโโ utils.ts # Utility functions (cn helper for Tailwind)
โโโ styles/ # Additional stylesheets (if needed)
โโโ types/
โ โโโ index.ts # TypeScript type definitions (User, Post, Profile)
โโโ supabase/
โ โโโ migrations/ # Database migrations
โโโ components.json # Shadcn UI configuration
โโโ middleware.ts # Next.js middleware for auth
โโโ tailwind.config.ts # Tailwind CSS configuration
โโโ tsconfig.json # TypeScript configuration
- Landing page with hero section
- Email authentication (invite-only signup)
- Post feed with tag filtering
- Post editor with Markdown support
- Mobile-first responsive design
- Vercel deployment ready
- Dynamic post and profile pages
- Shadcn UI and Lucide Icons integration
- Post editing functionality
- User profile editing
- Full-text search with advanced filters
- Comments and replies system
- Bookmarking/saving posts
- Content moderation and appeals
- Research Lab (AI Advisor, Polls, Surveys)
- Events system with RSVP
- Gamification (XP, levels, badges)
- Internationalization (English + Arabic)
- Bias-aware recommendation system
- Real-time collaboration on posts
- Additional languages (French, Turkish)
- Advanced analytics dashboard
- Content versioning with diff views
To add Shadcn UI components to your project:
npx shadcn@latest add button
npx shadcn@latest add card
npx shadcn@latest add input
# ... add other components as neededComponents will be added to components/ui/ and are fully customizable.
Note: As of Next.js 15+, middleware.ts has been renamed to proxy.ts. This project uses the new proxy.ts convention.
If you see a warning about middleware:
โ The 'middleware' file convention is deprecated. Please use 'proxy' instead.
This means the migration is complete. Clear the cache to remove the warning:
- Clear Next.js cache:
Remove-Item -Recurse -Force .next(Windows) orrm -rf .next(macOS/Linux) - Restart dev server:
npm run dev
Authentication not working:
- Verify environment variables in
.env.local - Check Supabase Email provider is enabled
- Clear browser cookies and try again
Database errors:
- Run migrations:
cd supabase && .\setup.ps1(Windows) or./setup.sh(macOS/Linux) - Verify Supabase connection in dashboard
- Check RLS policies are applied
API routes returning 401:
- Ensure you're logged in (check session cookie)
- Verify JWT token is being sent in requests
- Check user role permissions match required role
Build errors:
- Clear
.nextfolder:Remove-Item -Recurse -Force .next - Delete
node_modulesand reinstall:Remove-Item -Recurse -Force node_modules; npm install - Verify Next.js version:
npm list next(should be 16.0.1+)
For more detailed troubleshooting, see the documentation files:
MIDDLEWARE_UPDATE.md- Middleware configurationAPI_DOCUMENTATION.md- API usage and errorsMODERATION_DOCUMENTATION.md- AI moderation setup and troubleshootingsupabase/README.md- Database setup issues
- Read
CONTRIBUTING.mdfor branching, commit, and code-style conventions. - Run
npm run lintandnpm run typecheckbefore opening a pull request so CI succeeds on the first try. - Use the provided
test-api.ps1/test-api.shscripts to spot-check critical endpoints against a deployed environment. - Open an issue for larger changes so we can plan the database and Supabase migrations together.
This project is open source and available under the Apache 2.0 License.