Skip to content

root-code-software/shopeasy-ruby-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ShopEasy Ruby Backend

Forks Stargazers Issues-open Issues-closed Contributors contributions welcome


Server made in Rails for an E-Commerce basic solution


Report a Bug πŸ™‹β€β™‚οΈ Request Feature

Table of Contents

The Project

Provides a base for a E-commerce backend, with Items to display and Payments to log. It should provides the frontend with enought data to be functional.

This project have as a primary function to provide a base for a demostration on how to detect a credit card issuer/network. Later I can re use it by adding features, for example the ones describes later.

Card type detection using regex for a credit card form component. As managing money for programmers is important, we have to make sure things like card issuer are as the user says; also we have to take care of the looks.

This projects shows how to check in a Rails controller's method for the Network issuing certain cards based on the Issuer identification number (IIN). This way we take care of security issues validating server-side the card number.

Based on this gist

Built With

  • ruby v2.7.x
  • rails v6.0.x
  • rbenv v1.1.x
  • vscode with Ruby and Rubocop extensions
  • Linux MX (Debian 10/XFCE)
  • Love and Passion for code.

Features

ruby Framework postgres heroku

  • Using Rails 6.x
  • No views, only API
  • Using postgres databases for development and production (postgres)
  • Uses migrations and seed
  • Associates several tables on the database using foreign keys

Run It

This project was bootstrapped with Ruby on Rails. So is already setup to be wasily developed and run.

Prerequisites

You will need Ruby on Rails version 6.0 or greater installed on your system.

Setup

Get the code by either cloning this repository using git

git clone [email protected]:Israel-Laguan/shopeasy-ruby-backend.git

... or downloading source code as a zip archive.

Once downloaded, open the terminal in the project directory, and install dependencies with:

bundle

Database creation

Provide a .env file the keys ``

rails db:reset && rails db:reset RAILS_ENV=test && rails db:migrate && \
rails db:migrate RAILS_ENV=test

Run tests with bundle exec rspec Run rails db:seed to generate seed data.

Run it

Then start the app with:

rails s

The app should now be up and running at http://localhost:3000 πŸš€

If for some reason you have a server running in that same port just change the port with rails server -p XXXX, where XXXX is any number greater than 1024 (below that we have permission troubles). For example 3001 could work.

Test suite

To run the tests that verify the proper behavior of the Rails app, run the following command. There are about 119 passing specs, this should make you stop worrying about a malfunction in the app.

rspec

Potential Features

  • Add Swagger
  • Add User Auth with Devise and OnmiAuth
  • Improves Active Record's Queries
  • Add more tests

Models created

  • Items
  • Payments

FAQ

  • How to migrate or Seed my Heroku's Postgres DB?

You must use Heroku CLI (more info here). Try these commands:

heroku run rails db:migrate
heroku run rails db:seed
  • My Postgres gem (pg) don't compile 😒

You must install system dependencies for Postgres. In Debian try this:

sudo apt update
sudo apt-get install zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev libffi-dev postgresql-client-common postgresql-client libpq-dev

Author

Contributing

contributions welcome

🀝 Contributions, issues and feature requests are welcome! Feel free to check the issues page.

Show your support

πŸ€— Give a ⭐️ if you like this project!

Regexs: Adapted form here

License

License

πŸ“ This project is licensed under the Apache 2
Feel free to fork this project and improve it

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Languages