Blogging!
The journey in this extraordinary Programing career has been an interesting one albeit quite challenging. When I started this I never thought I'd reach this far in the game. Well, I'm still here! This is about my Javascript project. The javascript was the front end, while for the backend, rails were utilized.
My project choice was a blogging page in which Comments are left depending on the topic, of my choosing or a new topic by a registered user. so, to access the site, one has to register(authentication). Afterwhich, the user(here either to me or any other logged-in person), will be able to leave a comment on a post or comment on a post as the case may be. There are also options for liking the comments, updating comments, or deleting comments. Once logged in on the platform, the user can only update his/her comments but not the initiators' own comments.
I must say when I started to tweak with the API it was at first alien( I gotta taste of this in my first project which was a CLI project). Then the use of JSON was not bad either. Its organized clarity in displaying content within the API was superb!
Then somewhere along the way, I had to figure out how to configure the database model to interact with each of the files within the model folder. So I had the comment.rb, like.rb, post.rb, and user.rb the relationships between these model types were a real trial and error initially because I had to figure out how to describe the relationships e.g belongs_to and has_many, validating uniqueness and the likes: below is a sample of what I meant. we are looking at Fig 1, the post.rb model. and the comments.rb model in Fig 2.
Fig 1. showing the post.rb model
Fig 2. swowing the comments.rb model
Fig 1 and Fig 2 illustrate the relationship between the user's posts with that of the user's comments respectively.
In conclusion, I look forward to trying these MVC model techniques using the react application to perhaps repeat something similar to compare the versatility of both Javascript and react in building API related applications and/or solutions in the future
Comments
Post a Comment