BarStock is a 13-day, four-person project during Mod 4 of 4, for Turing School's Back-End Engineering Program. Our team consists of two Front-End Developers and two Back-End Developers.
Our challenge was to create a native application from idea to inception by integrating our skills as Front-End and Back-End Developers to solve a real-world problem.
Thus, BarStock was born. BarStock is a web application designed to solve the communication challenges between bar owners and distributors when placing inventory orders. In the bar industry, it is frequently common practice to place weekly inventory orders via text messages/emails. Bar owners are not provided with pricing sheets, nor available inventory, and often receive incorrect shipments. BarStock is intended to alleviate this headache by providing bar owners with user interface to view distributor inventory, analyze profit margins, and automate text message/email ordering.
BarStock Back-End utilizes Ruby on Rails, RSpec, ActiveRecord, and a PostgreSQL database for the BarStock User Interface, which communicate back and forth via API requests/responses.
Login Screen | Selecting Inventory |
---|---|
![]() |
![]() |
View Margin/Profits | Place Order |
![]() |
![]() |
Account Information | Reorder |
![]() |
![]() |
All available endpoints have been documented on Swagger.
Upon creation of an order, both an email and an email and a text message are sent to the distributor's representative.
To run BarStock Back-End on a local machine, navigate to the directory in which you would like the project to be located, then execute the following commands:
$ git clone [email protected]:MRKrog/barstock_backend.git
$ cd barstock_backend
$ bundle
$ rails g rspec:install
$ rails db:create
$ rails db:migrate
$ rails db:seed
$ figaro install
Create Accounts With The Following Services:
Add the following code snippet to the config/application.yml
file. Make sure to insert the key/secret without the alligator clips ( < > ).
TWILIO_ACCOUNT_SID: <insert>
TWILIO_AUTH_TOKEN: <insert>
TWILIO_PHONE_NUMBER: <insert utilizing the format of '+1720993333'>
SENDGRID_PASSWORD: <insert>
To run the test suite, execute the following:
redis-server
.
Keep the redis server running and open a new terminal tab. Execute the following:
bundle exec rspec
.
To view BarStock in development, execute the following command from the project directory: rails s
. In a browser, visit localhost:3000
, to view the application.
To view the application in production, from the project directory, execute the following commands:
$ createuser -s -r barstock_backend
$ RAILS_ENV=production rake db:{drop,create,migrate,seed}
$ rake assets:precompile
$ rails s -e production
- Fast JSON API
- RSpec
- Faraday
- Figaro
- Faraday
- Capybara
- Pry
- Shoulda-Matchers
- Factory Bot
- Database Cleaner
- SimpleCov
- Bcrypt
- Faker
- Awesome Print
- WebMock
- VCR
- Trello
- Postman
- Circle CI
- Sendgrid
- Redis
- HTML Email Template
- Twilio
- Mailcatcher
- Fork the project.
- Write a failing test.
- Commit that failing tests.
- Commit changes that fix the tests.
- Submit a pull request detailing the change that was made.
- Search the existing issues.
- Create a new issue if applicable, or contribute to an existing issue.