Skip to content

JudahSan/medimartxpress

Repository files navigation

UHM Ordering System - Ruby on Rails Backend

Introduction

Project Setup

Sure, here's a basic guide to help someone set up the Rails project on their local development environment:

  1. Clone the Repository:

    • If the Rails project is already hosted on a version control system like GitHub, provide the URL of the repository and instruct the user to clone it to their local machine using Git.
  2. Install Ruby:

    • Instruct the user to install Ruby on their system if they haven't already. They can use a version manager like RVM or rbenv for managing Ruby versions.
  3. Install Rails:

    • Once Ruby is installed, guide the user to install Rails using the following command:
      gem install rails
      
  4. Navigate to the Project Directory:

    • Instruct the user to navigate to the directory of the cloned Rails project using the terminal or command prompt.
  5. Install Dependencies:

    • Inside the project directory, guide the user to install the project dependencies (gems) using Bundler. They can run the following command:
      bundle install
      
  6. Configure the Database:

    • Instruct the user to configure the database by updating the config/database.yml file with their database credentials. They may need to create the corresponding database in their development environment.
  7. Run Migrations:

    • After configuring the database, guide the user to run the database migrations using the following command:
      rails db:migrate
      
  8. Start the Rails Server:

    • Once the migrations are complete, instruct the user to start the Rails server using the following command:
      rails server
      
  9. Verify Installation:

    • Finally, provide instructions for verifying the installation by opening a web browser and navigating to http://localhost:3000. They should see the default Rails welcome page if the setup was successful.

Prerequisites

  • Basic Ruby on Rails knowledge and a configured development environment.
  • Access to the legacy Microsoft SQL Server database.
  • Temporary secure tunneling solution (e.g., Ngrok) for development.

Project Structure

  • app/ - Rails application
    • controllers/ - Handles API endpoints for order processing, etc.
    • models/ - Customer, Order, Medication models.
    • config/routes.rb - Defines API routes.
  • legacy_integration/ TODO
    • sync_script.rb - Script to query Rails database and update legacy database (or instructions for Delphi modifications).

Getting Started

  1. Rails Setup:
    • Create a Rails project and generate models for Customer, Order, Medication, etc.
    • Establish the database connection.
    • Implement logic to bridge inventory checks with the legacy system.
  2. API Endpoints:
    • Design API endpoints in your controllers for:
      • User authentication
      • Order submission
      • Order status updates
      • Statement retrieval
    • (Optional) API endpoint to receive updates from the legacy system if your integration method permits.

Port to Android using Turbo Native(TODO)

Legacy Integration(TODO)

Security(TODO)

Deployment (TODO)

  • Deploy the app to Render.