Skip to content

Instantly share code, notes, and snippets.

@bgreenacre
Last active March 27, 2023 15:52
Show Gist options
  • Save bgreenacre/6c1580b416831b48fbf19704a95e4e02 to your computer and use it in GitHub Desktop.
Save bgreenacre/6c1580b416831b48fbf19704a95e4e02 to your computer and use it in GitHub Desktop.
For Your Party Backend Challenge

Products View Application

For Your Party Backend Code Challenge Specifications

Document Objective

The purpose of this document is to provide detailed documentation that clearly defines the application that an applicant will create for the For Your Party Code Challenge.

Scope of Work Details

Application Description

Now that you have completed our Frontend Challenge let's update it to use your own custom API! Create an API that will provide one endpoint that will server the products data as a json array. The product data should be imported into a normalized structured database of your design. This means you will need to write an import script to take the data from products.csv.

Web Application Requirements

The details for this web application are defined below.

Import Products

The developer will import data from a csv file provided by this gist file products.csv into a structured database of their design. This database will be used by your api endpoint to generate it's json payload.

Products API Endpoint

The products endpoint will server up the products data as a json payload. This endpoint should follow RESTful design practices.

Frontend

Once your API endpoint is ready, update your frontend to now use your custom api endpoint to render the products.

Code Expectations and Deliverables

The developer is expected to adhere to the following parameters. Also, the developer is free to use any third party library/framework using composer.

Well Documented

The application code will be created with the assumption that other developers will work on it in the future, so it must be documented enough to make it easy for others to understand and maintain.

PHP Coding Style

The application code must be developed using Object‐Oriented methodologies. It must also be written in PHP 7+ and be E_STRICT‐compliant. The use of third party libraries and packages (ie. packagist.org) is allowed.

Error Handling

All application errors must be handled gracefully and display user‐friendly error messages if necessary.

Delivery

The developer will provide a url to a github (or similar git hosting service) repository. Instructions on how to run the application will be provided within the README.md file.

Tips:

If you cannot finish simply do the best you can and explain your thought process in the comments. Work at your own pace. We prefer quality over speed.

Bonus

Favoriting a Product

When a user toggles a product as their favorite the User Interface should save that state in a database. Create an API that will receive a json payload containing the Name of the product and a flag signifying the product is favorited by the user. This will be stored in a structured database. This API endpoint should adhere to RESTful design practices.

Category Title Price Sale Price
napkins Cocktail 1 0.6
cups + plates Shot Glasses 3.4 2.53
napkins Luncheon 1 0.57
napkins Napkin Rings 1 0.56
masks + wellness Disposable Masks 6.8 3.5
matches Classic 2.2 1.5
invitations Business Cards 6 2.51
matches Mini 2.2 1.5
barware Stir Sticks 1 0.5
matches Candle 2.2 1.5
invitations A7 6 2.51
matches Exploding 2.2 1.5
cups + plates Frost Flex 3.4 2.5
cups + plates Colored Frost Flex 3.4 2.5
gifts Holiday 3.44 2.6
cups + plates Styrofoam 3.4 2.505
bags, tags + favors Cake Boxes 9.1 5.5
cups + plates Stadium 3.4 2.54
cups + plates Can Coolers 3.4 2.52
masks + wellness Hand Sanitizer 6.8 3.5
masks + wellness Social Distancing 6.8 3.5
bags, tags + favors Favor Bags 9.1 5.5
bags, tags + favors Gift Bags 9.1 5.5
gifts Poker Box 3.44 2.53
bags, tags + favors Satin Ribbon 9.1 5.5
bags, tags + favors Tea Favors 9.1 5.5
napkins Photo 1 0.58
barware Classic Coasters 1 0.5
barware Leather Coasters 1 0.5
matches Cigar 2.2 1.5
barware Tabletop Signs 1 0.5
gifts Party Favors 3.44 2.5
gifts Grab and Go 3.48 2.5
gifts Gift Cards 3.44 2.44
invitations Stationery 6 2.51
barware Roller Coasters 1 0.5
invitations Recipe Cards 6 2.51
invitations RSVP 6.08 2.51
napkins Dinner 1 0.59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment