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! ποΈ