Coder Social home page Coder Social logo

jzxyouok / salon-pricing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ashmenhennett/salon-pricing

0.0 1.0 0.0 1.15 MB

A beauty salon pricing app, built with Laravel 5.3 and Vue 2.

PHP 47.33% JavaScript 1.56% ApacheConf 0.28% Vue 28.27% HTML 22.56%

salon-pricing's Introduction

Beauty Salon Pricing

This is a repository for a beauty salon (product and service) pricing list, built with Laravel 5.3 and Vue 2.

##Highlights The application uses Factal, via the spatie/laravel-fractal package and has been utilized to create an API for the retrieval of a complex data structure in a nested array like syntax. The data is accessible by registered users at products/fetch and services/fetch.

Vue has been used to create the reactive front-end components that utilize the API.

Functionality

  • Allows user to register and create products and services.
  • Each User may have many products and services.
  • Each Product and Service belongs to one User.
  • Services are defined by a user_id, title , category and price.
  • Products are defined by a user_id, brand, name, category and price.
  • Products and Services, once created, can be edited and deleted via the 'backend' UI (/products or /services/).
  • All products and services are available for viewing, in a price listing UI (/prices/services, prices/products or prices/all), seperate to the 'backend' view. */prices/all being a view including all products & services.
  • The price listing view has the option to add a quantity of items to the total price, as well as removing a specified quantity of the item from the total price.
  • Products and Services may be sorted by brand and category, respectively, in the 'backend' view, as well as the pricing list view.
  • Products and Services may be discounted via the UI, using predefined values as per the project specifications.

Note, the user registration controller currently restricts registration to only one user, as per the project specifications. To remove this restriction, simply remove the no_accounts validation rule in the RegisterController.

##Custom Validation rules As well as the no_accounts validation rule, used in RegisterController, two other custom validation rules have been implemented, dollars and allowed_dollar_amount.

The dollars validation rule uses the following pattern: /^\d{0,5}(\.\d{2})?$/, to verify that a value is in the following format: 123.45.

The allowed_dollar_amount uses the following pattern: /^\d{0,5}(\.\d{2})?$/, to verify that a value is has a maximum of 5 whole numbers, preceeding the . and two decimal places.

Screenshots

###Adding Items Adding services 'backend' Adding Services

Adding products 'backend' Adding Products

###Backend Listings Product listings Product Listings

Service listings Service Listings

###Pricing lists Pricing list (top) All Prices- top

Pricing list (bottom) All Prices- bottoml

Installation & Configuration

If you would like to install this project, treat it as you would any other Laravel application, keeping in mind some additional crucial environment variables:

  • APP_URL : the url of the application. This variable is used to link to the application.
  • MAIL_FROM_EMAIL and MAIL_FROM_NAME: the 'from' email address and name. This is used for sending out emails.
  • COPY_NAME and COPY_URL: the text and link in footer, used for dev details.

Remember to either remove references to the legal views routes, or add in your own views under legal.terms and legal.privacy

Further steps:

  • Set the APP_ENV environment variable to production when the app is on a live sever, to force HTTPS connections on all routes.

##Packages

##Disclaimer

  • Prices, within the database and Vue components are of type float, feel free to enhance the trailing points' accuracy by changing the type to double. However, I have chosen to stick with float type, as there is no real advantage, considering the limitations in rounding up floating point numbers to the nearest floating point value (, given the number of trailing decimals to keep intact) in JavaScript.
  • The price field in the products and services tables are restricted to values no greater than 99999.99(7 digits, 2 of which are trailing decimals).
  • It is possible for total prices, shown in footer at /prices/all, /prices/services and /prices/products to be off by, at most, 1/2 cent. This is due to prices not being rounded up before being displayed. Instead, total prices are 'trimmed' down with n.toFixed(2). I have also removed any possible - preceeding the total price. A preceeding - may appear, if all items are removed from the total. The resulting code is n.toFixed(2).replace('-', '').

Please do not use the associated legal views, if they still exist in this repository (terms.blade.php and privacy.blade.php). Use at your own peril.

salon-pricing's People

Contributors

ashmenhennett avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.