A multiplayer web game where players can draw their pets and watch them interact in a virtual world.
- User Authentication: Simple username-based login
- Room System: Create or join multiplayer rooms
- Pet Drawing: Draw your pet using Fabric.js canvas
- Real-time Multiplayer: Watch pets from all players move around
- Interactive World: Pets walk on roads and paths built with Phaser.js
- Node.js + Express.js + TypeScript
- Socket.io for real-time communication
- PostgreSQL + Prisma ORM
- JWT authentication
- TypeScript
- Phaser.js 3 for game world
- Fabric.js for drawing canvas
- Vite for development server
- Node.js 18+
- PostgreSQL 15+ (or use Docker)
- Git
# Clone the repository
git clone <your-repo-url>
cd meet-your-dog
# Edit .env file with secure passwords:
# - Set POSTGRES_PASSWORD to a secure password
# - Set JWT_SECRET to a secure random string (min 32 characters)
# - Update other variables as needed
# Start all services
docker-compose up -d
# Wait for services to start, then visit:
# Frontend: http://localhost:3000
# Backend API: http://localhost:5000
# Health Check: http://localhost:5000/health
- Node.js 18+
- PostgreSQL 15+
cd backend
# Use clean package.json (recommended)
cp package-clean.json package.json
# Install dependencies
npm install
# Set up environment
cp .env .env
# Edit .env with your database credentials and secure secrets
# Set up database
npm run db:push
npm run db:generate
# Run linting and tests
npm run lint
npm run test
# Start development server
npm run dev
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
- Login: Enter your username
- Room Selection: Join existing room or create new one
- Pet Drawing: Draw your dog or cat on the canvas
- Game World: Watch your pet and others walk around
POST /api/auth/login
- Login with username
GET /api/rooms
- Get all active roomsPOST /api/rooms
- Create new roomGET /api/rooms/:id
- Get room details
POST /api/pets
- Create petPATCH /api/pets/:id/position
- Update pet positionGET /api/pets/room/:roomId
- Get pets in room
join-room
- Join a game roomleave-room
- Leave a game roompet-created
- Create new petpet-moved
- Update pet position
room-state
- Initial room stateplayer-joined
- Player joined roomplayer-left
- Player left roompet-created
- New pet createdpet-moved
- Pet position updated
Users: id, username, createdAt
Rooms: id, name, maxPlayers, currentPlayers, createdAt
Pets: id, userId, roomId, drawingData, position, type, createdAt
RoomMembers: id, roomId, userId, joinedAt, isActive
cd backend
# Development with hot reload
npm run dev
# Code quality
npm run lint # Check for linting errors
npm run lint:fix # Fix auto-fixable linting errors
npm run format # Format code with Prettier
npm run type-check # TypeScript type checking
# Testing
npm run test # Run tests
npm run test:watch # Watch mode
npm run test:coverage # With coverage report
# Build
npm run build # Build for production
cd frontend
npm run dev # Starts Vite dev server with HMR
npm run build # Build for production
npm run preview # Preview production build
cd backend
# Generate Prisma client
npm run db:generate
# Create and apply migrations (production)
npm run db:migrate
# Push schema changes (development)
npm run db:push
# Database GUI
npm run db:studio
docker-compose -f docker-compose.prod.yml up -d
- Set up PostgreSQL database
- Configure environment variables
- Build frontend:
npm run build
- Run database migrations
- Start backend server:
npm start
DATABASE_URL=postgresql://user:password@localhost:5432/meetyourdog
JWT_SECRET=your-secret-key
FRONTEND_URL=http://localhost:3000
PORT=5000
- Fork the repository
- Create feature branch:
git checkout -b feature-name
- Commit changes:
git commit -am 'Add feature'
- Push to branch:
git push origin feature-name
- Submit pull request
MIT License - see LICENSE file for details