Welcome to SimCity, a full-stack strategy game where players build their empires, join factions, and battle for supremacy! 🚀
- 🔐 Authentication: Secure User Login & Registration.
- ⚔️ Faction System: Choose your side and fight for your team's glory.
- 🏗️ City Building: Manage resources and build up your city (Infrastructure, Economy, Military).
- ⚔️ War & Battles: Engage in attacks against other players or factions.
- 🛡️ War State Control: Global war state that can be enabled/disabled by admins.
- 🏆 Leaderboard: Real-time rankings to see who dominates the server.
- 🛒 Shop: Buy upgrades and items to boost your progress.
- 📖 dynamic Help: Interactive "How to Play" and "Help" guides.
- ⚛️ Framework: React (Vite)
- 🎨 Styling: Tailwind CSS v4
- 🛣️ Routing: React Router Dom
- 🔥 BaaS: Firebase (Auth)
- ✨ Icons: Lucide React
- 📡 API: Axios
- 🟢 Runtime: Node.js
- ⚡ Framework: Express.js
- 🗄️ Database: MongoDB (Mongoose)
- 🔐 Auth: JWT & Bcrypt
- 🐳 Containerization: Docker support
- Node.js (v16+)
- MongoDB (Local or Atlas)
- Git
git clone https://github.com/devprashant19/simcity_backend
cd simcity_backendNavigate to the backend folder:
cd simcity_backendInstall dependencies:
npm installConfiguration (.env):
Create a .env file in simcity_backend with the following:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
# Add other backend specific env vars hereDatabase Seeding: To populate the game with initial data:
node seed_game.jsWar State Management:
- Enable War:
node enableWar.js - Disable War:
node disableWar.js
Start the Server:
npm start # or node server.jsServer will run on http://localhost:5000 (default)
Open a new terminal and navigate to the frontend folder:
cd simcityInstall dependencies:
npm installConfiguration (.env):
Create a .env file in simcity:
VITE_API_URL=http://localhost:5000
# Add Firebase config if neededStart the Development Server:
npm run devApp will open at http://localhost:5173
- Frontend: Deployed on Vercel ▲
- Backend: Deployed on Google Cloud ☁️
ssity/
├── 📁 simcity/ # Frontend (React + Vite)
│ ├── 📁 src/
│ │ ├── 📁 components/ # Reusable UI components
│ │ ├── 📁 pages/ # Game pages (Game, Shop, Attack, etc.)
│ │ ├── 📁 contexts/ # React Context (Auth, Game State)
│ │ └── ...
│ └── ...
├── 📁 simcity_backend/ # Backend (Express + Node)
│ ├── 📁 src/
│ │ ├── 📁 models/ # Mongoose Models (User, Battle, etc.)
│ │ ├── 📁 controllers/ # Game Logic
│ │ └── ...
│ ├── 📜 server.js # Entry point
│ └── ...
└── 📁 end/ # Additional web assets or landing pageContributions are welcome! Please follow these steps:
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.
Happy Building! 🏗️