📚 Backend API for Yushan - A gamified web novel reading platform that transforms reading into an engaging, social experience.
- Framework: Spring Boot 3.x
- Language: Java 17+
- Database: PostgreSQL (Production) | H2 (Development)
- Build Tool: Maven
- Security: Spring Security with JWT
- Testing: JUnit 5, Testcontainers
- Novel management and chapter organization
- User authentication and authorization
- Full-text search across novels and content
- Reading progress tracking
- Bookmarks and favorites system
- XP and leveling system
- Achievement and badge system
- Reading streaks and milestones
- Leaderboards and competitions
- Social features (following, reviews)
- RESTful API design
- JWT-based authentication
- Database migration support
- Comprehensive error handling
- API documentation with OpenAPI
- Caching for performance optimization
com.yushan.backend/
├── controller/ # REST API endpoints
├── service/ # Business logic layer
├── repository/ # Data access layer
├── entity/ # JPA entities (database models)
├── dto/ # Data Transfer Objects
├── config/ # Application configuration
└── exception/ # Custom exception handling
- Java 17 or higher
- Maven 3.6+
- PostgreSQL (for production)
# Clone the repository
git clone https://github.com/your-username/yushan-backend.git
cd yushan-backend
# Run with H2 database (development)
./mvnw spring-boot:run
# Run tests
./mvnw test# Development (H2 - auto-configured)
spring.profiles.active=dev
# Production (PostgreSQL)
spring.profiles.active=prod
spring.datasource.url=jdbc:postgresql://localhost:5432/yushanPOST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/refresh- Token refresh
GET /api/novels- List novelsPOST /api/novels- Create novelGET /api/novels/{id}- Get novel detailsGET /api/novels/{id}/chapters- Get chapters
GET /api/users/profile- User profileGET /api/users/progress- Reading progressGET /api/leaderboard- User rankings
# Unit tests
./mvnw test
# Integration tests with Testcontainers
./mvnw verify# Generate migration scripts
./mvnw flyway:migrate- Spring Boot - Application framework
- Spring Security - Authentication & authorization
- Spring Data JPA - Data persistence
- PostgreSQL - Primary database
- H2 Database - Development database
- Maven - Dependency management
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Advanced search with filters
- Real-time notifications
- Social features (comments, discussions)
- Mobile app API support
- Advanced analytics dashboard
- Multi-language support
Yushan Backend - Powering the future of gamified reading experiences 🚀