FIFE is a personal project that simulates a small sports newspaper inspired by MARCA. This microservice is the Article Service, responsible for the complete management of sports articles: creation, retrieval, updating, and deletion.
- Main Technologies
- Architecture & Structure
- Prerequisites
- Getting Started
- Configuration
- API Documentation
- Testing
- CI/CD
- Contributors
- Contact
- Java 21
- Spring Boot 3.2.5
- MongoDB (Docker container)
- Maven (with Spotless and Jacoco plugins)
- SpringDoc OpenAPI (Swagger)
- Testing with JUnit 5 and Mockito
- CI/CD with GitHub Actions and SonarCloud for analysis and coverage
- Microservices-based architecture (this is the first one)
- Lombok for boilerplate reduction
- ModelMapper for DTO ↔ Model ↔ Entity mapping
The application follows a layered pattern:
- Controller: exposes REST APIs and works with DTOs (maps to domain Model).
- Service: business logic.
- DAO: maps Model ↔ Entity and delegates to Repository.
- Repository: persistence layer (MongoDB).
Main folders:
configcontrollerdaodtoentityexceptionmodelpropertiesrepositoryserviceutils
- Java 21 installed
- Docker running for the MongoDB container
- IntelliJ (or your IDE) configured with environment variables for MongoDB
-
Clone the repository:
git clone https://github.com/oscarh9/article-service.git cd article-service -
Start MongoDB with Docker:
docker run -d -p 27017:27017 --name article_db mongo:latest
-
Run the service:
mvn spring-boot:run
-
Access Swagger UI to explore the API:
http://localhost:8080/swagger-ui.html
Use environment variables in your Run/Debug configuration (recommended).
- Generated with SpringDoc OpenAPI.
- Browse at: http://localhost:8080/swagger-ui.html
- Unit tests: Service and DAO layers
- Integration tests: Controller layer
Run tests:
mvn test- GitHub Actions: runs on Pull Request
- Build & test
- SonarCloud quality/coverage analysis
- Spotless formatting check
- Oscar - main developer
- Pol - code reviews and guidance
- Oscar Herencia - oscarherenciasakkis@gmail.com