Skip to content

hildakh/medcal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MedCal

Med Cal is a prescription cost calculator that allows users to create prescriptions, add medication items, and calculate the total cost dynamically build on Rails and React. This project uses React on Rails template from Shakacode

🚀 Features

  • Create prescriptions with a set budget.
  • Add prescription items and dynamically calculate total costs.
  • Apply discounts for long-duration prescriptions.
  • API endpoints for managing prescriptions and medications.

📦 Installation & Setup

Clone the Repository

 git clone https://github.com/hildakh/medcal.git
 cd medcal

Install Dependencies

Backend (Rails API)

bundle install

Frontend (React & TypeScript)

yarn install

Setup Database

bin/rails db:create db:migrate db:seed

Start the Development Server

foreman start web

🛠 API Endpoints

Prescriptions

  • POST /prescriptions – Create a prescription
  • PUT /prescriptions/:id – Update budget
  • GET /prescriptions/:id – Retrieve prescription details.

Prescription Items

  • POST /prescriptions/:prescription_id/prescription_items – Add an item to a prescription.

Medications

  • GET /medications – List available medications.
  • GET /medications/:id – Get medication details.

🧪 Running Tests

Run all tests using:

bundle exec rspec

To check for code formatting and linting issues:

bundle exec rubocop

To auto-fix linting issues

bundle exec rubocop --auto-correct

Next steps

  • 🧪 Add specs for controllers & react components
  • 🤖 Feature update
    • Implement cost modification logic in frontend to suggest shorter duration
    • Add confetti / confirmation when prescription is submitted

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published