Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
API layer and backend come separately from this bundle. You are using frontend framework/boilerplate, right?
-
scout25683yYes front end
As web services from some other external rest api, so will call them using axios -
@scout If you wanna maintain them in a one pack, sure, just create `api`/`services` directory and put your services there. The question is how you're gonna run them - as separate processes or simultaneously. Another option is to maintain backend in completely separate place.
-
@scout I remember trying to find an automagical mapping between backend and frontend (no duplicating routes and API endpoints). I'm still in search of such convenience. And yet, some things just seem right in place when they are not contained in monorepository.
-
h3rp1d3v5193yHaven't tried redux toolkit query yet. Shouldn't you just use default and put slices and network queries under individual component folders? You also want to use Storybook and separate pure component from component that uses global states and network calls.
@acemarke should have a bunch of related tutorials -
@scout Before you mention SSR: calls are still made on frontend side. It's just that all initial requests for a full page render are performed beforehand. It's not a backend, the one which handles every checkout operation or updates user profile at demand. During SSR, you may need to fetch some data from the database, so you do calls to your backend through axios.
So, with this in mind, the frontend is one hell of a fat ass glorified in the end. You team will notice it's much better to separate backend in this case. Look for a backend framework then.
Hi react developers. Noob question, I am making a new (my first) react+redux toolkit+axios website…
So umm, what folder structure is best, and where does the user authentication part , the web services go?
Currently I have
-src
-pages
-index.js
-app.js
-about
-index.js
-stores
-common
rant