GigihHub is a simple social media to share information with other people in the same community. This repository contains GigihHub APIs, built in Ruby without any frameworks ๐ค๐. This project is intended for learning purposes in Model-View-Controller (MVC) design pattern, practicing Test Driven Development (TDD), and Clean Code.
The Gigih Hub Social Media contains six functional requirements.
- Saves user details (username, email, bio)
- Lets user make a new post with hashtag
- Lets user comment in a post with hashtag
- Lets user attach media (jpg, png, mp4) in a post or comment
- Lets user get posts with a hashtag
- Shows 5 trending hashtags
There are four tables created in the database.
- User, represents our social media user which contains user informations.
- Post, represents user's post. A post with
parent_post_id
is a comment to the parent post, meanwhile a parent withoutparent_post_id
is the parent post. - PostHashtag, represents the pivot entity of Post and Hashtag.
- Hashtag, represents hashtag (text initialized with
#
) in a post.
- Ruby v3.0.1
- MySQL
These libraries are bundled in a Gemfile
.
- Sinatra, for simple web server
- Mysql2, for database connector
- RSpec, for unit test
- SimpleCov, for test coverage
- Rubocop, for code linter, based on Ruby Guide Style
(TBD)