This is a Ruby on Rails API for managing properties.
This API requires Ruby version 3.2.2. Make sure you have it installed before proceeding.
Ensure that the following dependencies are installed on your system:
- Ruby 3.2.2
- Rails 7
- PostgreSQL 15
-
Clone this repository to your local machine:
git clone https://github.com/misheck12/property-api.git
-
Navigate to the project directory:
cd property-api
-
Install the required gems by running the following command:
bundle install
-
Create a database configuration file (
config/database.yml
) and provide the necessary credentials for connecting to your PostgreSQL database.
To create and set up the initial database schema and seed data, run the following commands:
rails db:create
rails db:migrate
You can run the test suite using the following command:
bundle exec rspec
This API integrates with the following services:
- Job queues: Sidekiq (https://sidekiq.org/)
- Cache server: Redis (https://redis.io/)
- Search engine: Elasticsearch (https://www.elastic.co/)
Make sure you have these services set up and running before starting the API.
To deploy this API to a production environment, follow these steps:
-
Set up a production database configuration (
config/database.yml
) with the appropriate credentials. -
Configure your production environment variables in a file like
.env.production
or use a deployment tool like Capistrano (https://capistranorb.com/) or Docker (https://www.docker.com/) to manage environment variables. -
Precompile the assets by running the following command:
rails assets:precompile RAILS_ENV=production
-
Start the Rails server in production mode:
rails server -e production
This API provides a Swagger documentation interface for easy testing and exploration. To access Swagger, follow these steps:
-
Start the Rails server:
rails server
-
Open your web browser and visit the following URL:
http://localhost:3000/swagger
This will open the Swagger UI where you can view and interact with the API endpoints.
This project is licensed under the MIT License.