A modern, open-source platform for community-driven issue reporting and resolution. Built for Morocco with full Arabic support and RTL layout.
Demo: https://fixhoumti.vercel.app/
![]() |
![]() |
| Create Report - Step 1 | Create Report - Step 2 |
![]() |
![]() |
| Create Report - Step 3 | View Report - Desktop |
![]() |
![]() |
| Desktop view - Home | Mobile View - Home |
![]() |
![]() |
| Mobile View - Explore reports | Mobile View - Report details |
- π Anonymous Reporting: Report issues without creating an account
- πΊοΈ Interactive Map: Visualize reports on an interactive Leaflet map
- π Advanced Filtering: Filter by category, status, location, and time period
- π Community Support: Upvote, downvote, and corroborate reports
- π‘ Proposed Solutions: Community can propose and vote on solutions
- π© Moderation System: Flag inappropriate content for review
- π Bilingual: Full support for English and Arabic with RTL layout
- π Security: Cloudflare Turnstile verification, rate limiting, RLS policies
- π± Responsive: Mobile-first design with optimized layouts
- β‘ Performance: Optimized database queries, caching, and infinite scroll
- π¨ Modern UI: Built with Tailwind CSS and Shadcn/ui components
- π Geospatial: PostGIS for location-based queries and spatial indexing
- π Real-time: Live updates and dynamic status calculations
- βΏ Accessible: WCAG compliant with proper semantic HTML
- Framework: Next.js 15 with App Router
- Database: Supabase (PostgreSQL with PostGIS)
- Authentication: Supabase Auth
- Storage: Supabase Storage (S3-backed)
- Styling: Tailwind CSS
- UI Components: Shadcn/ui
- Maps: Leaflet.js
- i18n: next-intl
- Security: Cloudflare Turnstile
- Deployment: Vercel
- Node.js 18+ and npm/yarn/pnpm
- Supabase account and project
- Cloudflare Turnstile site key (for bot protection)
- Vercel account (for deployment)
git clone https://github.com/anasbelmadani/fixhoumti.git
cd fixhoumtinpm install
# or
yarn install
# or
pnpm install-
Create a new Supabase project at supabase.com
-
Run all SQL migrations in the
sql/directory in order:init-schema.sql- Core database schemaadd-rls-policies.sql- Row Level Security policiesadd-indexes.sql- Performance indexesadd-functions.sql- Database functions- Additional migration files as needed
-
Enable PostGIS extension in Supabase:
CREATE EXTENSION IF NOT EXISTS postgis;
-
Set up Supabase Storage bucket:
- Create a bucket named
report-media - Configure policies (see
sql/storage-policies.sql)
- Create a bucket named
Create a .env.local file in the root directory:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# Cloudflare Turnstile
NEXT_PUBLIC_TURNSTILE_SITE_KEY=your_turnstile_site_key
TURNSTILE_SECRET_KEY=your_turnstile_secret_key
# Security
IP_HASH_SECRET=your_random_secret_for_ip_hashing
# App Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000
NODE_ENV=development# Run each SQL file in Supabase SQL Editor in this order:
1. sql/init-schema.sql
2. sql/add-rls-policies.sql
3. sql/add-indexes.sql
4. sql/add-functions.sql
5. sql/add-filtered-reports-function.sql
6. sql/add-nearby-reports-function.sql
7. sql/add-paginated-reports-function.sql
8. sql/storage-policies.sqlnpm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 in your browser.
with-supabase-app/
βββ app/ # Next.js App Router
β βββ [locale]/ # Localized routes (en, ar)
β β βββ admin/ # Admin dashboard
β β βββ auth/ # Authentication pages
β β βββ browse/ # Browse reports page
β β βββ categories/ # Categories page
β β βββ explore/ # Map exploration page
β β βββ legal/ # Legal pages (privacy, terms, etc.)
β β βββ moderator/ # Moderator dashboard
β β βββ report/ # Report pages
β β β βββ [id]/ # Individual report details
β β βββ page.tsx # Home page
β βββ api/ # API routes
β βββ admin/ # Admin APIs
β βββ moderation/ # Moderation APIs
β βββ reports/ # Report APIs
β βββ solutions/ # Solutions APIs
βββ components/ # React components
β βββ admin/ # Admin components
β βββ categories/ # Category components
β βββ layout/ # Layout components (nav, footer)
β βββ legal/ # Legal page components
β βββ map/ # Map components
β βββ media/ # Media handling components
β βββ moderation/ # Moderation components
β βββ reports/ # Report components
β βββ search/ # Search components
β βββ security/ # Security components (Turnstile)
β βββ ui/ # Shadcn/ui components
βββ lib/ # Utility libraries
β βββ queries/ # Database query functions
β βββ storage/ # Storage utilities
β βββ supabase/ # Supabase client setup
β βββ utils/ # Helper utilities
βββ messages/ # i18n translation files
β βββ en.json # English translations
β βββ ar.json # Arabic translations
β βββ ... # Locale-specific files
βββ public/ # Static assets
β βββ legal/ # Legal page markdown files
βββ sql/ # Database migrations
βββ i18n/ # i18n configuration
The platform supports English (en) and Arabic (ar) locales. To add a new locale:
- Add locale to
i18n/request.ts - Create translation file in
messages/[locale].json - Add font support in
app/[locale]/layout.tsxif needed
Categories are stored in the categories table. To add new categories:
INSERT INTO categories (name, color, icon)
VALUES ('Category Name', '#HEX_COLOR', 'icon-name');Automatic status transitions are configured in the status_thresholds table:
-- Example: Move to "acknowledged" after 10 upvotes
INSERT INTO status_thresholds (status, min_upvotes)
VALUES ('acknowledged', 10);The platform supports three user roles:
- Anonymous: Can report, vote, flag, and propose solutions
- Moderator: Can review flagged content and edit reports
- Admin: Full system access, manage users and roles
To assign roles, update the user_roles table in Supabase.
- Email/password authentication via Supabase Auth
- Anonymous users tracked via browser fingerprinting
- Row Level Security (RLS) policies on all tables
- Cloudflare Turnstile verification required for:
- Report creation
- Solution submission
- Voting actions
- IP-based rate limiting for submissions
- Configurable cooldown periods
- EXIF data stripped from uploaded images
- File type and size validation
- Moderator review system for flagged content
Key tables:
reports: Main report data with PostGIS locationreport_support: Upvotes, downvotes, corroborationssolutions: Community-proposed solutionssolution_votes: Votes on solutionscategories: Issue categoriesflags: Content moderation flagsuser_roles: User role assignmentsmoderation_actions: Audit log for moderator actions
- Push code to GitHub
- Import project in Vercel
- Add environment variables in Vercel dashboard
- Deploy
# Or use Vercel CLI
vercel --prod- Ensure all environment variables are set in Vercel
- Update
NEXT_PUBLIC_APP_URLto your production URL - Configure custom domain if needed
# Run type checking
npm run type-check
# Run linting
npm run lint
# Build for production
npm run buildContributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Use TypeScript for type safety
- Follow existing code patterns
- Add comments for complex logic
- Keep components focused and reusable
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Built with Next.js
- Database powered by Supabase
- Maps by Leaflet
- UI components from Shadcn/ui
- Security by Cloudflare Turnstile
For questions, issues, or feature requests, please open an issue on GitHub.
Note: This is a community-driven platform designed for civic engagement. It is not an emergency service and should not be used for urgent situations requiring immediate response. Always contact local authorities for emergencies.







