This file provides guidance to Qoder (qoder.com) when working with code in this repository.
PaiCoding is a Spring Boot-based community platform for technical content sharing. Multi-module Maven project with layered architecture separating API definitions, business logic, core utilities, frontend resources, and web endpoints.
# Clean and install all modules
mvn clean install -DskipTests=true
# Build for specific environment (dev/test/pre/prod)
mvn clean install -DskipTests=true -P<env>
# Build web module only
cd paicoding-web && mvn clean package spring-boot:repackage -DskipTests=true -Pprod# Run all tests
mvn test
# Run tests in specific module
cd paicoding-web && mvn test
# Run single test class
mvn test -Dtest=ClassName
# Run single test method
mvn test -Dtest=ClassName#methodName# Local development (requires MySQL and Redis running)
# Entry point: QuickForumApplication in paicoding-web module
# Default port: 8080
# Configure database in: paicoding-web/src/main/resources-env/dev/application-dal.yml
# Production deployment
./launch.sh start # Build and deploy
./launch.sh restart # Restart existing deploymentpaicoding-web
├── depends on: paicoding-ui, paicoding-service
│
paicoding-service
├── depends on: paicoding-core, paicoding-api
│
paicoding-core
├── depends on: paicoding-api
│
paicoding-api
└── (base module: entities, DTOs, VOs, enums)
- paicoding-api: Entity definitions, DTOs, VOs, common enums
- paicoding-core: Utilities, search, cache, recommendations, common components
- paicoding-service: Business logic, MyBatis-Plus database operations
- paicoding-ui: Thymeleaf templates, JavaScript, CSS, static resources
- paicoding-web: Controllers, REST endpoints,
QuickForumApplicationentry point, global exception handling, authentication
- Environment configs in
paicoding-web/src/main/resources-env/<env>/application-dal.yml: Database configapplication-image.yml: Image upload configapplication-web.yml: Web config
- Main configs in
paicoding-web/src/main/resources/application.yml: Main entryapplication-config.yml: Site configurationlogback-spring.xml: Logging
- Spring Boot 2.7.1, Java 8+
- MyBatis-Plus for ORM
- Thymeleaf for SSR
- Redis for caching/sessions
- ElasticSearch for search
- RabbitMQ for messaging
- MongoDB for NoSQL
- Liquibase for schema migrations (in
paicoding-web/src/main/resources/liquibase)
- Add Liquibase changesets to
paicoding-web/src/main/resources/liquibase - Database auto-creates on first startup (default:
paicoding) - Use MyBatis-Plus for database operations
- Entity classes in paicoding-api module
- Follow layered architecture: API → Service → Core
- Check existing code patterns in neighboring files
- Use libraries already present in the project (check root
pom.xml) - Frontend changes go in paicoding-ui module
- Swagger UI available at
/doc.html - Uses Knife4j (knife4j-openapi2-spring-boot-starter)
- Supports JUnit and Spock (Groovy-based BDD)
- Test files in
paicoding-web/src/test/javaandpaicoding-web/src/test/groovy