Pranamika - A Government Official Review Application
Overview
A mobile application built with React Native and Node.js that enables citizens to review and provide feedback about government officials. Users can submit both positive and negative reviews along with images, creating transparency and accountability in public service.
Features
๐ฑ Mobile-first approach with cross-platform support
๐ Secure OTP-based phone authentication
๐ธ Camera integration for capturing photos
๐๏ธ Feed-based review system
๐จ Color-coded reviews (green for positive, red for negative)
๐ Pull-to-refresh functionality
๐ผ๏ธ AWS S3 image storage integration
๐ฑ Persistent authentication
๐ Paginated data loading
Tech Stack
Frontend
React Native - Mobile application framework
Expo - Development platform for React Native
TypeScript - Type-safe code
React Navigation - Navigation library
Axios - HTTP client
AsyncStorage - Local storage management
React Context - State management
Expo Camera - Camera functionality
Backend
Node.js - Runtime environment
Express - Web framework
MongoDB - Database
Mongoose - ODM for MongoDB
JWT - Authentication
AWS SDK - S3 integration
Twilio - SMS service for OTP
Multer - File upload handling
Cors - Cross-origin resource sharing
Cloud Services
AWS S3 - Image storage
MongoDB Atlas - Cloud database
Twilio - SMS services
API Endpoints
Authentication
POST /api/auth/sendOTP - Send OTP to phone number - Body: { phoneNumber: string } POST /api/auth/verifyOTP - Verify OTP and create user - Body: { phoneNumber: string, otp: string, name: string }Reviews
GET /api/reviews - Fetch paginated reviews - Query: { page: number, limit: number } - Headers: Authorization Bearer Token POST /api/reviews - Create new review - Body: FormData (image, officialName, location, review, isPositive) - Headers: Authorization Bearer TokenAuthentication Flow
The user enters phone number
The backend generates OTP and sends it via Twilio
User enters OTP
The backend verifies OTP and generates JWT
App stores authentication state
Subsequent app launches check for stored auth
Auto-redirect to feed if authenticated
Main Features Implementation
Review Creation
The user taps "Write a Review"
Camera opens for photo capture
User fills out review form:
Official's name
Location
Review text
Positive/Negative selection
Image uploads to S3
Review saves to MongoDB
Feed updates with a new review
Feed System
Implements infinite scroll
Pull-to-refresh functionality
Cached data management
Optimized image loading
Error handling
Loading states
Security Features
JWT-based authentication
Secure OTP system
AWS S3 secure upload
Input validation
Error handling
CORS protection
Performance Optimizations
Image optimization before upload
Lazy loading for feed items
Pagination for data fetching
Caching mechanisms
Optimized re-renders
Efficient state management
0 likes ยท 15 views ยท Dec 23, 2024
A mobile application built with React Native and Node.js that enables citizens to review and provide feedback about government officials. Users can submit both