A comprehensive full-stack community platform for Greater Sudbury, connecting residents with local government, services, and each other.
- Docker and Docker Compose
- Git
-
Clone the repository
git clone <your-repo-url> cd hive-sudbury-connect
-
Start all services
docker-compose up -d
-
Wait for services to be ready (about 30-60 seconds)
docker-compose logs -f backend # Wait for "Server running on port 3001" and database connections
-
Seed the database with sample data
docker-compose exec backend npm run seed
-
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
- API Health Check: http://localhost:3001/health
Username: mayor_sudbury
Password: password123
Username: concerned_citizen
Password: password123
- Framework: React 18.3.1 with TypeScript
- Build Tool: Vite 5.4.1
- Styling: Tailwind CSS + Shadcn UI
- Routing: React Router Dom
- State Management: React Query + Context API
- Forms: React Hook Form + Zod validation
- Runtime: Node.js 20+ with Express.js
- Database: PostgreSQL 15 (primary) + MongoDB 7 (flexible data)
- Authentication: JWT with bcrypt password hashing
- File Upload: Multer middleware
- Real-time: Socket.io for live updates
- Security: Helmet, CORS, rate limiting
- Containerization: Docker + Docker Compose
- Reverse Proxy: Nginx (production)
- Caching: Redis
- Database Persistence: Docker volumes
- Department Pages: Direct communication with city departments
- Official Announcements: Verified posts from city officials
- Service Requests: Report issues directly to relevant departments
- Event Calendar: City meetings, public hearings, community events
- Subcommunities: Neighborhood groups, interest-based communities
- Discussion Threads: Reddit-style voting and nested comments
- User Profiles: Customizable profiles with verification badges
- Following System: Follow users and subcommunities
- Post Types: Text, images, videos, polls, events
- Real-time Updates: Live comments, votes, and notifications
- Search: Full-text search across posts and users
- Mobile Responsive: Works perfectly on all devices
- Content Reporting: Community moderation tools
- User Verification: Official verification for city staff
- Rate Limiting: API protection against abuse
- Data Privacy: GDPR-compliant user controls
- users - User accounts and profiles
- posts - Community posts and announcements
- comments - Threaded comment system
- votes - Upvote/downvote system
- subcommunities - Community groups
- departments - City departments and services
- events - Community events and meetings
- notifications - User notification system
- users - Extended user preferences and metadata
- posts - Flexible post content and media
- comments - Complex comment threading and reactions
-
Environment Variables
cp .env.example .env # Edit .env with your configuration
-
Start development environment
docker-compose up -d
-
View logs
docker-compose logs -f backend docker-compose logs -f frontend
Access PostgreSQL
docker-compose exec postgres psql -U postgres -d sudbury_community
Access MongoDB
docker-compose exec mongodb mongosh sudbury_community
Reset Database
docker-compose down -v
docker-compose up -d
docker-compose exec backend npm run seed
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginGET /api/auth/me
- Get current userPOST /api/auth/refresh
- Refresh JWT token
GET /api/posts
- Get posts with paginationPOST /api/posts
- Create new postGET /api/posts/:id
- Get single postPUT /api/posts/:id
- Update postDELETE /api/posts/:id
- Delete postPOST /api/posts/:id/vote
- Vote on post
GET /api/comments/:postId
- Get post commentsPOST /api/comments
- Create commentPUT /api/comments/:id
- Update commentDELETE /api/comments/:id
- Delete commentPOST /api/comments/:id/vote
- Vote on comment
GET /api/users/:id
- Get user profilePUT /api/users/:id
- Update user profileGET /api/users/:id/posts
- Get user's postsPOST /api/users/:id/follow
- Follow/unfollow user
GET /api/subcommunities
- Get all subcommunitiesGET /api/subcommunities/:slug
- Get subcommunity detailsPOST /api/subcommunities
- Create subcommunityPOST /api/subcommunities/:id/join
- Join subcommunity
-
Clone and configure
git clone <your-repo-url> cd hive-sudbury-connect cp .env.example .env # Configure production environment variables
-
Start with Nginx
docker-compose --profile production up -d
-
Setup SSL (optional)
# Add your SSL certificates to ./ssl/ # Update nginx.conf for HTTPS
NODE_ENV=production
JWT_SECRET=your-super-secure-secret-key
DATABASE_URL=postgresql://user:pass@db:5432/sudbury_community
MONGODB_URI=mongodb://user:pass@mongo:27017/sudbury_community
FRONTEND_URL=https://yourdomain.com
- Backend: http://localhost:3001/health
- Database connections verified on startup
- Docker health checks configured
# PostgreSQL backup
docker-compose exec postgres pg_dump -U postgres sudbury_community > backup.sql
# MongoDB backup
docker-compose exec mongodb mongodump --db sudbury_community --out /tmp/backup
# View all logs
docker-compose logs
# Follow specific service
docker-compose logs -f backend
# Save logs to file
docker-compose logs > app.log
- Fork the repository
- Create your 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.
For support and questions:
- Create an issue on GitHub
- Contact the development team
- Check the documentation in
/docs
Built with β€οΈ for the Greater Sudbury community