Foodiverse is an interactive pixel-art campus world designed to help students discover and share food resources like community fridges and mutual-aid listings. Built with accessibility and inclusivity at its core, Foodiverse creates a welcoming digital space for food security on campus.
- Pixel-art style game with keyboard-first navigation
- Campus exploration with multiple buildings and locations
- Real-time interactions with NPCs and community resources
- Character customization with inclusive options
- Community fridge tracking - find available food near you
- Mutual-aid listings - share and discover food resources
- Real-time updates via Server-Sent Events
- Interactive leaderboard for community engagement
- ARIA live regions for screen reader support
- Keyboard-only navigation throughout the entire app
- High-contrast mode toggle for visual accessibility
- Inclusive character creation with pronouns and gender options
- DEI-focused design with community-centric approach
- Node.js 18+
- pnpm (recommended package manager)
- PostgreSQL database
-
Clone the repository
git clone <your-repo-url> cd foodiverse
-
Install dependencies
pnpm install
-
Set up environment variables
cp .env.example .env
Update your
.envfile with:# Database DATABASE_URL=your_postgres_connection_string # API Configuration NEXT_PUBLIC_API_URL=http://localhost:3000 # Authentication (if applicable) JWT_SECRET=your_jwt_secret # Google AI (for Jake assistant) GOOGLE_AI_API_KEY=your_google_ai_key
-
Run the development server
pnpm dev
-
Open the application Navigate to http://localhost:3000 in your browser
- Next.js 15 with App Router and Turbopack
- React 19 with TypeScript
- Tailwind CSS 4 for styling
- Canvas-based rendering for pixel-art game world
- HTML5 Canvas for game graphics and interactions
- Next.js API Routes for serverless functions
- PostgreSQL database with
pgdriver - Server-Sent Events (SSE) for real-time updates
- JWT authentication with bcryptjs
- Google Generative AI integration for Jake assistant
- Vercel for hosting and deployment
- ESLint for code linting
- TypeScript for type safety
- pnpm for efficient package management
foodiverse/
├── app/
│ ├── components/ # React components
│ │ ├── Game.tsx # Main game loop and canvas
│ │ ├── Player.ts # Player character logic
│ │ ├── World.ts # Game world management
│ │ └── campus/ # Campus building interiors
│ ├── api/ # API routes
│ │ ├── listings/ # Food listing CRUD operations
│ │ ├── auth/ # Authentication endpoints
│ │ └── jake/ # AI assistant endpoints
│ ├── services/ # Frontend services
│ │ ├── ApiService.ts # API communication
│ │ └── RealtimeService.ts # SSE handling
│ └── lib/ # Utilities and database
├── public/ # Static assets
├── vercel.json # Vercel deployment config
└── package.json # Dependencies and scripts
Game.tsx- Main game loop, canvas rendering, and input handlingPlayer.ts- Character movement, interactions, and state managementWorld.ts- Scene management and world stateSceneManager.ts- Handles transitions between different areas
- Dining Areas - Squires, Burrus, Turner, Torgersen
- Off-Campus - Food Lion, local restaurants, community spaces
- Interactive NPCs - Jake (AI assistant), bartenders, community members
- Server-Sent Events for live updates on food listings
- Leaderboard system with real-time score updates
- Community engagement tracking and notifications
# Development with Turbopack (faster builds)
pnpm dev
# Production build
pnpm build
# Start production server
pnpm start
# Run linting
pnpm lintFor local development, ensure you have:
- PostgreSQL database running
- Environment variables configured
- Google AI API key (for Jake assistant features)
This project is optimized for Vercel deployment:
- Connect your repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on every push to main branch
The vercel.json configuration ensures:
- API routes have appropriate timeout settings
- Optimized build and deployment process
We welcome contributions! Please read our contributing guidelines and:
- 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
- Mobile-responsive design
- Enhanced accessibility features
- Additional campus locations
- Social features and user profiles
- Notification system for new listings
- Integration with campus dining services
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with accessibility and inclusion as core principles
- Inspired by the need for better food security resources on campus
- Thanks to the open-source community for the amazing tools and libraries
Made with ❤️ for the campus community