Java Spring Boot REST API Project
"Taste It" API contains information about the most loved and most popular dishes in different countries. In this API you will find information about the country that interests you and about those national dishes that you should definitely try there.
- Written in Java Spring Boot
- Spring Data JPA for working with database
- Spring Security for authentication and access-control
- BCrypt password encoder for encode password
- JWT Token for authentication
- Lombok to avoid writing repetitive Java code and/or boilerplate code
- Spring Boot Validation to validate Data Access Objects in request
- ModelMapper for Object mapping
- Maven for dependency management and building project
- H2 database for testing mode
- MySQL database for production mode
- Design Patterns: Singleton, Builder, Dependency Injection, Three Layer Architecture
- TDD with integration testing
- Amazon Web Servisec for storage database
- Heroku for storage server side API
Request that return multiple items will be limited to 25 results by default. You can access other pages using the ?page paramater.
https://tasteit-api.herokuapp.com/api/1/countries/page?pageNo=0
https://tasteit-api.herokuapp.com/api/1/countries/page
To get the Countries from the API, you can apply several filters using url parameters, the available options are listed below.
| Param | Type | Default | Example |
|---|---|---|---|
| pageNo | number | 0 | ?pageNo=0 |
| pageSize | number | 25 | ?pageSize=10 |
| sortBy | id/name | id | ?sortBy=name |
| sortDir | asc/desc | asc | ?sortDir=desc |
https://tasteit-api.herokuapp.com/api/1/countries/1
https://tasteit-api.herokuapp.com/api/1/countries/name/slovenia
https://tasteit-api.herokuapp.com/api/1/countries/random
https://tasteit-api.herokuapp.com/api/1/countries/1/dishes
https://tasteit-api.herokuapp.com/api/1/countries/1/comments
https://tasteit-api.herokuapp.com/api/1/auth/signup
Method: Post
Request body:
{"userName": "your userName",
"email": "your email",
"password": "your password"}
https://tasteit-api.herokuapp.com/api/1/auth/login
Method: Post
Request body:
{"userNameOrEmail": "your userName or email",
"password": "your password"}
https://tasteit-api.herokuapp.com/api/1/countries/{countryId}/comments
Method: Post
Header: "Authorization: Bearer yourBearerToken"
Request body:
{"name": "your name",
"email": "your email",
"body": "your comment"}
https://tasteit-api.herokuapp.com/api/1/comments/{commentId}
Method: Put
Header: "Authorization: Bearer yourBearerToken"
Request body:
{"name": "your name",
"email": "your email",
"body": "your edited comment"}
https://tasteit-api.herokuapp.com/api/1/comments/{commentId}
Method: Delete
Header: "Authorization: Bearer yourBearerToken"
https://tasteit-api.herokuapp.com/api/1/countries/{countryId}/rating
Method: Post
Request body:
{"ip": "your ip",
"rating": your rating (number from 1 to 5)}
https://tasteit-api.herokuapp.com/api/1/user/countries/{countryId}
Method: Post
Header: "Authorization: Bearer yourBearerToken"
Request body:
{"userNameOrEmail": "your userName or email"}
https://tasteit-api.herokuapp.com/api/1/user/countries/{countryId}
Method: Delete
Header: "Authorization: Bearer yourBearerToken"
Request body:
{"userNameOrEmail": "your userName or email"}
https://tasteit-api.herokuapp.com/api/1/user/countries?userNameOrEmail={yourUserNameOrEmail}
Method: Get
Header: "Authorization: Bearer yourBearerToken"
https://tasteit-api.herokuapp.com/api/1/user/dishes/{dishId}
Method: Post
Header: "Authorization: Bearer yourBearerToken"
Request body:
{"userNameOrEmail": "your userName or email"}
https://tasteit-api.herokuapp.com/api/1/user/dishes/{dishId}
Method: Delete
Header: "Authorization: Bearer yourBearerToken"
Request body:
{"userNameOrEmail": "your userName or email"}
https://tasteit-api.herokuapp.com/api/1/user/dishes?userNameOrEmail={yourUserNameOrEmail}
Method: Get
Header: "Authorization: Bearer yourBearerToken"
Tatiana Samoilenko
Israel
- Get Country By Name - done
- Get Random Country - done
- Get Countries By Сontinent
- Get All Dishes
- Get Random Dish
- To fill Database