https://github.com/miusarname2/ruby_testfrogmii
A short technical test of Frogmi
https://github.com/miusarname2/ruby_testfrogmii
rails react ruby ruby-on-rails
Last synced: 2 months ago
JSON representation
A short technical test of Frogmi
- Host: GitHub
- URL: https://github.com/miusarname2/ruby_testfrogmii
- Owner: miusarname2
- Created: 2024-04-06T16:58:54.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-27T14:07:07.000Z (about 2 years ago)
- Last Synced: 2025-03-30T16:46:46.252Z (over 1 year ago)
- Topics: rails, react, ruby, ruby-on-rails
- Language: Ruby
- Homepage: https://ruby-testfrogmii.onrender.com
- Size: 225 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Technical Challenge - Seismic Data Application
Hello Oscar Mauricio! Welcome to the technical challenge for our application. Please submit your solution by April 15, 2024.
## Objectives
- Develop an application in Ruby or a Ruby-based framework that includes a Task for obtaining and persisting seismic data and an API exposing two endpoints for external client consumption.
- Develop a simple HTML5 and JavaScript webpage to query the API endpoints. Bonus points for using EmberJS, React, AngularJS, or VueJS frameworks.
## Getting Started
1. Ensure you have Ruby and the necessary dependencies installed on your system.
2. Clone this repository to your local machine.
3. Run migrations to set up the database:
```bash
rails db:migrate
```
4. Start the application server:
```bash
rails server
```
## Backend Development
### 1. Obtaining and Persisting Data
Develop a Task to obtain seismic data from the USGS site (earthquake.usgs.gov) in GeoJSON format. Persist the following data in the database:
- `id`
- `properties.mag`
- `properties.place`
- `properties.time`
- `properties.url`
- `properties.tsunami`
- `properties.magType`
- `properties.title`
- `geometry.coordinates[0]` (longitude)
- `geometry.coordinates[1]` (latitude)
Ensure data validation and uniqueness when running the Task.
### 2. REST API Endpoints
Develop two endpoints:
#### 2.1 GET List of Features
- Expose data in the specified format.
- Allow filtering by `mag_type`, `page`, and `per_page` parameters.
#### 2.2 POST Create a Comment
- Create a comment related to a feature based on the payload.
- Validate the payload and persist each comment.
## API Usage
To access the API endpoints:
- GET features: `http://localhost:3000/earthquakes.json`
- POST comments: `http://127.0.0.1:3000/comments.json`
- Body JSON format:
```json
{
"body": "This is a comment",
"feature_id": 2
}
```
## Frontend Access
- Homepage: `http://localhost:3000/` or `/`
- Create a Comment: `http://localhost:3000/comments/new` or `/comments/new`
- Filter Features: `http://localhost:3000/earthquakes/1` or `/earthquakes/1`
The frontend for this application was developed in React and is located in the "earthquake-front" branch.
Thank you for participating! We look forward to reviewing your solution.