Skip to content

GenniaApp/GenniaServer2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GenniaServer 2

Gennia
Gennia

Gennia: Yet another generals.io clone server & client

Gennia PC demo

Gennia Mobile demo

What is GenniaServer 2?

  • A realtime multiplayer game where the goal is to capture all of the enemy's general without losing your own
  • using react/nextjs/socket/express
  • inspired by generals.io, the game mode will be different from generals.io in the future.

How to Play

Your goal is to capture other generals.

  • Plains produce one unit every 25 turns
  • Cities and generals produce one unit every turn
  • You can move twice per turn.
  • When you capture the enemy general, all his territory belongs to you and his army strength is halved and becomes yours.
function keyboard
Move Around WSAD
Move On Mobile Touch & Drag
Open Chat Enter
Undo Move e
Clear Queued Moves q
Select on general g
Center on home h
Center Map c
Toggle 50% z
Set Zoom to Preset 1 / 2 / 3
Zoom in / out mouse wheel
Surrender escape

Supported Feature

Basic

  • Create Custom Map
  • Game Bot
  • Replays
  • Mobile Support (Drag to attack)
  • Lobby & Custom Game
  • Room Chat
  • Team

Game Modifier

  • Fog of War
  • Spectator
  • Warring States (Reveal all King)
  • Move All Armys
  • Movable King

Development

client: nextjs

First, run the development server:

cd client/
pnpm install
pnpm run dev

Open http://localhost:3000 with your browser to see the result.

server: express + socket.io

ps: server side code init from template

cd server/
pnpm install
pnpm run dev

database

We use postgresql + prisma

  • see .env.example to config prisma env correctly
  • if you init repo or edit prisma schema, run npx prisma migrate dev to make sure update schema in database and update prisma client
npx prisma generate # generate prisma client code
npx prisma migrate dev # migrate
pnpm dlx prisma studio # open databaseUI

docker

  • setup postgresql and pyadmin to manage data
docker-compose up -d

Deployment

  • PM2 is a production process manager for Node.js applications, which is very easy to use.

  • docker-compose: for setup database

  • see make deploy and make restart in Makefile

  • to set the application to restart on startup see: https://pm2.keymetrics.io/docs/usage/startup/

JoinUs

License

Distributed under the GNU GENERAL PUBLIC LICENSE VERSION 3. See LICENSE.txt for more information.

Acknowledgments

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages