https://github.com/maugus0/yushan-backend
Backend API for Yushan - A gamified web novel reading platform built with Spring Boot, PostgreSQL, and modern Java practices.
https://github.com/maugus0/yushan-backend
gamification java jwt-authentication maven postgresql rest-api spring-boot webnovel
Last synced: 3 months ago
JSON representation
Backend API for Yushan - A gamified web novel reading platform built with Spring Boot, PostgreSQL, and modern Java practices.
- Host: GitHub
- URL: https://github.com/maugus0/yushan-backend
- Owner: maugus0
- Created: 2025-09-10T02:12:28.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-11-11T12:16:57.000Z (7 months ago)
- Last Synced: 2025-11-11T13:14:01.842Z (7 months ago)
- Topics: gamification, java, jwt-authentication, maven, postgresql, rest-api, spring-boot, webnovel
- Language: Java
- Homepage:
- Size: 655 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Yushan Backend
> ๐ **Backend API for Yushan** - A gamified web novel reading platform that transforms reading into an engaging, social experience.
## ๐ Tech Stack
- **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
## โจ Key Features
### ๐ Core Platform
- Novel management and chapter organization
- User authentication and authorization
- Full-text search across novels and content
- Reading progress tracking
- Bookmarks and favorites system
### ๐ฎ Gamification
- XP and leveling system
- Achievement and badge system
- Reading streaks and milestones
- Leaderboards and competitions
- Social features (following, reviews)
### ๐ง Technical Features
- RESTful API design
- JWT-based authentication
- Database migration support
- Comprehensive error handling
- API documentation with OpenAPI
- Caching for performance optimization
## ๐๏ธ Project Structure
```
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
```
## ๐ฆ Getting Started
### Prerequisites
- Java 17 or higher
- Maven 3.6+
- PostgreSQL (for production)
### Quick Setup
```bash
# 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
```
### Database Configuration
```properties
# Development (H2 - auto-configured)
spring.profiles.active=dev
# Production (PostgreSQL)
spring.profiles.active=prod
spring.datasource.url=jdbc:postgresql://localhost:5432/yushan
```
## ๐ก API Endpoints
### Authentication
- `POST /api/auth/register` - User registration
- `POST /api/auth/login` - User login
- `POST /api/auth/refresh` - Token refresh
### Novels
- `GET /api/novels` - List novels
- `POST /api/novels` - Create novel
- `GET /api/novels/{id}` - Get novel details
- `GET /api/novels/{id}/chapters` - Get chapters
### User & Gamification
- `GET /api/users/profile` - User profile
- `GET /api/users/progress` - Reading progress
- `GET /api/leaderboard` - User rankings
## ๐งช Development
### Running Tests
```bash
# Unit tests
./mvnw test
# Integration tests with Testcontainers
./mvnw verify
```
### Database Migration
```bash
# Generate migration scripts
./mvnw flyway:migrate
```
## ๐ ๏ธ Built With
- [Spring Boot](https://spring.io/projects/spring-boot) - Application framework
- [Spring Security](https://spring.io/projects/spring-security) - Authentication & authorization
- [Spring Data JPA](https://spring.io/projects/spring-data-jpa) - Data persistence
- [PostgreSQL](https://www.postgresql.org/) - Primary database
- [H2 Database](https://www.h2database.com/) - Development database
- [Maven](https://maven.apache.org/) - Dependency management
## ๐ค Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ Roadmap
- [ ] 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 ๐