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.
In order to solve the challenge I perform the following key tasks:
- Creating a Trello Account and Reading the API Documentation
- Setting up the backend in Rails and Integrating Trello API
- Developing the frontend in React
- Performing tests on the API using Postman
- Interacting with the API using Ruby on Rails
This project is build using the following technologies.
- React Frontend
- Ruby on Rails Backend
Upon downloading the file or cloning this project on github, install the required libraries in both Ruby on Rails and React
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.
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
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:
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
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
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
Navigate to your root folder in the terminal and enter the following command to start the rails app.
rails s
Navigate to the frontend folder in the terminal and run the following command to start the react app.
npm run dev
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.
You can make changes however you like upon making a pull request. Have fun testing the application and customizing it to your needs. Cheers!!