r/javahelp • • Sep 02 '19

Roast my project.

Hello Java helpers. I need help today, hence reaching out to you guys. Hope this post won't be taken down (Thank you very much mods).

Let me start with a backstory. I graduated 3 years back with bachelors in Mechanical engineering. However due to my strong interest in computers and coding, I decided to switch career after quitting my job about an year ago. I used to develop Android applications on small scale during my final year of college. So I had experience with Java back then. Then after I took up a non-c.s. job for couple years, I kinda drifted away from all that. After quitting my job, I decided to bounce back and start from the scratch. So I've learned Java (again), Spring framework and some of it's modules, MySQL, Hibernate, some frontend stuff inlcuding Bootstrap and JS basics.

Before I apply for jobs, I decided to do a project out of self-interest based on the technologies that I've learnt and today I was able to complete a part of it.

So, I play Pokémon Go and there are in-game events like raids, egg hatches, special research encounters, research tasks and many more. What I've done is created a rest-api that provides these details in json payloads. There are many websites that already host these details like Silphroad, Leekduck, Pokemon GO hub and many others. However I wanted to implement a rest-api for the same.

I happily present to you: PokéGo API V2

Source code is available at GitHub.

Experienced devs of this group, I request you to please perform a code review on my project when you have some time to spare and help me by pointing out what did I do wrong, what missed, what are the areas of improvement, e.t.c. I want to be able to train myself to develop and deliver industry standard applications and be able to face interviews with confidence. Your point outs, tips, reviews, comments, e.t.c will help me improve myself as a developer. Please go brutal on me.

Not only me, but others also can take a look at my project, combined with your inputs and be able to learn few things, avoid rookie mistakes and stuff. Your inputs will help me and others a lot, lot, lot in career.

I'm also planning to take this project as a mainstream application, combined with few other big features later down the road. If anybody is interested in contribution to this project, I'll be very happy to collaborate with you.

Thank you very very much for all of your time guys.

36 Upvotes

6 comments sorted by

8

u/bitNation Sep 02 '19

I took a quick look through some of the classes. Nice use of Spring Security, aspects for logging, batch, and data JPA. That's quite a bit to get your head around if you've never done it before.

7

u/[deleted] Sep 02 '19

I've learnt spring modules one by one and implemented small standalone applications for each module. When I was staistfied with them, I started intregrating various modules into the main project. And thank you for your time! :)

3

u/[deleted] Sep 02 '19

I'll take a look at it in the next hour or so

2

u/[deleted] Sep 02 '19

Thank you very much! Appreciate it :)

4

u/[deleted] Sep 02 '19

Impressive for self-taught. It's very thorough and you're using quite a few modules that most beginners would not wrap their head around

One area that caught my eye that could use some beefing up is the unit testing. Generally you will want JUnit tests for each component (excluding models) that have 80-90 percent code coverage. Learn Mockito so you can mock dependencies and stub out their methods. If you really want to get thorough with it you can look into mutation testing as well, but afaik most shop's aren't doing mutation coverage yet.

Also consider favoring setter injection over constructor injection unless you need to run any special logic in the constructor to instantiate the component. IIRC spring currently recommends setter injection because it allows for beans to be re-injected at runtime (probably not relevant to your project, but it's just a best practice).

Really though, this is an impressive project. I might dig in deeper later and see what else I can find, but sorry I'm out of time atm

2

u/[deleted] Sep 02 '19

Thank you very much for the inputs. I agree with you on testing. I've only learned JUnit5 basics and it is not my cup of tea yet. But yes, will be focusing on that more as I want to learn CI/CD gradually. Regarding the injection method, I remember reading in couple of articles that for dependencies that are must, const injection is favoured instead of setting/field injection.

Many thanks for taking your time out for this. Will be looking forward for more. Appreciate the help!! :)