A comprehensive community-focused mobile application for neighbourhood safety, communication, and local engagement. Built with React, Node.js, PostgreSQL, and Socket.io for real-time features.
https://neighbourhoodwatchapp2.vercel.app/login
- User Authentication & Authorization - Secure login/register with JWT tokens
- Role-Based Access Control - Admin, Moderator, and User roles
- Real-time Chat System - Group messaging with Socket.io
- Community Reports - Safety incident reporting with categories and priorities
- Notice Board - Community announcements and information sharing
- Contact Directory - Neighbour contacts and emergency services
- User Profiles - Customizable profiles with privacy settings
- Settings & Preferences - Notification controls and privacy options
- Neighbourhood Management - Geographic community boundaries
- Emergency Alerts - Real-time emergency notifications
- File Attachments - Images and documents for reports/notices
- Search & Filtering - Advanced filtering for all content types
- Mobile-First Design - Responsive Material-UI interface
- Real-time Notifications - Live updates via WebSocket connections
- Privacy Controls - Granular privacy settings for user information
- Audit Logging - Complete activity tracking for administrators
- React 18 - Modern React with hooks and context
- Material-UI (MUI) - Beautiful, accessible component library
- React Router - Client-side routing
- Socket.io Client - Real-time communication
- Axios - HTTP client for API calls
- Node.js & Express - RESTful API server
- PostgreSQL - Robust relational database
- Socket.io - Real-time WebSocket communication
- JWT - Secure authentication tokens
- bcryptjs - Password hashing
- Express Validator - Input validation and sanitization
- Helmet - Security headers
- CORS - Cross-origin resource sharing
- Rate Limiting - API abuse prevention
- Compression - Response compression
- Input Validation - Comprehensive data validation
- Bottom Navigation - Easy thumb navigation
- Responsive Layout - Works on all screen sizes
- Touch-Friendly - Large touch targets and gestures
- Material Design - Consistent, intuitive interface
- Dark/Light Theme - User preference support
- Dashboard - Community overview and quick actions
- Chat - Real-time group messaging
- Reports - Safety incident management
- Notice Board - Community announcements
- Contacts - Neighbour and emergency contacts
- Profile - User information and statistics
- Settings - Privacy and notification preferences
- users - User accounts with roles and neighbourhood assignment
- neighbourhoods - Geographic community boundaries
- reports - Safety incidents and community issues
- notices - Community announcements and information
- chat_groups - Group chat channels
- messages - Chat messages with real-time delivery
- user_contacts - Neighbour connections
- emergency_contacts - Emergency service information
- user_settings - Privacy and notification preferences
- notifications - System notifications
- audit_logs - Administrative action tracking
- UUID Primary Keys - Secure, non-sequential identifiers
- Soft Deletes - Data preservation with logical deletion
- Timestamps - Automatic created/updated tracking
- Indexes - Optimized query performance
- Triggers - Automatic timestamp updates
- Constraints - Data integrity enforcement
- Node.js 16+ and npm
- PostgreSQL 12+
- Git
- Clone the repository
git clone <repository-url>
cd neighbourhood-watch-app- Install dependencies
# Install server dependencies
cd server
npm install
# Install client dependencies
cd ../client
npm install- Database Setup
# Create PostgreSQL database
createdb neighbourhood_watch
# Run database schema
psql neighbourhood_watch < database/schema.sql- Environment Configuration
# Copy environment template
cd server
cp .env.example .env
# Edit .env with your configuration
# - Database credentials
# - JWT secret key
# - Other settings- Start the application
# Start server (from server directory)
npm run dev
# Start client (from client directory)
npm startThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=neighbourhood_watch
DB_USER=postgres
DB_PASSWORD=your_password
# Security
JWT_SECRET=your_jwt_secret_key
# Server
PORT=5000
NODE_ENV=development
CLIENT_URL=http://localhost:3000POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/refresh- Token refresh
GET /api/users/me- Current user profileGET /api/reports- Community reportsPOST /api/reports- Create new reportGET /api/notices- Community noticesPOST /api/notices- Create new noticeGET /api/chat/groups- User's chat groupsPOST /api/chat/groups/:id/messages- Send message
GET /api/users- All users (admin only)PATCH /api/users/:id/role- Update user roleGET /api/neighbourhoods- All neighbourhoodsPOST /api/neighbourhoods- Create neighbourhood
- JWT-based authentication
- Role-based access control (Admin/Moderator/User)
- Secure password hashing with bcrypt
- Token expiration and refresh
- Input validation and sanitization
- SQL injection prevention
- XSS protection
- CSRF protection
- Rate limiting
- Granular privacy settings
- Anonymous reporting options
- Data encryption in transit
- Audit logging for sensitive operations
- WebSocket-based messaging
- Group chat support
- Typing indicators
- Message history
- File sharing capabilities
- Categorized incident reporting
- Priority levels (Low/Medium/High/Urgent)
- Anonymous reporting option
- Status tracking (Open/In Progress/Resolved)
- Geographic location support
- Community announcements
- Event notifications
- Pinned important notices
- Expiration dates
- Category filtering
- Neighbour directory
- Emergency contacts
- Privacy-respecting contact sharing
- Quick communication options
- Full system access
- User management
- Neighbourhood management
- Content moderation
- System configuration
- Content moderation
- Report management
- Emergency alerts
- Community oversight
- Basic app features
- Create reports/notices
- Participate in chats
- Manage own profile
- Mobile-first approach
- Touch-friendly interface
- Optimized for small screens
- Fast loading times
- Offline capability
- Push notifications
- App-like experience
- Home screen installation
- New messages appear instantly
- Report status changes
- Emergency alerts
- User online status
- Message delivery
- Typing indicators
- User presence
- System notifications
- Configurable privacy levels
- Anonymous options
- Data minimization
- Secure data handling
- Report verification
- Content moderation
- Emergency response
- Incident tracking
- Proper indexing
- Query optimization
- Connection pooling
- Efficient pagination
- MongoDB reliability optimization with retry mechanisms
- Component optimization
- Lazy loading
- Caching strategies
- Bundle optimization
- Response compression
- Rate limiting
- Error handling
- Monitoring
- Exponential backoff retry logic for database operations
This neighbourhood watch app provides a solid foundation for community safety and engagement. The codebase is well-structured, secure, and scalable for growing communities.
MIT License - Feel free to use and modify for your community needs.