A small REST API with CRUD functionalities to manage Real State listings.
- Spring Boot 3
- MongoDB
- Java 17
- Maven
- Docker
Connection to MongoDB
can be configured through environment variables, DB_URL
, DB_USER
and DB_PASS
.
-
GET
/api/listings/{countryCode}Parameters
Query
- page:
integer
(optional) default = 0 - size:
integer
(optional) default = 50
- page:
Path
- countryCode :
String
- countryCode :
Response
- A
List<ListingReponse>
of givensize
containing the listings filtered bycountryCode
in pagepage
- A
-
GET
/api/listings/{countryCode}/{city}Parameters
Query
- page:
integer
(optional) default = 0 - size:
integer
(optional) default = 50
- page:
Path
- countryCode :
String
- city:
String
- countryCode :
Response
- A
List<ListingReponse>
of givensize
containing the listings filtered bycountryCode
andcity
in pagepage
- A
-
GET
/api/listings/{countryCode}/{city}/{neighborhood}Parameters
Query
- page:
integer
(optional) default = 0 - size:
integer
(optional) default = 50
- page:
Path
- countryCode :
String
- city:
String
- neighborhood:
String
- countryCode :
Response
- A
List<ListingReponse>
of givensize
containing the listings filtered bycountryCode
,city
andneighborhood
in pagepage
- A
-
Parameters
Path
- id:
String
- id:
Response
ListingReponse
-
POST
/api/listingsParameters
Body
ListingRequest
Response
ListingReponse
-
Parameters
Path
- id:
String
- id:
Body
ListingRequest
Response
ListingReponse
-
DELETE
/api/listings/{id}Parameters
Path
- id: String
Response
ListingReponse
-
Parameters
Path
- id:
String
- id:
Response
- id:
String
- id:
-
Parameters
Path
- id:
String
- id:
Response
- id:
String
- id:
You can run the spring boot app by typing the following commands:
mvn spring-boot:run
The server will start on port 8080
.
You can also package the application in the form of a jar
file and then run it like so:
mvn clean package
java -jar target/RealState-1.0.jar