JanMat (meaning "Public Opinion" in Hindi) is a modern, Instagram-inspired civic engagement platform that empowers citizens to actively participate in local governance.
- Issue Reporting: Citizens can report local issues with photos, location, and descriptions
- Dynamic Feeds: Instagram-style feeds for issues, news, and polls
- Stories: Ephemeral content sharing for community updates
- User Profiles: Public profiles with follow/follower system
- Real-time Updates: Live notifications and status updates
- Role-based Access: Different permissions for citizens and government users
- GitHub-like workflow (Submitted β Under Review β In Progress β Resolved)
- Upvoting and commenting system
- Assignment to government departments
- Geographic location tracking
- News posting and management
- Poll creation and management
- Issue assignment and status updates
- Analytics and reporting
- Official response capabilities
- React 18 with TypeScript
- Vite for build tooling
- Tailwind CSS for styling
- React Router for navigation
- Lucide React for icons
- Supabase (PostgreSQL + Auth + Storage + Real-time)
- Row Level Security (RLS) for data protection
- Real-time subscriptions for live updates
- Gemini AI for chatbot assistance
- Cloudinary for image storage (optional)
- Mapbox for location services (optional)
- Node.js 18+ and npm
- Supabase account
-
Clone the repository
git clone <repository-url> cd janmat-app npm install
-
Environment Setup Create
.env.localfile:VITE_SUPABASE_URL=your-supabase-url VITE_SUPABASE_ANON_KEY=your-supabase-anon-key VITE_GEMINI_API_KEY=your-gemini-api-key VITE_CLOUDINARY_CLOUD_NAME=your-cloud-name VITE_CLOUDINARY_UPLOAD_PRESET=your-upload-preset VITE_MAPBOX_ACCESS_TOKEN=your-mapbox-token
-
Database Setup Run SQL files in this order:
# In Supabase SQL Editor: 1. schema.sql # Create tables and indexes 2. rls_policies.sql # Apply security rules 3. functions.sql # Database functions 4. setup_storage.sql # File storage buckets 5. seed_data.sql # Sample data (optional)
-
Start Development Server
npm run dev
- Create Account: Sign up with "Citizen" role
- Report Issues: Use the pink floating "+" button on dashboard
- Engage: Vote on polls, follow users, share stories
- Track Progress: Monitor your reported issues' status
- Create Account: Sign up and update role to "government" in database
- Manage Issues: Update status, assign departments, respond officially
- Create Content: Post news announcements and community polls
- Analytics: Access government dashboard for insights
JanMat/
βββ src/
β βββ components/ # Reusable UI components
β β βββ ui/ # Base UI components
β β βββ ... # Feature components
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utilities and configurations
β βββ pages/ # Main application pages
β βββ types/ # TypeScript type definitions
β
βββ supabase/
β βββ schema.sql # Database schema
β βββ rls_policies_clean.pgsql # Security policies
β βββ functions.sql # Database functions
β βββ setup_storage.sql # Storage configuration
β
βββ public/ # Static assets
βββ .env.example # Environment variables template
βββ package.json # Dependencies
βββ vite.config.ts # Vite configuration
βββ tailwind.config.ts # Tailwind CSS configuration
- Authentication: Supabase Auth with email verification
- Authorization: Role-based access control (citizen/government)
- Row Level Security: Database-level security policies
- Data Validation: Input sanitization and validation
- File Upload Security: Restricted file types and sizes
Build Errors: Ensure all dependencies are installed with npm install
Database Connection: Verify Supabase URL and keys in .env.local
Authentication Issues: Check if email verification is enabled in Supabase
Image Upload Problems: Verify Cloudinary credentials or check Supabase storage setup
API Errors: Confirm Gemini API key is valid and has quota
- Use browser DevTools to inspect network requests
- Check Supabase dashboard for real-time database changes
- Monitor console for client-side errors
- Use Supabase logs for backend debugging
- Production Supabase project
- Production environment variables
- Build the application:
npm run build - Deploy
dist/folder to your hosting provider - Update environment variables for production
- Run database migrations on production Supabase
This project is licensed under the MIT License.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For issues and questions:
- Check the troubleshooting section above
- Review console errors and network logs
- Ensure all environment variables are correctly set
- Verify database setup is complete
Status: β Production Ready | Version: 1.0.0 | Last Updated: October 2025
- Node.js 18+
- npm or yarn
- Supabase account
-
Clone the repository
git clone <repository-url> cd janmat-app
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env.local
Fill in your Supabase credentials:
VITE_SUPABASE_URL=your_supabase_url VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Set up the database
Run the SQL files in your Supabase SQL editor in this order:
-- 1. Create the schema schema.sql -- 2. Set up Row Level Security rls_policies_clean.pgsql -- 3. Create database functions functions.sql -- 4. Set up storage buckets setup_storage.sql
-
Start the development server
npm run dev
The application will be available at http://localhost:3000
# Run all tests once
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with UI
npm run test:ui
# Generate coverage report
npm run test:coverageThe project uses Vitest for unit and integration testing with React Testing Library:
src/test/
βββ components/ # Component tests
βββ lib/ # Utility function tests
βββ setup.ts # Test configuration
βββ mocks.ts # Mock data and utilities
Example component test:
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
describe('MyComponent', () => {
it('renders correctly', () => {
render(<MyComponent />);
expect(screen.getByText('Hello')).toBeInTheDocument();
});
});Automated testing runs on every push and pull request via GitHub Actions:
- β Unit and integration tests
- β TypeScript type checking
- β Code coverage reports
- β Build verification
- β Security audits
See .github/workflows/ci.yml for the complete pipeline configuration.
- Report issues in their community
- View and upvote other issues
- Comment on issues
- Participate in polls
- Follow other users
- Create and view stories
- Access AI chatbot for government services
- Manage and assign issues
- Update issue status and provide resolutions
- Create and publish news articles
- Create community polls
- Access analytics dashboard
- Provide official responses
- users: User profiles with role-based access
- issues: Community issues with full lifecycle tracking
- comments: Threaded discussions on issues
- news: Official government announcements
- polls: Community voting with real-time results
- stories: Ephemeral content sharing
- notifications: Real-time user notifications
- Row Level Security (RLS) for data protection
- Automatic timestamps and audit trails
- Array fields for relationships (followers, upvotes, etc.)
- JSON fields for flexible data structures
- Geographic coordinates for location-based features
- Row Level Security: Database-level access control
- Authentication: Supabase Auth with OAuth support
- Role-based Permissions: Different access levels for citizens and government
- Data Validation: Input sanitization and validation
- Audit Trails: Complete history of data changes
- Primary: Soft blues (#3b82f6, #2563eb)
- Secondary: Gentle grays (#6b7280, #9ca3af)
- Success: Green (#22c55e)
- Warning: Orange (#f59e0b)
- Error: Red (#ef4444)
- Font: Inter (Google Fonts)
- Hierarchy: Clear heading levels with proper contrast
- Responsive: Scales appropriately across devices
- Mobile-first: Optimized for mobile with desktop enhancements
- Instagram-inspired: Familiar social media patterns
- Card-based: Clean, contained content blocks
- Responsive Navigation: Bottom nav on mobile, top nav on desktop
- β User authentication and profiles
- β Basic issue reporting and management
- β Instagram-style feeds
- β Stories functionality
- β News and polls
- β Basic notifications
- β AI chatbot integration
- β Advanced search and filtering
- β Push notifications
- Offline functionality
- Mobile app (React Native)
- Advanced analytics dashboard
- Integration with government systems
- Multi-language support
- Advanced reporting tools
- API for third-party integrations
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by modern social media platforms
- Built with open-source technologies
- Designed for civic engagement and transparency
- Community-driven development approach
JanMat - Empowering citizens, strengthening democracy. ποΈβ¨