/twittier

A social media app. It's like Twitter, but it's not Twitter. My final project in Generasi GIGIH

Primary LanguageRubyMIT LicenseMIT

Twittier

Table of Content

Content
Brief Description
How Clone The Repo
Requirements to Run The App
Commands Before Run The App
Run Tests and App
API Testing
API Documentation

Brief Description

Twittier is created as a social media application which can be used to share information with other people. This application will only be used by people that work in a certain company so we cannot use existing public social media.

Clone This Repo First Before Doing Any Other Steps Below

  • git clone https://github.com/TjandraD/twittier
  • Change your current directory to this project directory cd {path to the project directory}

Requirements to Run The App Locally

  • MySQL (check this link for the installation process)
    sudo apt update
    sudo apt install mysql-server libmysqlclient-dev
    
  • Ruby (go check rbenv for installing Ruby)
  • Bundler (check this link for installation process)

Steps to Do Before Run The App

  • Create MySQL Database
    • Type mysql in your terminal
    • Once you get inside the MySQL CLI, type CREATE DATABASE {your preferred database name}
    • Exit the MySQL CLI by typing exit
    • Import the database schema mysql -u {your MySQL username} {your database name} < db_twittier.sql, make sure your current working directory is inside this project directory
  • Install the required gem bundle install
  • Create .env file based on the skeleton at .env.example

Run Tests Suit and Application

  • Run Tests rspec

Run The App Manually

  • Execute the command below
ruby main.rb

Run The App With Docker

  • Execute the command below
docker build -t YOUR_IMAGES_NAME .
docker run -p 4567:4567 -d YOUR_IMAGES_NAME

API Testing

For this project, Postman Collection was used to test the API endpoints.

  • Go check the collection file at this link
  • Import that file into your Postman (Go check Importing data into Postman)
  • Add environment variables containing the root url into Postman (check Variables quick start)
    • Set value to http://35.243.114.125:4567/api for the production url
    • If you would like to run it locally, set the value to 127.0.0.1:4567/api
  • Run the API Tests (using Collection Runner)

API Documentation

For a detailed documentation for this API, go check this Postman Documentation