First of all, I chose the h2 im memory database so that there is no need for installation. Then I looked at new sample projects from github that do auth operations with h2 database. I wasted some time trying to find a new and working project here. The last time I took a project with minor errors and fixed it. For example token was returning null, I fixed it. I changed the swagger path. I deleted unnecessary interfaces and features. I added the tests etc.
Then I coded the image service needs with a new controller.
I lost some time while writing the tests and I loaded the project without doing the tests related to image load because I didn't have time.
I think I spent 4 5 hours.
Note after 10.22.2021 00.30, image test has been added.
-
Make sure you have [Java 15] installed
-
Fork this repository and clone it
-
Navigate into the folder
-
Install dependencies
$ mvn install
-
Run the project
-
Navigate to
http://localhost:8080/insta
in your browser to check everything is working correctly. You can change the default port in theapplication.yml
file
server:
port: 8080
-
Make a POST request to
/auth/signup
-
After signup, make a POST request to
/auth/signin
-
Add the JWT token as a Header parameter with SWAGGER authorize button
-
Then you can use image controller for upload(only jpeg and png), list and load.