Welcome to Sismo App, an application that retrieves and delivers reports on seismological events around the world.
This README document covers the necessary steps to get the application up and running.
This project is developed using Ruby version 3.2.3.
Make sure you have the following dependencies installed on your system:
- Ruby 3.2.3
- Rails 7.1.3.2
- SQLite3
- Puma web server
Additionally, ensure you have rest-client
, ffi
, and will_paginate
gems installed.
Clone the project repository to your local machine:
git clone <repository_url>
Navigate to the project directory:
cd <project_directory>
Install gem dependencies:
bundle install
The project uses SQLite3 as the database for Active Record. To create the database, run the following command:
rails db:create
Once the database is created, you can initialize it by running migrations:
rails db:migrate
To run the test suite, execute the following command:
rails test
No additional services are required to run this application.
To deploy this application, you can follow standard Rails deployment procedures. Ensure to set up your production environment configuration appropriately.
That's it! Your project should now be set up and ready to run.
-
Get all features
- Endpoint:
GET /api/features
- Description: Retrieves a list of all features available in the system.
- Endpoint:
-
Get all comments of a particular feature
- Endpoint:
GET /api/comments/feature/:feature_id
- Description: Retrieves all comments associated with a specific feature identified by
feature_id
.
- Endpoint:
-
Create a comment
- Endpoint:
POST /api/comments
- Description: Creates a new comment for a feature.
- Request Body: JSON object with the following parameters:
feature_id
: ID of the feature the comment belongs to.body
: Text content of the comment.
- Endpoint:
-
Update a comment
- Endpoint:
PUT /api/comments/:comment_id
- Description: Updates an existing comment identified by
comment_id
. - Request Body: JSON object with the following parameter:
body
: Updated text content of the comment.
- Endpoint:
-
Delete a comment
- Endpoint:
DELETE /api/comments/:comment_id
- Description: Deletes a comment identified by
comment_id
.
- Endpoint:
- Success Response: HTTP status code 200 OK for successful requests.
- Error Response: HTTP status codes indicating the type of error occurred, along with a relevant error message in the response body.
This API does not require authentication for accessing the endpoints. However, ensure proper authorization mechanisms are implemented in your application if needed.
There are currently no rate limits enforced on this API. However, consider implementing rate limiting on your client-side to prevent abuse.
This documentation corresponds to version 1 of the API. Any future updates or changes will be documented accordingly.