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 |
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.
git clone https://github.com/TjandraD/twittier
- Change your current directory to this project directory
cd {path to the project directory}
- 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)
- 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
- Type
- Install the required gem
bundle install
- Create .env file based on the skeleton at .env.example
- Run Tests
rspec
- Execute the command below
ruby main.rb
- Execute the command below
docker build -t YOUR_IMAGES_NAME .
docker run -p 4567:4567 -d YOUR_IMAGES_NAME
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
- Set value to
- Run the API Tests (using Collection Runner)
For a detailed documentation for this API, go check this Postman Documentation