
Getting Started - CI/CD Pipeline - API Endpoints - Contribute
DummyData API is a flexible and easy-to-use API designed to provide developers with realistic mock data for testing and prototyping applications. With support for multiple languages (English, French and Portuguese) and customizable data sets, DummyData API helps developers simulate real-world data environments.
- Java 17.0.10
- Maven
- Git
First, clone the repository:
git clone [email protected]:marceloxhenrique/DummyData-API.git
cd <your-project-name>
mvn install
spring.application.name=dummydata
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.messages.basename=messages
spring.messages.encoding=UTF-8
spring.data.web.pageable.max-page-size=999999999
The app run on port 8080 by default.
mvn spring-boot:run
CI / CD pipeline using GitHub Actions.
-
Run Tests on push to Dev branch:
This workflow is triggered on every push to the
dev
branch. It runs the tests to ensure that the code is working as expected. The tests are run using JDK 17 and Maven. -
Deploy App on pull request to Main branch:
This workflow is triggered when a pull request is made to the
main
branch. It builds the project using Maven, creates a Docker image, and pushes the image to Docker Hub. Additionally, it triggers the deployment on Render, which deploys the application using the newly built Docker image version.
List of endpoints availables
route | description |
---|---|
GET /api/users | retrieve 100 users user |
GET /api/users/1 | retrieve a specific user by id user |
GET /api/comments | retrieve 100 comments comment |
GET /api/comment/1 | retrieve a specific comment by id comment |
GET /api/images | retrieve 100 images image |
GET /api/images/1 | retrieve a specific image by id image |
{
"id": 1,
"username": "markbradley",
"firstName": "Mark",
"lastName": "Bradley",
"birthDate": "1995-05-15",
"phone": "+1 202 555 1234",
"email": "[email protected]",
"address": {
"country": "United States of America",
"state": "California",
"city": "Los Angeles",
"street": "123 Elm Street",
"postalCode": "90001"
},
"role": "User"
} ... more 99 users
{
"id": 1,
"userId": 1,
"title": "Great Team Meeting!",
"body": "I really enjoyed our team meeting today. The new project ideas were fantastic, and I appreciate everyone's input.",
"createdAt": "2024-09-01T10:45:23"
} ... more 99 comments
{
"id": 1,
"userId": 1,
"url": "https://picsum.photos/900",
"width": 900,
"height": 900,
"title": "Captured Moment"
} ... more 99 images
Size: Use the size parameter to specify the number of records you want to retrieve, ranging from 1 to 100.
Lang: Use the lang parameter to choose the language of the data:
- en - for English
- fr - for French
- pt - for Portuguese (Brazilian)
Example:
route | description |
---|---|
GET /api/users?size=2 | retrieve 2 users user |
GET /api/users?lang=fr | retrieve 100 users in French user |
GET /api/users?lang=fr&size=2 | retrieve 2 users in French comment |
[
{
"id": 1,
"username": "markbradley",
"firstName": "Mark",
"lastName": "Bradley",
"birthDate": "1995-05-15",
"phone": "+1 202 555 1234",
"email": "[email protected]",
"address": {
"country": "United States of America",
"state": "California",
"city": "Los Angeles",
"street": "123 Elm Street",
"postalCode": "90001"
},
"role": "User"
},
{
"id": 2,
"username": "janefoster",
"firstName": "Jane",
"lastName": "Foster",
"birthDate": "1991-08-22",
"phone": "+1 305 555 5678",
"email": "[email protected]",
"address": {
"country": "United States of America",
"state": "Florida",
"city": "Miami",
"street": "456 Maple Avenue",
"postalCode": "33101"
},
"role": "Admin"
}
]
{
"id": 1,
"username": "jeandupont",
"firstName": "Jean",
"lastName": "Dupont",
"birthDate": "1995-05-15",
"phone": "+33 1 23 45 67 89",
"email": "[email protected]",
"address": {
"country": "France",
"state": "Île-de-France",
"city": "Paris",
"street": "123 Rue de la Paix",
"postalCode": "75001"
},
"role": "Utilisateur"
} ... more 99 users in French
[
{
"id": 1,
"username": "jeandupont",
"firstName": "Jean",
"lastName": "Dupont",
"birthDate": "1995-05-15",
"phone": "+33 1 23 45 67 89",
"email": "[email protected]",
"address": {
"country": "France",
"state": "Île-de-France",
"city": "Paris",
"street": "123 Rue de la Paix",
"postalCode": "75001"
},
"role": "Utilisateur"
},
{
"id": 2,
"username": "mariedurand",
"firstName": "Marie",
"lastName": "Durand",
"birthDate": "1991-08-22",
"phone": "+33 4 56 78 90 12",
"email": "[email protected]",
"address": {
"country": "France",
"state": "Provence-Alpes-Côte d'Azur",
"city": "Marseille",
"street": "456 Avenue du Prado",
"postalCode": "13008"
},
"role": "Administrateur"
}
]
If you want to contribute, clone this repo, create your work branch and get your hands dirty!
-
git clone [email protected]:marceloxhenrique/DummyData-API.git
-
git checkout -b feature/NAME
-
Follow commit patterns
-
Open a Pull Request explaining the problem solved or feature made, if exists, append screenshot of visual modifications and wait for the review!
http://localhost:8080/swagger-ui/index.html
