A browser-based 2D Pokémon-style MMO game built with TypeScript, Pixi.js, and Node.js. Features real-time multiplayer gameplay, map instances, chat system, and JWT authentication.
- Node.js 22 or higher (use
nvm useto ensure the correct version) - Docker and Docker Compose (for PostgreSQL database)
- npm or yarn
git clone <repository-url>
cd pokemmoStart the PostgreSQL database using Docker Compose:
docker-compose up -dThis will create a PostgreSQL container on port 5432 with the following default credentials:
- Database:
pokemmo - User:
postgres - Password:
postgres
Navigate to the server directory and copy the example environment file:
cd server
cp .env.example .envThe default .env configuration works with the Docker Compose setup. For production, update the security settings (see Environment Variables).
Install all project dependencies:
npm installThis will install dependencies for all workspaces (client, server, and shared).
To run both the client and server simultaneously in development mode:
npm run devYou can also run the client and server in separate terminals:
Terminal 1 - Server:
npm run dev:serverTerminal 2 - Client:
npm run dev:client- Client: http://localhost:3000
- Server API: http://localhost:3001
- WebSocket: ws://localhost:3001
- Arrow Keys or WASD: Move player
- Enter: Send chat message
The project includes a docker-compose.yml file to simplify database setup:
docker-compose up -ddocker-compose downdocker-compose logs -f postgresWarning: This will delete all database data.
docker-compose down -vThe server/.env.example file contains all required environment variables. Copy it to .env:
cd server
cp .env.example .env| Variable | Description | Default |
|---|---|---|
DB_HOST |
PostgreSQL host | localhost |
DB_PORT |
PostgreSQL port | 5432 |
DB_NAME |
Database name | pokemmo |
DB_USER |
Database user | postgres |
DB_PASSWORD |
Database password | postgres |
JWT_SECRET |
Secret key for JWT tokens | your-secret-key-change-in-production |
JWT_EXPIRES_IN |
JWT token expiration | 7d |
PORT |
Server port | 3001 |
CLIENT_ORIGIN |
Allowed CORS origin | http://localhost:3000 |
Create a .env file in the client directory:
| Variable | Description | Default |
|---|---|---|
VITE_SERVER_URL |
WebSocket server URL | http://localhost:3001 |
VITE_API_URL |
REST API URL | http://localhost:3001/api |
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request