Coder Social home page Coder Social logo

rgxcp / geegeety Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 175 KB

๐Ÿ’ช [END OF LIFE] Geegeety (Generasi GIGIH Tweety) โ€” A Twitter-like social media for #GenerasiGIGIH

Home Page: http://172.104.182.135:4567

License: MIT License

Shell 0.29% Ruby 99.71%
gojek generasigigih generasi-gigih yabb

geegeety's Introduction

๐Ÿ’ช 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

geegeety's People

Contributors

rgxcp avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.