Thank you for taking the time to evaluate VillageOS! I'm excited to share my cozy collaborative farming simulator with you.
Join the Discord server to interact with the bot: https://discord.gg/PzzvE8KK
Or add the bot to your server: https://discord.com/oauth2/authorize?client_id=1413956635533250580&permissions=2147813376&integration_type=0&scope=applications.commands+bot
/village me description:"Custom appearance"- Customize your character/village create name:"My Farm"- Create your own village (one per server)/village show- View your village status/village plant description:"Magical fire pineapple"/village build description:"Fence surrounding the farm"/village water <x> <y>- Water your crops
- The underlying architecture is platform agnostic - meaning users could work on their farm together in a text group chat! This gaming platform can meet users on whatever platform they are currently using.
- We are entering into a truly new era of interactive experiences. I've been an indie game dev for half a decade and this is the first time where a user can grow a fictional plant they made up in their mind one minute prior to seeing it live.
- Deterministic object placement and manipulation: Essentially a psuedo-world-model by programatically generating a simple color mask of the world's state and then passing that to Nano Banana for the image makeover.
- Resource consumption and growth
- life cycle for platns
Here are some visual examples of VillageOS in action:
A collaborative farming simulator framework for group text chats, built with TypeScript, Node.js, React, and Prisma.
Add it to your Discord sever: https://discord.com/oauth2/authorize?client_id=1413956635533250580&permissions=2147813376&integration_type=0&scope=applications.commands+bot
- 🌱 Plant Lifecycle: Plant and grow crops from seed to harvest
- 🎮 Farming Commands: Plant, water, harvest, and build in your village
- 😴 Rest Management: Manage village activities and rest periods
- 📊 Status Tracking: Monitor village progress with rich messaging
- 🏥 Maintenance System: Manage village upkeep and maintenance
- ⏰ Cooldown System: Balanced gameplay with command cooldowns
- 📱 Admin Dashboard: Web-based interface for managing villages
- 👥 Village Management: View, edit, and monitor all villages
- 💬 Chat Interface: Admin chat interface for testing commands
- 📊 Real-time Updates: Live village status monitoring
- 🔐 Authentication: Secure admin access with API keys
- Node.js 18+
- PostgreSQL database
- Twilio account (for SMS integration)
- Supabase account (for media storage)
- Gemini AI API key (for image generation)
-
Clone the repository
git clone <repository-url> cd village-os
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Edit
.envwith your configuration:# Database Configuration DATABASE_URL="postgresql://username:password@localhost:5432/village_os" # Twilio Configuration TWILIO_ACCOUNT_SID="your_twilio_account_sid" TWILIO_AUTH_TOKEN="your_twilio_auth_token" TWILIO_PHONE_NUMBER="your_twilio_phone_number" # Game Balance Configuration RANDOM_EVENT_CHANCE=25 COMMAND_COOLDOWN_SOLO_SECONDS=600 COMMAND_COOLDOWN_SOCIAL_SECONDS=1800 # Web Server Configuration PORT=3000 ADMIN_API_KEY="your-admin-api-key-here" # Media Upload Configuration SUPABASE_URL="your-supabase-url" SUPABASE_ANON_KEY="your-supabase-anon-key" SUPABASE_BUCKET_NAME="VillageOS" # Gemini AI Configuration GEMINI_API_KEY="your-gemini-api-key" # Evolution Configuration EVOLUTION_TESTING_MODE=true
-
Set up the database
npx prisma migrate dev npx prisma generate
-
Build the project
npm run build
npm run devnpm run dev:platformnpm run web# Terminal 1 - Express server (API + routing)
npm run dev:web
# Terminal 2 - React frontend (Vite dev server)
npm run dev:vitenpm run build
npm startnpm run build
npm run start:web- SMS Integration: Active via Twilio SMS
- Web Admin Interface: http://localhost:3000
- API Endpoints: http://localhost:3000/api/*
/village create name:"My Farm" description:"A peaceful countryside village with rolling hills"- Create a new village with AI-generated landscape/village show- Display village status/village plant <x> <y>- Plant crops at coordinates/village water <x> <y>- Water crops at coordinates/village build <x> <y>- Build structures at coordinates/village me <description>- 🎨 Customize your character appearance
/village me description:"I want to look like a farmer with red hair and overalls"- Generates a new character appearance using AI
/village create name:"My Farm" description:"A peaceful countryside village with rolling hills"- Creates a new village with AI-generated landscape image
- Optional description customizes the village's appearance
- Generated image serves as the village's visual representation
- Updates your baseline image for all future village interactions
!village create <name>- Create a new village!village status- Check your village's current status!village plant- Plant crops in your village!village water- Water your crops (increases growth)!village harvest- Harvest mature crops!village build- Build structures in your village!village rest- Rest your village workers!village work- Resume village activities
- Create a Twilio account at https://www.twilio.com
- Get your Account SID, Auth Token, and purchase a phone number
- Add these credentials to your
.envfile - Configure your Twilio phone number for SMS
The web interface provides a comprehensive admin dashboard for managing villages and testing commands.
- Dashboard: Overview of all villages and system status
- Village Management: View, edit, and monitor individual villages
- Chat Interface: Test bot commands through a web-based chat
- Real-time Updates: Live status monitoring and updates
- Start the web interface:
npm run web - Open http://localhost:3000 in your browser
- Use the sidebar to navigate between sections:
- Dashboard: System overview
- Villages: Manage all villages
- Chat: Test commands
GET /api/villages- List all villagesGET /api/villages/:id- Get specific village detailsPOST /api/villages/:id- Update village statsPOST /api/chat/command- Send chat commands
The application follows a modular architecture with clear separation of concerns:
- TwilioPlatformAdapter: Handles SMS platform integration
- CommandProcessorService: Processes and routes user commands
- GameLogicService: Contains all game logic and village management
- UserRepository: Database operations for users
- VillageRepository: Database operations for villages
- MediaGenerationService: Handles AI-powered image generation
- SupabaseMediaService: Manages media storage and uploads
- Express Server (
src/web/server.ts): API server and SPA routing - React Frontend (
src/web/client/): Admin dashboard built with React + TypeScript - API Routes: RESTful endpoints for village management and chat
- WebSocket Support: Real-time communication for admin chat
src/
├── config/ # Configuration files
├── repositories/ # Data access layer
├── services/ # Business logic services
├── types/ # TypeScript type definitions
├── web/ # Web interface
│ ├── client/ # React frontend
│ ├── routes/ # API routes
│ └── server.ts # Express server
└── main.ts # Application entry point
src/
├── config/ # Configuration files
├── repositories/ # Data access layer
├── services/ # Business logic services
├── types/ # TypeScript type definitions
├── web/ # Web interface
│ ├── client/ # React frontend (Vite)
│ │ ├── src/
│ │ │ ├── components/ # React components
│ │ │ ├── hooks/ # Custom React hooks
│ │ │ └── lib/ # Utilities
│ │ └── index.html # HTML template
│ ├── routes/ # Express API routes
│ ├── middleware/ # Express middleware
│ └── server.ts # Express server
└── main.ts # Application entry point
# Build everything (bot + web)
npm run build
# Build web only
npm run build:web
# Build server only
npm run build:server# Run Jest tests
npm test
# Run basic functionality test
node test-basic.js# Full development environment (bot + web)
npm run dev
# Web interface only
npm run web
# Frontend hot reload only
npm run dev:vite# Backend API with auto-reload
npm run dev:web| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string |
TWILIO_ACCOUNT_SID |
Twilio account SID |
TWILIO_AUTH_TOKEN |
Twilio auth token |
TWILIO_PHONE_NUMBER |
Twilio phone number |
SUPABASE_URL |
Supabase project URL |
SUPABASE_ANON_KEY |
Supabase anonymous key |
GEMINI_API_KEY |
Google Gemini AI API key |
| Variable | Description | Default |
|---|---|---|
PORT |
Web server port | 3000 |
ADMIN_API_KEY |
API key for admin access | Required for web |
SUPABASE_BUCKET_NAME |
Supabase storage bucket | VillageOS |
RANDOM_EVENT_CHANCE |
Chance of random events (0-100) | 25 |
COMMAND_COOLDOWN_SOLO_SECONDS |
Solo command cooldown | 600 |
COMMAND_COOLDOWN_SOCIAL_SECONDS |
Social command cooldown | 1800 |
EVOLUTION_TESTING_MODE |
Enable evolution testing | false |
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.



