Explore the digital world of Digimons through our RESTful API! 🚀 With Digimon API, you can easily and quickly query, add, update, and delete information about your favorite Digimons. Developed in Java with Spring Boot, this API offers well-defined endpoints, interactive documentation with Swagger, and is ready to run in any environment thanks to Docker containerization. Dive into this tech adventure and connect to the Digimon universe! 🌐
- Description
- Objectives
- Main Features
- Key Technologies Used
- Project Structure
- Requirements
- How to Run?
- Application Images
- Available Endpoints
- Future Features
- Frequently Asked Questions
- License
- How to Contribute?
- Author and Contact
- Special Thanks
Welcome to Digimon API! This is a RESTful API project developed in Java using the Spring Boot framework. The API allows you to query, insert, edit, and delete information about Digimons in a PostgreSQL database. The project follows the MVC architecture, includes Swagger documentation, and is containerized with Docker for easy execution and distribution.
- Learning and Practice: Enhance skills in Java Spring Boot and RESTful API development.
- Ease of Use: Provide a simple and user-friendly API for interacting with Digimon data.
- Scalability: Build a solid foundation that can be expanded with new features in the future.
- Best Practices: Implement design patterns, documentation, and tests to ensure code quality.
- Digimon Queries:
- List all Digimons.
- Search Digimons by ID.
- Search Digimons by name.
- Search Digimons by level.
- Digimon Management:
- Create a new Digimon.
- Update an existing Digimon's information.
- Delete a Digimon from the database.
- Documentation:
- Access Swagger UI for route documentation and testing.
- Language: Java 17
- Framework: Spring Boot
- Database: PostgreSQL
- Documentation: Swagger (Springdoc OpenAPI)
- Containerization: Docker
- Dependency Management: Maven
The project structure is as follows:
digimon-api/
│
├── .idea/ (IGNORED BY .GITIGNORE)
├── .mvn/
│ └── wrapper/
│ └── maven-wrapper.properties
├── developer_notes/ (IGNORED BY .GITIGNORE)
├── docs/
│ ├── images/
│ │ ├── digimon-banner.jpg
│ │ ├── digimonapi-docs.png
│ │ └── digimonapi-terminal.png
│ ├── challenge_gfinnovation.md
│ ├── commits_pattern.md
│ ├── commits_pattern_ptbr.md
│ └── digimon_list.md
├── other_codes/
│ ├── create_db.sql
│ └── digimon_list_generator.py
├── src/
│ ├── main/
│ │ └── java/
│ │ ├── com/
│ │ │ └── globalfinanceiro/
│ │ │ └── digimon_api/
│ │ │ ├── configuration/
│ │ │ │ └── SwaggerConfiguration.java
│ │ │ ├── controller/
│ │ │ │ └── DigimonController.java
│ │ │ ├── dto/
│ │ │ │ └── DigimonDTO.java
│ │ │ ├── initializer/
│ │ │ │ └── DatabaseInitializer.java
│ │ │ ├── model/
│ │ │ │ └── Digimon.java
│ │ │ ├── repository/
│ │ │ │ └── DigimonRepository.java
│ │ │ ├── service/
│ │ │ │ └── DigimonService.java
│ │ │ └── DigimonApiApplication.java
│ │ └── resources/
│ │ ├── static/
│ │ ├── templates/
│ │ ├── application.properties
│ │ ├── banner.txt
│ │ ├── digimons_data.json
│ │ └── logback-spring.xml
│ └── test/
│ └── java/
│ └── com/
│ └── globalfinanceiro/
│ └── digimon_api/
│ └── DigimonApiApplicationTests.java
├── target/ (IGNORED BY .GITIGNORE)
├── .gitignore
├── docker-compose.yaml
├── Dockerfile
├── HELP.md (IGNORED BY .GITIGNORE)
├── LICENSE
├── mvnw
├── mvnw.cmd
├── pom.xml
├── README.md
└── README_ptbr.md
.idea/
: IntelliJ IDEA configurations (ignored by.gitignore
)..mvn/
: Maven Wrapper.wrapper/
: Maven Wrapper configurations.maven-wrapper.properties
: Maven Wrapper properties.
developer_notes/
: Additional developer notes (ignored by.gitignore
).docs/
: Project documentation.images/
: Images used in the documentation.digimon-banner.jpg
: Project banner.digimonapi-docs.png
: API documentation.digimonapi-terminal.png
: Terminal showing the running API.
challenge_gfinnovation.md
: Challenge proposed by Global Financeiro.commits_pattern.md
: Commit pattern in English.commits_pattern_ptbr.md
: Commit pattern in Portuguese.digimon_list.md
: Initial list of Digimons in the project.
other_codes/
: Additional scripts used during the project.create_db.sql
: SQL script to create the database.digimon_list_generator.py
: Python script to generate the Digimon list.
src/
: Project source code.main/
: Main source code.java/
: Java source code.com/globalfinanceiro/digimon_api/
: Main project package.configuration/
: Project configurations.SwaggerConfiguration.java
: Swagger configuration.
controller/
: REST controllers.DigimonController.java
: API controller.
dto/
: DTOs (Data Transfer Objects).DigimonDTO.java
: DTO for Digimons.
initializer/
: Database initializer.DatabaseInitializer.java
: Database initializer.
model/
: Database entities.Digimon.java
: Digimon entity.
repository/
: JPA repositories.DigimonRepository.java
: Digimon repository.
service/
: Application services.DigimonService.java
: Digimon service.
DigimonApiApplication.java
: Main application class.
resources/
: Application resources.static/
: Static resources.templates/
: HTML templates.
application.properties
: Application configurations.banner.txt
: Startup banner.digimons_data.json
: Initial Digimon data.logback-spring.xml
: Logging configurations.test/
: Test code.java/
: Java test code.com/globalfinanceiro/digimon_api/
: Test package.DigimonApiApplicationTests.java
: Application tests.target/
: Maven output directory (ignored by.gitignore
)..gitignore
: Git configuration file to ignore files/directories.docker-compose.yaml
: Docker Compose configuration file.Dockerfile
: Docker configuration file.HELP.md
: Spring Boot help file (ignored by.gitignore
).LICENSE
: Project license.mvnw
: Maven Wrapper.mvnw.cmd
: Maven Wrapper.pom.xml
: Maven configuration file.README.md
: Project README file.README_ptbr.md
: Portuguese README file.
- Java 17 or higher.
- Docker and Docker Compose for containerization (optional but recommended).
- PostgreSQL (optional if using Docker).
Follow the steps below to run the project locally.
Make sure you have Docker and Docker Compose installed.
git clone https://github.com/BrunoTanabe/digimon-api.git
cd digimon-api
docker-compose up --build
This command will:
- Build the Spring Boot application image.
- Pull the PostgreSQL image.
- Start both containers and set up networking between them.
The API will be available at http://localhost:5431
.
The interactive API documentation can be accessed at http://localhost:5431/swagger-ui.html
.
If you prefer to run the application without Docker, follow the steps below (not recommended). Ensure you have Java 17 and PostgreSQL installed.
git clone https://github.com/BrunoTanabe/digimon-api.git
cd digimon-api
- Install PostgreSQL.
- Create a database called
digimonapi
. - Update the connection settings in
application.properties
if necessary.
mvn clean package
java -jar target/digimon-api-0.0.1-SNAPSHOT.jar
The API will be available at http://localhost:5431
.
The interactive API documentation can be accessed at http://localhost:5431/swagger-ui.html
.
Once the application is running, you can view the API documentation and test the endpoints through the Swagger UI. Below are some images of the running application.
GET /digimons
: Returns all Digimons.GET /digimons/id/{id}
: Returns a Digimon by ID.GET /digimons/name/{name}
: Returns Digimons matching the name.GET /digimons/level/{level}
: Returns Digimons matching the level.
POST /digimons
: Creates a new Digimon.-
Body:
{ "name": "Digimon Name", "img": "Image URL", "level": "Digimon Level" }
-
PUT /digimons/{id}
: Updates an existing Digimon.-
Body:
{ "name": "Updated Name", "img": "Updated Image URL", "level": "Updated Level" }
-
DELETE /digimons/{id}
: Deletes a Digimon by ID.
- Unit and Integration Testing: Develop tests to ensure code quality.
- Authentication and Authorization: Implement security for API routes.
- Pagination and Advanced Filters: Enhance search functionalities.
- Frontend: Develop a graphical interface to interact with the API.
See the How to Contribute? section for more details.
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! Feel free to submit pull requests, open issues, or suggest improvements.
- Fork the project.
- Create a new branch:
git checkout -b feature/new-feature
. - Commit your changes:
git commit -m 'Add new feature'
. - Push to the branch:
git push origin feature/new-feature
. - Open a Pull Request.
- Name: Bruno Tanabe
- Email: [email protected]
- LinkedIn: linkedin.com/in/tanabebruno
I would like to express my sincere gratitude to GF Innovation for the opportunity to participate in the technical challenge and develop this project. 🚀