LeonardMuia / trello-rails-api

Trello API Built on Ruby on Rails and React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trello API - Tech Assignment 2022

This is a full stack developer assignment 2022.

The sprint goals are generally creating a web application that interacts with Trello's API to perform actions like;

  • Creating cards on Trello.
  • Fetching lists.

Solution Implementation

In order to solve the challenge I perform the following key tasks:

  1. Creating a Trello Account and Reading the API Documentation
  2. Setting up the backend in Rails and Integrating Trello API
  3. Developing the frontend in React
  4. Performing tests on the API using Postman
  5. Interacting with the API using Ruby on Rails

Stack

This project is build using the following technologies.

  • React Frontend
  • Ruby on Rails Backend

Running this Web Application

Upon downloading the file or cloning this project on github, install the required libraries in both Ruby on Rails and React

Creating a Trello Account

In order to test this API you first need to have a Trello account.

If you don't have a Trello account follow this link to create one. If you have an account, create a board and in that board, create cards.

Check out this youtube video for guides on how to use Trello.

Generating Trello API Credentials

To generate API Credentials for your Trello Account, follow the guide provided in this article. You will need the following details from the Trello's API.

  • API Key
  • Access Token
  • Id of a Board
  • API URL

To learn how to get such data please read the Trello API Documentation

System Requirements

Make sure you have Ruby and Rails and Node.js installed in your computer. If you don't have them installed in your computer, follow the following guides:

  1. How to install Ruby on Rails
  2. How to install Node.js

Accessing Files

To get the files to this project in your computer, perform a git clone in your terminal or download a zipped file of the project on github.

git clone https://github.com/LeonardMuia/trello-rails-api.git

Installing Ruby on Rails Gems and Node.js Packages

To install gems required to run the Ruby on Rails app, run the following command in your terminal.

bundle install

Navigate to the frontend folder in your terminal and run the following command to install packages for the React app and build.

npm install && npm run build

API Credentials Required

Create a .env file in the root of your rails application and add the following code.

BASE_URL = "https://api.trello.com/1"
API_KEY=YOURAPIKEYGOESHERE
TOKEN=YOURTOKENGOESHERE
ID_BOARD=YOURIDBOARDGOESHERE

Start the rails server

Navigate to your root folder in the terminal and enter the following command to start the rails app.

rails s

Start the React server

Navigate to the frontend folder in the terminal and run the following command to start the react app.

npm run dev

Take note

Make sure it runs on port 5173 if not, find the Cors.rb and whitelist your localhost url for the React app by editing the origins. This will eliminate CORS error.

Finally, navigate to the URL provided in by the rails server to view your application.

Contributing

You can make changes however you like upon making a pull request. Have fun testing the application and customizing it to your needs. Cheers!!

About

Trello API Built on Ruby on Rails and React


Languages

Language:Ruby 70.1%Language:JavaScript 18.5%Language:CSS 9.6%Language:HTML 1.8%