Game community platform built with Spring Boot and React.
- Framework: Spring Boot 2.7.5
- Language: Java 17
- Database: MariaDB with MyBatis 2.2.2
- Security: Spring Security (session-based authentication)
- WebSocket: Spring WebSocket for real-time communication
- Framework: React 18.2.0
- UI Library: React Bootstrap 2.6.0
- Routing: React Router 6.16.0
- State Management: Zustand 4.5.0 + Context API
- HTTP Client: Axios 1.2.2
HappyGamse/
├── src/
│ ├── main/
│ │ ├── java/com/example/happyusf/ # Spring Boot backend
│ │ ├── resources/
│ │ │ ├── mapper/ # MyBatis XML mappers
│ │ │ └── static/ # React build output
│ │ └── happyus_front/ # React frontend source
│ │ ├── src/
│ │ │ ├── Pages/ # React pages
│ │ │ ├── contexts/ # Context providers
│ │ │ ├── hooks/ # Custom hooks
│ │ │ └── utils/ # Utility functions
│ │ └── public/ # Public assets
│ └── test/ # Backend tests
├── build.gradle # Gradle build configuration
└── README.md
- User registration with phone verification
- Login/Logout
- Password reset
- Account recovery (find ID by phone number)
- Session management (30-minute timeout)
- Maximum 1 concurrent session per user
- Game news
- Community boards
- Voice/text channels
- Friend system
- Real-time chat via WebSocket
- Java 17 or higher
- Node.js 14+ and npm
- MariaDB 10.6+
- Configure database connection in
src/main/resources/application.properties:
spring.datasource.url=jdbc:log4jdbc:mariadb://127.0.0.1:3306/happyus
spring.datasource.username=your_username
spring.datasource.password=your_password- Build and run the Spring Boot application:
./gradlew bootRunThe backend will start on http://localhost:8080
The React frontend is automatically built and deployed as part of the Gradle build process.
For development with hot reload:
cd src/main/happyus_front
npm install
npm startThis starts the development server on http://localhost:3000 with proxy to backend.
To build the entire project (backend + frontend):
./gradlew buildThis will:
- Install npm dependencies (if package.json changed)
- Build React app (
npm run build) - Copy React build to
src/main/resources/static/ - Compile Java code
- Run tests
- Package as executable JAR
./gradlew testcd src/main/happyus_front
npm testThis project was migrated from Thymeleaf server-side rendering to React SPA for authentication pages:
-
Migrated Pages:
- Login (
/login) - Signup (
/signup) - Agreement (
/agreement) - Find Account (
/find-account)
- Login (
-
Legacy URL Support: Old Thymeleaf URLs redirect to new React routes via
AccountViewController -
Authentication Flow:
- React frontend handles all UI rendering
- Form validation on client-side using
utils/validation.js - API calls to Spring Boot backend for authentication
- Session managed by Spring Security
- Protected routes wrapped with
ProtectedRoutecomponent
POST /loginAction- User loginPOST /request/join- User registrationPOST /request/findIdByMobile- Find user IDPOST /request/resetPasswordByMobile- Reset passwordPOST /request/account/verificationCode- Request phone verification codePOST /request/verification- Verify phone codeGET /api/terms/service- Get service termsGET /api/terms/privacy- Get privacy policyGET /api/is-authenticated- Check authentication status
GET /api/**- General API endpointsGET /user/**- User-specific pagesGET /friend/channel/**- Friend channel features
Build the executable JAR:
./gradlew bootJarRun the JAR:
java -jar build/libs/HappyGamse-0.0.1-SNAPSHOT.jarFor detailed migration information, see:
MIGRATION_PLAN.md- Technical migration guidePRD_REACT_MIGRATION.md- Product requirementsSHRIMP_TASK_PLAN.md- Task breakdown
Proprietary