1 / 8

Creating Symfony Ecommerce App

Symfony can be used to create an ecommerce app. You can also easily integrate ReactJS on the front-end of your <a href="https://www.cloudways.com/blog/build-symfony-ecommerce-app/">Symfony ecommerce</a> app and use Cloudinary for storing images.

Download Presentation

Creating Symfony Ecommerce App

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Create an Ecommerce App in Symfony Using React and Cloudinary

  2. End Result

  3. Prequisites • Knowledge of React, OOP with PHP, and MVC Web API Patterns • Cloudinary Account • Node.js • Yarn Package Manager • Symfony Installed and Optimized on the server/localhost

  4. CreateProducts in Symfony • Create Symfony API manually by generating doctrine entity • Generate and configure product entity • Create and Configure Product Controller. Add index() method in the controller • Create new product endpoints by adding a function inside index() method. Here you are creating products. • You will be using two custom functions in the code: uploadImageToCloudinary() and updateDatabase() • First one uploads image to Cloudinary and second one will persist and flush data.

  5. ListAll Products • Create a function to fetch and list all the products. • The function will return a JSON response to list the products. • The JSON response will be looped through React so it is displayed correctly to the users. • This will be done in Product Controller created earlier. • Inside the Product Controller, there is ProductRepository which will be created later. • Inside index(), add a constructor method and the mentioned private properties.

  6. Adding Favorite Count to the Product • For this, a Favorite button will be added to the front-end. • To record the number for favorites received, we will create API. • For this, a method will be added to ProductController.

  7. Setting Up and Configuring Cloudinary • Login to your Cloudinary Dashboard and note down your Cloud name, API Key and API Secret. • Use PHP-SDK provided by Cloudinary to create upload service. • Install Cloudinary and create a folder name Service inside srcfolder. • Create file named imageUploader.php under the folder. • In this file, define a PHP class for image uploading on Cloudinary. • Open .env file and update your Cloudinary credentials in it.

  8. Read the full article on Creating Symfony Ecommerce app with Cloudinary and React.

More Related