r/learnjava • u/lookinboy2 • Mar 21 '20
Just completed my first project and looking for criticism
Hey everybody I just finished my project and I’m looking for constructive criticism. Please roast it as I know there is probably a lot wrong and I want to learn. I’d like to say now that some stuff is honestly just unfinished. I’ve got to a point where I’m happy with it and may return to it but I honestly want to move to something else (mainly learn JavaScript/react to build a full stack REST api). So with all that out of the way please have at it!
Link to live site: http://skins-talk.herokuapp.com
Link to code: https://github.com/kyle-judd/redskins-forum
6
u/abhi_learner Mar 21 '20
First of all Congrats on your first project. What resources did you mainly use to learn java, and also that helped you to build this project ?
5
u/lookinboy2 Mar 21 '20
Thanks a lot! The resources I’ve used are the MOOC (2013), Udemy (Chad Darby’s Spring + Hibernate course), this sub, r/javahelp, r/LearnProgramming, and a whole lot of google! Also some YouTube videos!
1
u/abhi_learner Mar 21 '20
Thanks mate. I'm using the same learning resources, hopefully I'll build a project soon.
5
u/kamatamey Mar 21 '20
I have seen very few hobby projects to be having this kind clarity in design. So kudos!!
However few things that i noted (though I might be nitpicking):
You can compile regex pattern only once and use it for validation.
You can hold your static images in a single resource folder. Currently they just lying around in root folder
I kind of had an impression that you are storing raw images in sql db.
2
u/lookinboy2 Mar 21 '20
Thanks a lot I appreciate it!
Thanks that’s really useful!
I’m not sure how those images got at the root of the folder to begin with honestly. I’m using a PaaS called Cloudinary to handle my image hosting. But you’re right they shouldn’t be there! I’ll get rid of them.
For MySQL I’m just storing paths and file names for my images, not raw files. As far as my understanding this was the best way. Is that wrong? Thanks!
3
u/buckning Mar 21 '20
Congrats on completing your project! I would suggest that you look into automated testing for your project. It will help you from accidentally breaking things when you make changes and is a valuable skill to have professionally. Take a look at JUnit, SpringBootTest and Mockito
3
u/lookinboy2 Mar 21 '20
Thank you! I agree I definitely need to learn unit testing. It probably would have saved me a lot of headache lol.
1
u/sniR_ Apr 10 '20
Just curious why didnt you mention TestNG as I recently learned it
2
u/buckning Apr 10 '20
TestNG is really good too but JUnit is more common and there seems to be more support for it. I think JUnit is a bit easier to work with Spring too. There are some features, like data providers in TestNG, that I really like. I prefer to use TestNG for integration testing too. I find JUnit test lifecycle is a bit clunky since @BeforeClass is static and @Before is non static so it makes your test code more complicated. In TestNG both are non static so it makes your tests easier to follow. Both are great tools and both have advantages and disadvantages so I suggest that you experiment with both of them.
1
1
1
u/hamstrdethwagon Mar 21 '20
I got 500 error when I tried to make an account
2
u/lookinboy2 Mar 21 '20
Hey just wanted to say I believe I fixed the bug and thanks again for letting me know!
1
u/lookinboy2 Mar 21 '20
Hmm that’s interesting. I just changed the Post method for creating an account last night and I believe I know what the issue is. Thanks for letting me know!
2
u/Deathbyfapfap Mar 21 '20
Looks good OP. I recommend getting the Sonarlint plugin. It will inspect your code and make suggestions. I’m a software engineer with 6+ years experience in Java and sonarlint still helps me to this day. I think ya actually does more coding than I do.
Keep up the good work.
1
u/SuspectedLumber Mar 22 '20
What does this project do?
I'm curious about how you hook it up to a website. And why hook it up to a website - why is it advantageous to writing it in something like Javascript.
I'm also new, but have been mostly focusing on Android things.
Thanks.
1
u/blabbities Mar 22 '20
My only criticism is that you couldnt have picked a better team? Just kidding I dont watch football. Though, I'm sure you gotta get some guff.
0
u/rahulchandak Mar 21 '20
Looks nice, also can you share details of how and what you use to deploy.
2
u/lookinboy2 Mar 21 '20
I used Heroku. It’s extremely simple it’s basic a git repository and you just push your code to it!
7
Mar 21 '20
[removed] — view removed comment
2
u/lookinboy2 Mar 21 '20
Thanks a ton for your words and all your feedback! I’ve addressed some of these valid concerns in responses to some others comments. If you’d like to take a lot and reply I would greatly appreciate it! As for using JSP it was the first thing that I learned but after really using it I’m exiting to try something else because it can be clunky at times imo. Anyways thanks again for your suggestions!
25
u/argio Mar 21 '20
Your code looks good. The design and structure makes sense and the naming. One very very important thing - never ever push sensitive data:
spring.mail.username=[email protected]=qxvnlwaqmbgpybkd
There are bots that scan github for keys emails password. If this was your data it is compromised.