from django to django rest framework : e-commerce with react - reactjs

i have completed an e-commerce project with pure django and want to transform it to Django Rest Framework with React,
i just want to know if the use of Sessions to create a cart would still be the same or is there something else or a different aproach to keep cart functionality,
i have been looking at some github projects to see how it can be done ,and just got me confused, if someone can clear that out for me, much much apreciated,
thank you,

I understood that it is possible to set cookies or a local storage with react and receive the info directly to the Django backend from there, so there is no need using sessions (it still totally possible but apparently not preferred)

Related

Using both Django template and React

Hi guys I’m trying to bulid a website which django works as an rest-api and react works as a front side. I manage to do the whole thing just fine and about to deploy it using aws. But there is one thing I couldn’t really get. Inside my django project I have an app that uses only django template to render things to front. And other apps are working only as apis to get and post things via react. Is it possible to deploy this kind of structure without any special options? I searched internet for a while but I couldn’t really find an example that fits my situation. Thanks!
Yes, you should be able to deploy it without extra options: you can have one Django template view to host the React app entry point, and the rest would be Rest API views that are accessed by React.

How would I go into setting up a firebase project safely?

I have an app idea which I want to create a working product of. I do have a working demo with React Native and I'm using Firebase for storing documents and images. Creating documents and uploading images to Firebase Storage is all done in the app, but this is just for demo purposes. In reality you would of course want to use an API for storing all that data. At least, I thought so. All I see on the internet is people using Firebase directly in their app. Is this the correct way of doing it? I always learned you should use a backend, for example a REST API for safely handling data.
Is it safe and secure to 'just' use React Native? I want to handle payments in my app, so I really want it to be done securely.
So what's an example of a stack I could use?
Currently using React Native and Firebase. But for safety I'd imagine something like
React Native - frontend
Node Express Server - backend
Firebase - database
I hope someone can give me a little push in the right direction.

Send mail by using Strapi and React.js

Since one month me and my team are working on a project with React as frontend and Strapi as our backend.
We need to do a form that has to automatically send e-mails by using the Strapi e-mails plugin.
However, we're still beginners with those technologies, and we aren't able to implement this kind of functionnality.
Is anyone familiar with Strapi and also this plugin ?
We don't find a lot of tutorials and documentation about it on the web.
Thank your for paying attention.
you can follow instructions of this guide - https://strapi.io/documentation/3.0.0-beta.x/guides/send-email.html#introduction
You can create a custom route/controller to manage your contact form.
Here is an example - https://strapi.io/documentation/3.0.0-beta.x/concepts/controllers.html#example
Make sure to create a POST route.
Then in your controller, get your form data with ctx.request.body

React / Symfony: How to start my project?

It's been a few days since I broke my head to find the right method but I can't make up my mind so I decide to call on your experience :)
My project is to develop a membership management site / dues / ... for a (small) association. I want to use React for the frontend and Symfony 4 for the backend because these are the two technologies that I master the best.
My question is: (1) should I start a Symfony project and integrate React, or (2) should I start a React project and create an API with Symfony for my application?
Indeed if I go on the first solution my biggest problem is that I do not see how to manage the routing of my application (via React or Symfony).
If I go on the second method, I am afraid that my application is less secure (report to the management of authentication).
That's it I hope to enjoy your lights and thank you in advance :)
I think the best approach is the second. If you manage routes through the backend, you don't have the advantages of SPA.
In the other hand, to secure data you can take a look at JWT (JSON Web Tokens). That way you can safely manage info between the app and the api.
You should take a look at this to ease the development:
https://api-platform.com/

Laravel and Angular.JS - Web App Dev

I have started learning Laravel and Angular, for one of my project at university. I want to rebuild the website www.lolcalculator.com with these two frameworks but I cant figure out exatly the best way to do that. From Laravel I want the less posible, because I will focus on Angular.
Can someone with more experience help me?
For example, do I need to use routing on both sides? Which functions of the website I should cover with Laravel(Mailer, Auth, Routing...) and which using Angular?
I just need to understand a bigger image, not in details.
Tnx a lot.
All the best :D
There's quite some information on the net regarding Laravel and Angular, but this one in particular is one that I found useful: http://scotch.io/tutorials/php/create-a-laravel-and-angular-single-page-comment-application.
You may also want to consider writting a front-end app in Angular and a separate back-end app in Laravel. The back-end app can then expose an API, consumed by the Angular front-end.

Resources