The Clever Calculator app is a customizable sales calculator for businesses. An admin section allows for a sales manager to create and modify products and services with default pricing. Members of their sales team can then assemble quotes for individual customers with a user-friendly interface.
- Technologies and System dependencies
- Additional Files
- Installation (MacOS)
- Prerequisites
- Getting started
- Rubymine Support for Rubocop (Code Linting)
- Usage
- Environment Variables
- Testing
- License
- Ruby 3.4.1
- Rails 8.0.1
- PostgreSQL 16.2
- Bootstrap 5.3.3
- React.js 19.0.0
- esbuild 0.24.2 (for JavaScript bundling)
.ruby-version and .ruby-gemset are used to specify the Ruby version and gemset for consistency across environments.
-
Install the latest version of XCode from the App store, run the following command in terminal:
xcode-select --install -
Install the latest version of Homebrew: http://brew.sh
-
Install Dependencies for Compiling Ruby Install the required packages for building Ruby. On macOS, run:
brew install openssl readline zlib -
Install Git on Mac using homebrew:
brew install git -
Set your GIT username from terminal:
git config --global user.name "YOUR NAME" -
Set your GIT email address from terminal:
git config --global user.email "YOUR EMAIL ADDRESS"
-
Clone the repository:
git clone https://github.com/wahanegi/clever-calculator.gitcd clever-calculator -
Install the latest version of RVM: https://rvm.io
-
Compile Ruby with Custom Options Since precompiled binaries aren’t available, tell RVM to compile Ruby:
rvm install 3.4.1 --with-openssl-dir=$(brew --prefix openssl) -
Specify the Ruby version you want to use:
rvm use ruby-3.4.1 -
Create a gemset named
clever-calculator:rvm gemset create clever-calculator -
Switch to your newly created gemset:
rvm gemset use clever-calculator -
Install PostgreSQL in terminal:
brew install postgresql -
Start the PostgreSQL service:
brew services start postgresql -
Verify installation
psql --version -
Install dependencies with Bundler:
bundle install -
Install JavaScript dependencies with Yarn:
yarn install -
Set up the database:
rails db:create db:migrate -
Start the server:
bin/dev
Code Linting gives formatting and syntax suggestions to make your code more readable.
In Rubymine go to:
Rubymine -> Preferences -> Editor -> Inspections -> Ruby -> Gems and gems management -> Rubocop
Make sure that the checkbox is checked.
Visit http://localhost:3000 after running the server.
Create a .env file in the root directory and include:
DATABASE_USERNAME=your_username
DATABASE_PASSWORD=your_password
Run tests with:
bundle exec rspec
This project is licensed under the MIT License.