A Next.js-based idle/incremental game where players solve math problems to earn money, buy businesses, invest in real estate, and build their empire!
- Math-Based Gameplay: Answer math questions to earn money
- Business Management: Buy and upgrade various businesses (shops, factories, banks, airlines, etc.)
- Real Estate Investment: Purchase properties, renovate them, and sell for profit
- Idle Income: Earn passive income from businesses even when offline
- Firebase Integration: Cloud-based data storage and authentication
- Google Sign-In: Save progress across devices by signing in with Google
- Anonymous Play: Start playing instantly without registration
- Framework: Next.js 15.5.9 (React 19)
- Language: TypeScript
- Styling: Tailwind CSS
- Backend: Firebase Realtime Database
- Authentication: Firebase Auth (Anonymous + Google)
- State Management: React Context + Hooks
- Clone the repository:
git clone https://github.com/Farenhid/Jibigame.git
cd Jibigame- Install dependencies:
npm install- Create
.env.localfile in the root directory with your Firebase config:
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain
NEXT_PUBLIC_FIREBASE_DATABASE_URL=your_database_url
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your_measurement_id- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
- Create a Firebase project at Firebase Console
- Enable Authentication → Anonymous and Google providers
- Enable Realtime Database
- Deploy security rules from
database.rules.json - Create a Web App and copy the config to
.env.local
For detailed setup instructions, see:
FIREBASE_SETUP_INSTRUCTIONS.mdGOOGLE_SIGNIN_SETUP.mdDEPLOYMENT_CHECKLIST.md
- Start as Guest: Game automatically signs you in anonymously
- Answer Math Questions: Click correct answers to earn money
- Buy Businesses: Invest in various businesses to generate passive income
- Upgrade Properties: Buy real estate, complete renovation tasks, and sell for profit
- Save Progress: Click "Save Progress" to link your Google account and sync across devices
Jibilib Game/
├── src/
│ ├── app/ # Next.js app directory
│ │ ├── layout.tsx # Root layout with auth button
│ │ ├── page.tsx # Main game page
│ │ └── globals.css # Global styles
│ ├── components/ # Reusable UI components
│ │ ├── AuthButton.tsx # Google Sign-In button
│ │ ├── BalanceCard.tsx # Display user balance
│ │ ├── BottomNav.tsx # Navigation bar
│ │ └── MoneyFly.tsx # Earn money animation
│ ├── game/ # Game logic
│ │ ├── GameProvider.tsx # Global game state
│ │ ├── models.ts # Game data models
│ │ ├── math.ts # Math question generator
│ │ └── userStateStore.ts # Firebase DB operations
│ ├── screens/ # Game screens
│ │ ├── Business.tsx # Business management
│ │ ├── Earnings.tsx # Main earnings screen
│ │ ├── Profile.tsx # User profile
│ │ └── RealEstate.tsx # Real estate investments
│ ├── auth/ # Authentication
│ │ └── firebaseAuth.ts # Auth helpers
│ └── firebaseClient.ts # Firebase initialization
├── database.rules.json # Firebase security rules
├── firebase.json # Firebase config
└── public/ # Static assets
- Firebase Security Rules ensure users can only access their own data
- Environment variables are gitignored
- Anonymous authentication allows instant play
- Google Sign-In enables cross-device sync
- Online Shop
- Physical Shop
- Taxi Company
- Shipping Company
- Factory
- Construction Company
- Car Dealership
- IT Company
- Bank
- Sports Club
- Oil and Gas Company
- Airlines
- Sunny Apartment (Kansas City)
- Downtown Loft (New York)
- Beach House (Miami)
Each property has multiple renovation tasks that increase its market value.
The game is configured as a PWA with:
- Offline support
- Mobile-responsive design
- Touch-optimized controls
- App-like experience
Build for production:
npm run build
npm startDeploy to Vercel:
vercel deployThis project is open source and available under the MIT License.
Farid Faraji
- GitHub: @Farenhid
- Next.js team for the amazing framework
- Firebase for backend infrastructure
- Tailwind CSS for styling utilities
Play now: Jibilib Game