- Spring Boot: 3.5.8
- Java: 17
- Build Tool: Gradle
- Database: MySQL 8.0+
- Architecture: Layered (Controller → Service → Repository → Database)
- HTML5 Canvas for rendering
- Vanilla JavaScript (no frameworks)
- CSS3 for UI styling
arena-shooter/
├── src/
│ ├── main/
│ │ ├── java/com/example/arenashooter/
│ │ │ ├── ArenaShooterApplication.java
│ │ │ ├── config/
│ │ │ │ └── WebConfig.java
│ │ │ ├── controller/
│ │ │ │ ├── AuthController.java
│ │ │ │ └── GameController.java
│ │ │ ├── dto/
│ │ │ │ ├── LoginRequest.java
│ │ │ │ ├── PlayerProfileDto.java
│ │ │ │ ├── InventoryDto.java
│ │ │ │ ├── PlayerStatsDto.java
│ │ │ │ ├── StatsUpdateRequest.java
│ │ │ │ ├── InventorySyncRequest.java
│ │ │ │ ├── HealRequest.java
│ │ │ │ ├── KillUpdateRequest.java
│ │ │ │ └── WeaponSwapRequest.java
│ │ │ ├── entity/
│ │ │ │ ├── User.java
│ │ │ │ ├── PlayerStats.java
│ │ │ │ └── Inventory.java
│ │ │ ├── repository/
│ │ │ │ ├── UserRepository.java
│ │ │ │ ├── PlayerStatsRepository.java
│ │ │ │ └── InventoryRepository.java
│ │ │ └── service/
│ │ │ ├── AuthService.java
│ │ │ ├── GameService.java
│ │ │ └── ProfileMapper.java
│ │ └── resources/
│ │ ├── application.properties
│ │ └── static/
│ │ ├── index.html
│ │ ├── styles.css
│ │ └── game.js
│ └── test/
├── database/
│ └── schema.sql
├── build.gradle
└── README.md
- Install MySQL 8.0+ if not already installed
- Start MySQL service
- Run the database schema:
mysql -u root -p < database/schema.sqlOr manually:
mysql -u root -p
source database/schema.sqlEdit src/main/resources/application.properties:
spring.datasource.username=root
spring.datasource.password=YOUR_MYSQL_PASSWORDUsing Gradle wrapper:
# Windows
.\gradlew.bat bootRun
# Linux/Mac
./gradlew bootRunThe backend will start on http://localhost:7320
Open your browser and navigate to:
http://localhost:7320/index.html
- WASD - Move player
- Mouse - Aim
- Left Click - Shoot
- R - Reload
- Q or 1/2 - Switch weapons
- AKM (AR) - High damage, moderate fire rate
- M416 (AR) - Balanced damage and fire rate
- UZI (SMG) - Fast fire rate, lower damage
- UMP (SMG) - Moderate stats
- Shotgun - High damage, slow fire rate
- First Aid Kit - Heals 75 HP
- Med Kit - Full heal (100 HP)
- Energy Drink/Boost - Heals 40 HP
- Helmet - Increases protection (Levels 1-3)
- Vest - Damage reduction (Levels 1-3)
- Login Screen - Username/password authentication
- Lobby - Customize loadout, view stats, start game
- Arena Match - Explore map, fight enemies, collect loot
- Pause Menu - Adjust settings, quit to lobby
POST /api/login- Login or register user
GET /api/start?userId={id}- Start game sessionPOST /api/update-stats- Update player statisticsPOST /api/sync-inventory- Sync inventory with serverPOST /api/handle-kill- Record enemy killPOST /api/heal- Update player healthPOST /api/swap-weapons- Change equipped weapons
| Username | Password | Stats |
|---|---|---|
| player1 | password123 | New player |
| player2 | password123 | 5 kills, 500 score |
| testuser | test | New player |
- No Spring Security (simple auth for demo)
- Plain text passwords (educational project only)
- CORS enabled for localhost development
- JPA auto-creates tables on first run
- All game logic runs client-side
- Backend only for persistence
- Placeholder graphics (colored rectangles)
- Responsive canvas rendering
- Check MySQL service is running
- Verify credentials in
application.properties - Ensure
arena_shooterdatabase exists
Change port in application.properties:
server.port=8080WebConfig is already configured for * origins
Ensure you access via http://localhost:7320/index.html (not file://)
- Multiple map selections
- Sound effects and music
- Persistent high score leaderboard
- More enemy types and behaviors
- Power-ups and special weapons
- Multiplayer support
Educational project - Free to use and modify
Shadhin Nandi
