Skip to content

kg-byte/rails_engine_fe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rails Engine

About This Project

Rails Engine FE is a Django Application that consumes several endpoints rendered by Rails Engine Repository. The purpose of this project is to demonstrate Service Oriented Architecture where font-end and back-end team chose to build their applications using different programming languages.

(back to top)

Features Implemented:

  • Consume the following V1 Endpoints to render data to user:
    • All merchants with merchant names as links to their show page:
      • Backend endpoint:GET http://localhost:3000/api/v1/merchants
      • Frontend url(root): http://127.0.0.1:8000/
      image
    • One merchant with items of thtat merchant with item names as links to item show page:
      • Backend endpoint:GET http://localhost:3000/api/v1/merchants/{{merchant_id}}
      • Frontend url: http://127.0.0.1:8000/{{merchant_id}}
      image
    • All items with item names as links to the item show page:
      • Backend endpoint: GET http://localhost:3000/api/v1/items
      • Frontend url: http://127.0.0.1:8000/items
      image
    • Items show page with item details:
      • Backend endpoint: GET http://localhost:3000/api/v1/items/{{item_id}
      • Frontend url: http://127.0.0.1:8000/items/{{item_id}}
      image
    • Search Mercants by name via search bar on home page:
      • Backend endpoint: GET http://localhost:3000/api/v1/merchants/find?name=iLl
      • Frontend url(landing page): http://127.0.0.1:8000/](http://127.0.0.1:8000/search?...search=group
      image
    • Edge case handled in search merchants by name: no user input for search: image

(back to top)

Installation

As neither the front-end or the back-end service is held on a public server, please follow the following instructions to start both front-end/back-end servers to navigate the urls and run tests.

Pre-requiste: Clone the backend Rails Engine Repo and start server:

  1. Fork and/or Clone the BE repo
git clone git@github.com:kg-byte/viewing_party.git
  1. Install gems and dependencies
 bundle install
  1. Set up db/seed file with the following content:
cmd = "pg_restore --verbose --clean --no-acl --no-owner -h localhost -U $(whoami) -d rails-engine_development db/data/rails-engine-development.pgdump"
puts "Loading PostgreSQL Data dump into local database with command:"
puts cmd
system(cmd)
  1. Run the following line and you may see lots of output including some warnings/errors from pg_restore that you can ignore.
 db:{drop,create,migrate,seed}
  1. Run the following line - Check to see that your schema.rb exists and has the proper tables/attributes that match the data
rails db:schema:dump
  1. Run run test suit
bundle exec rspec
  1. Start the server to service API requests:
rails s

(back to top)

Clone and set up Rails Engine FE (this repo):

  1. Fork and/or Clone this repo
git clone git@github.com:kg-byte/rails_engine_fe.git
  1. Set up and activate a virtual environment in the repository directory:
python3 -m venv my_env
source my_env/bin/activate
  1. Install the django, requests and any other required modules:
pip install django
pip3 install requests
  1. Start the server:
python manage.py runserver
  1. Run tests:
python ./manage.py test
  1. Visit the front-end urls mentioned above in features implemented, e.g., the homepage(merchannt index page):
http://127.0.0.1:8000/

(back to top)

Built With

(back to top)

Versions

(back to top)

Contributors

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published