Alexandros Atsalakis, Stavroula Kampylh, Evangelos Poulios
A REST API that will support basic needs for a renovation contractor agency. Some of its needs include:
- the employees - managers of its platform to have access to information concerning customers and repairs
- ability for customers to oversee the progress of repair/renovation work on their property.
A. Select one of the following options:
- Clone it
- Download it as ZIP file
B. Manually create a database with name "Team1Technico"
C. Run the application from your preferable IDE
D. Use the application and interact with the REST API either by:
- importing to the Postman the collection of the requests
- using the Swagger interface provided in the "http://localhost:8080/swagger-ui/index.html"
E. In each case you have firstly to log in with valid credentials. On application start up 2 instances of users are being created: user1(username: john, password: 1234, role: ROLE_ADMIN), user2(username: jake, password:1234, role: ROLE_MODERATOR)
Postman
- The first time when you have to log in, with postman you need to request: localhost:8080/api/login, by providing query params: username: usernameValueOfYourUser, password: passwordValueOfYourUser
- Then, you should include in each request a header with (key,value) : ("Authorization", "Bearer " + the accessToken that you got from the client)
Swagger UI
- The first time when you have to log in, with Swagger UI you have to send the request (http://localhost:8080/api/login?username=usernameValueOfYourUser&password=passwordValueOfYourUser) through browser
- Afterwards, you have to install a browser extension like ModHeader for Chrome. The extension enables the option for custom request and response http headers. And you follow the same procedure (like Postman) where, you should include in each request header a header with (key,value) : ("Authorization", "Bearer " + the accessToken that you got from the client)
Watch a quick demo video
- Java 17
- Spring Framework
- MS SQL Server
- JSON Web Token
- Swagger
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request