Hey! This project helps managing your salesforce account by adding your customers and retails to your database, filtering them based on distance, and more future features that will allow getting the best out of the data you have
If you have a Docker and docker compose . That's a good start. If not, here're the links to install them
Docker: https://docs.docker.com/get-docker/
Docker Compose: https://docs.docker.com/compose/install/
$ git clone git@github.com:amrdruid/Salesforce-Retail.git
$ docker build .
$ docker-compose up
$ docker-compose exec web bundle exec sidekiq
$ docker-compose exec web bundle exec rake db:migrate
Create an application.yml
file using docker-compose exec web bundle exec figaro install
you can find a sample file in application.yml.sample
$ rspec spec
-
From
dealers_controller.rb
we have two main APIs,add_point_of_sales_dealers
anddealers_within_range
-
add_point_of_sales_dealers
allows adding retails to the database by internal employees -
dealers_within_range
returns the retails around your current lng and lat in form of JSON -
We have a rake task that does what
add_point_of_sales_dealers
does. We can execute it throughdocker-compose exec web bundle exec rake dealers:generate_and_save_to_db
-
We use
Sentry
for tracking errors -
We use
Figaro
gem to manage secrets
Areas for Improvement:
1- Add authorization
2- Possible caching when fetching dealers
3- Passing different categories to Sidekiq if we had other categories involved
4- Tests for models and routes, and one for the worker