This is the API for Audiophile, an e-commerce site. Even though it can be used independently, you can find the UI that consumes this API here
This API contains the core functionality that a common e-commerce system would need:
- Products system with categories, toppings and stocks
- Super basic headless CMS to modify the content and details of each product
- An Admin namespace to create or edit all of the above
- OTP authentication via email
- Checkout flow with purchase carts, sign up/login, shipping address with geolocation and credit/debit card payment with Stripe
- Basic comms such as payment confirmation or failure emails
- Orders system to track purchase status after payment
You can find the API documentation here
- Ruby
- Rails
- PostgreSQL
- Redis
- Sidekiq
- RSpec
- Docker
- AWS S3 for assets storage
- AWS Location service for address geocoding
- SendGrid for Email Comms
- Stripe for payments
- Fly.io for hosting of demo app
- Install Docker Engine and docker-compose
- Create a
tmp/
folder 1 level above the root directory of the project
mkdir ../tmp
- Create a .env file based on the existing .env.example file_
cp .env.example .env
- Follow the instructions on the .env file regarding the vendors variables that need to be configured
- Run docker-compose in development mode
cd docker/development
docker-compose up --build
- Open a new terminal and setup the database
docker-compose run web rails db:setup
Once everything is installed, this is the every day process to start up the environment:
- Run docker-compose in development mode
cd docker/development
docker-compose up --build
- Open a new terminal and run any possible migrations
docker-compose run web rails db:migrate
- Install homebrew https://brew.sh/index_es
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install rbenv (Ruby versions manager) https://github.com/rbenv/rbenv
brew install rbenv ruby-build
- Set up rbenv
rbenv init
Follow the printed instructions
- Restart your terminal, and install ruby
rbenv install 3.2.2
- Install postgresql
brew install postgres
- Start postgresql as a service
brew services start postgresql
- Install ruby dependencies
bundle install
- Create a .env file based on the existing .env.example file_
cp .env.example .env
-
Follow the instructions on the .env file regarding the vendor variables that need to be configured
-
Set up the database
rails db:setup
- Install redis
brew install redis
- Start redis as a service
brew services start redis
- Start the rails server
rails server
- Run sidekiq on a separate terminal
bundle exec sidekiq
- Go to http://localhost:3001/eng/sidekiq to monitor the jobs. Use the values defined in the
ADMIN_HTTP_USERNAME
andADMIN_HTTP_PASSWORD
env variables to login.
Once everything is installed, this is the every day process to start up the environment:
- Start the postgres and redis services (this is probably that is done automatically when turning on the computer)
brew services start postgresql
brew services start redis
-
cd
to the project folder. -
Run any new db migration
rails db:migrate
- Run the rails server
rails server