Skip to content
/ geegeety Public

💪 [END OF LIFE] Geegeety (Generasi GIGIH Tweety) — A Twitter-like social media for #GenerasiGIGIH

License

Notifications You must be signed in to change notification settings

rgxcp/geegeety

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💪 Geegeety

Geegeety (Generasi GIGIH Tweety) — A Twitter-like social media for #GenerasiGIGIH.

Status

END OF LIFE

Unit Tests: 100% (58 examples, 0 failures)

Code Coverage: 100% (24 files in total, 811 relevant lines, 811 lines covered, 0 lines missed)

Problems Description

#GenerasiGIGIH students need a brand new, private social media for sharing information with others.

This will be an API only social media, so there's no GUI for it.

This API must be able to provide the following features, where:

  1. User able to store their username, email, and bio description.
  2. User able to create a post that might contain hashtag(s).
  3. User able to see all posts that contain a certain hashtag.
  4. User able to see the list of trending hashtags (top 5 posted hashtags in the past 24 hours).
  5. User able to comment on a post that also might contain hashtag(s).
  6. User able to attach things to a post.

ERD Design

ERD Design

Requirements

  1. Ruby
  2. MySQL/MariaDB
  3. Postman

Gems

  1. mysql2
  2. rack-test
  3. rspec
  4. simplecov
  5. sinatra
  6. thin

How To

Run the App Locally

  1. Make sure all requirements are installed.

    $ ruby --version # 3.0.1
    $ gem --version # 3.2.15
    $ bundle --version # 2.2.15
    $ mysql --version # 15.1
    $ which postman # /usr/bin/postman
  2. Clone this repository to your desired location.

    $ git clone https://github.com/rgxcp/geegeety.git
  3. Change your directory into the project.

    $ cd geegeety
  4. Install the Gem dependencies.

    $ bundle install
  5. Create a new database.

    $ mysql -u `your-username` -p
    $ CREATE DATABASE geegeety_db;
    $ exit
  6. Import the provided database schema.

    $ mysql -u `your-username` -p geegeety_db < app/migration/geegeety_db.sql
  7. Copy the provided .env.example file to .env.

    $ cp .env.example .env
  8. Change the .env file according to your machine setup.

    # .env
    export APP_ENV="development"
    export GEEGEETY_HOST="localhost"
    export GEEGEETY_USERNAME="your-username"
    export GEEGEETY_PASSWORD="your-password"
    export GEEGEETY_DATABASE="geegeety_db"
  9. Load the .env file to your environment variables.

    $ source .env
  10. Run the server.

    $ rackup -p 4567 # accessible through http://localhost:4567

    In case the above command doesn't work, run the following command:

    $ bundle exec rackup -p 4567 # accessible through http://localhost:4567
  11. Hit the API endpoints using Postman and do-what-you-want-with-it!

Run the App Tests

  1. Make sure:

    • All requirements are installed.
    • All Gem dependencies are installed.
    • You're in the root project folder.
  2. Run the following command:

    $ rspec -fd

    In case the above command doesn't work, run the following command:

    $ bundle exec rspec -fd

Run the Postman Collection Tests

  1. Make sure the app is running properly in your local.
  2. Import the Geegeety.postman_collection.json file to Postman.
  3. Click the Run button inside the Geegeety collection folder in Postman.

API Endpoints

Method URL Params (Body) Description
GET /api/v1/hashtags/trending
  • None
Get trending hashtags
GET /api/v1/hashtags/:name/posts
  • None
Get posts from a hashtag
POST /api/v1/users
  • username (Required)
  • email (Required)
  • bio (Required)
Create a new user
POST /api/v1/posts
  • user_id (Required)
  • body (Required)
  • attachment (Optional)
Create a new post
POST /api/v1/posts/:post_id/comments
  • user_id (Required)
  • body (Required)
  • attachment (Optional)
Create a new comment

About

💪 [END OF LIFE] Geegeety (Generasi GIGIH Tweety) — A Twitter-like social media for #GenerasiGIGIH

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published