Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,535 members, 7,816,307 topics. Date: Friday, 03 May 2024 at 09:15 AM

Help Needed On React Project - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Help Needed On React Project (1378 Views)

My New React Project / Help On My React Project / Advanced Pdfs On React, Ionic And Kotlin (2) (3) (4)

(1) (2) (Reply) (Go Down)

Help Needed On React Project by donproject2(m): 8:53pm On Nov 29, 2022
Good evening techies. I am currently developing a ERP software for Laundry Management System using Nodejs and React which I am sure it is 80% complete. Part of the modules I plan to include are Reporting and activities Dashboard. I need help on the best React Reporting service/library to use, I know well about SSRS which we use in my former job but it is a no-no for this project for few reasons. I also need suggestion on the best library for presenting charts with React.
Re: Help Needed On React Project by QuoteJustOnce: 11:08pm On Nov 29, 2022
Few takeaways for you:

1. I want to assume Nodejs for the backend (api) and React for the frontend? yes? if so why? which will lead to further questions.
2. React is just a library. Are you using pure react or a full-fledged React-framework?
3. which brings me to: 95% of the time you don't need external modules to achieve something. while they make the work easier (a bit), they tend to increase the bundle size by a bigger margin, leading to heavy and slower apps.

if you had attached an image of how you wanted the reporting and activity dashboard to look like, then i would have told you how best to approach it module-lessly. I have actually presented graphs and realtime- charts using zero modules (native js data structure + html elements would suffice). Take that to the bank!

1 Like

Re: Help Needed On React Project by qtguru(m): 1:20am On Nov 30, 2022
Use a chart library bro, this is a client's project not your assignment. Use what works than building from scratch

Try Apexchart

6 Likes

Re: Help Needed On React Project by bet9ja(m): 6:29am On Nov 30, 2022
QuoteJustOnce:
Few takeaways for you:

1. I want to assume Nodejs for the backend (api) and React for the frontend? yes? if so why? which will lead to further questions.
2. React is just a library. Are you using pure react or a full-fledged React-framework?
3. which brings me to: 95% of the time you don't need external modules to achieve something. while they make the work easier (a bit), they tend to increase the bundle size by a bigger margin, leading to heavy and slower apps.

if you had attached an image of how you wanted the reporting and activity dashboard to look like, then i would have told you how best to approach it module-lessly. I have actually presented graphs and realtime- charts using zero modules (native js data structure + html elements would suffice). Take that to the bank!

The problem with his approach and choice of technologies is that, the legacy project will be a pain in the ass for any engineer that will later work with the project. He could have used Nextjs which was built on top of React Lib for building production application, and Nestjs which is the best JavaScript backend framework. These are fully fledge frameworks that enforce a design pattern and easy for continues integration and deployment.

As this are, you may use https://www.chartjs.org/ for your reporting.

1 Like

Re: Help Needed On React Project by donproject2(m): 6:53am On Nov 30, 2022
bet9ja:


The problem with his approach and choice of technologies is that, the legacy project will be a pain in the ass for any engineer that will later work with the project. He could have used Nextjs which was built on top of React Lib for building production application, and Nestjs which is the best JavaScript backend framework. These are fully fledge frameworks that enforce a design pattern and easy for continues integration and deployment.

Thanks bro...I started learning Nestjs few days ago and it will be my next stop for my next project. I know well about Nextjs but never learnt anything about it. On this current project, there is no going back, I have created close to 100 API endpoints with Express, and for the frontend, I can't even count number of pages I have creted already. I love it here on Nairaland because I know people like you with better experience will add something valuable to the table.

As this are, you may use https://www.chartjs.org/ for your reporting.
Re: Help Needed On React Project by donproject2(m): 6:59am On Nov 30, 2022
QuoteJustOnce:
Few takeaways for you:

1. I want to assume Nodejs for the backend (api) and React for the frontend? yes? if so why? which will lead to further questions.
2. React is just a library. Are you using pure react or a full-fledged React-framework?
3. which brings me to: 95% of the time you don't need external modules to achieve something. while they make the work easier (a bit), they tend to increase the bundle size by a bigger margin, leading to heavy and slower apps.

if you had attached an image of how you wanted the reporting and activity dashboard to look like, then i would have told you how best to approach it module-lessly. I have actually presented graphs and realtime- charts using zero modules (native js data structure + html elements would suffice). Take that to the bank!

Yes...node for apis, react for frontend. By full-fledged react, did you mean using framework like Nextjs?

Reporting like creating tabulated results for the users and dashboard like the one Power BI can build. I have other tools I can use for the two but they are overkill, besides, these are tools that have their own server and needed to be installed either on a VM and link with the website or I pay for a service that will help me host them.
Re: Help Needed On React Project by donproject2(m): 7:00am On Nov 30, 2022
qtguru:
Use a chart library bro, this is a client's project not your assignment. Use what works than building from scratch

Try Apexchart


Ohh thanks
Re: Help Needed On React Project by QuoteJustOnce: 4:06pm On Nov 30, 2022
donproject2:


Yes...node for apis, react for frontend. By full-fledged react, did you mean using framework like Nextjs?

Reporting like creating tabulated results for the users and dashboard like the one Power BI can build. I have other tools I can use for the two but they are overkill, besides, these are tools that have their own server and needed to be installed either on a VM and link with the website or I pay for a service that will help me host them.

Yes something like Nextjs would have given you an all-in-one package (fe + api). So i wonder why you had to make a standalone api (server). Unless of course you plan on making the api available publicly or would want to sell it later as a paid integration. else, it's an overkill. You also have to think of portability and scalability. if you are deploying several tools on servers minus your application, then how fast can you move these to a new server, if the client would want to switch servers? then the financial aspect, why should you incur extra cost just to host some kind of tool that your app needs. There are special cases for these, so you have to decide is it worth it? If it isn't, then an all-in-one solution would be the better and faster option. Once again reduce your need for overbloated node_modules, unless absolutely required without another way out, client project or not. The world is moving towards leaner bundles (that's why we now have stuffs like Astro) and if you can help it, do it. it pays in the long run.
Re: Help Needed On React Project by QuoteJustOnce: 4:15pm On Nov 30, 2022
bet9ja:


The problem with his approach and choice of technologies is that, the legacy project will be a pain in the ass for any engineer that will later work with the project. He could have used Nextjs which was built on top of React Lib for building production application, and Nestjs which is the best JavaScript backend framework

Damn right! The last thing you want to think of when building Stage0 apps are managing servers (that keep running 24/7 even with zero traffic) (unless once again you absolutely cannot help it). 99.99% of the time you won't need them especially in this era of computing.
If he so loved pure React, which "nobody in quotes" uses again by the way, then he could use it paired with some form of serverless api technology. This way he would build faster with lesser headaches to worry about and most importantly, run the app cheaper.
I support Nextjs being the de facto tool for any production app right now. Remix is better but uhmm, story for another day.
Re: Help Needed On React Project by donproject2(m): 8:07pm On Nov 30, 2022
QuoteJustOnce:


Yes something like Nextjs would have given you an all-in-one package (fe + api). So i wonder why you had to make a standalone api (server). Unless of course you plan on making the api available publicly or would want to sell it later as a paid integration. else, it's an overkill. You also have to think of portability and scalability. if you are deploying several tools on servers minus your application, then how fast can you move these to a new server, if the client would want to switch servers? then the financial aspect, why should you incur extra cost just to host some kind of tool that your app needs. There are special cases for these, so you have to decide is it worth it? If it isn't, then an all-in-one solution would be the better and faster option. Once again reduce your need for overbloated node_modules, unless absolutely required without another way out, client project or not. The world is moving towards leaner bundles (that's why we now have stuffs like Astro) and if you can help it, do it. it pays in the long run.

I wouldn't combine FE and BE with any all-in-one package though, that was the reason I moved away from PHP which I started my Backend journey with. I love the Idea of API sitting separately on its own, I may want to build mobile apps that will consume the API endpoints later in future, it will be nice if by then I only need to focus on the front end aspect. I will start using Nestjs plus GraphQL for my BE moving on, and may be Nextjs for the FE.

The thing is, deploying many tools on servers shouldn't be an issue for large organizations, I worked with a Fintech company in my previous job and our main clients are banks. They own servers and they give us enough servers to work with, separate server for application, another for database, ETL gets its own, reporting and Power Bi also get their standalone server and there are ways we make them speak together. Coming from that background, I know the benefit of using separate server for deploying different tools and its downside. When I started the project, I was considering buying a VM from any of those websites that give cloud computing services and host many of those tools there. On consideration of price and my target clients, I knew it will be too expensive to go that route, if not, there are great Reporting and Charting tools that those big banks use which I can effortlessly deploy on my own VM.

On leaner bundle that you stressed, I know react with so many dependencies one has to install will not be sustainable, I know the size of the project will get unreasonable larger as the project get more functionalities, I am moving away from it soon. I don't know much about ASTRO you mentioned but I will surely do research on it.

And, if you don't mind, I don't mind having your contact, I am seeing you as someone I just need, if not as a mentor, as someone I can have around because you seem to be steps ahead of me. Thanks in advance.
Re: Help Needed On React Project by QuoteJustOnce: 12:25am On Dec 01, 2022
donproject2:


I wouldn't combine FE and BE with any all-in-one package though, that was the reason I moved away from PHP which I started my Backend journey with. I love the Idea of API sitting separately on its own, I may want to build mobile apps that will consume the API endpoints later in future, it will be nice if by then I only need to focus on the front end aspect. I will start using Nestjs plus GraphQL for my BE moving on, and may be Nextjs for the FE.

The thing is, deploying many tools on servers shouldn't be an issue for large organizations, I worked with a Fintech company in my previous job and our main clients are banks. They own servers and they give us enough servers to work with, separate server for application, another for database, ETL gets its own, reporting and Power Bi also get their standalone server and there are ways we make them speak together. Coming from that background, I know the benefit of using separate server for deploying different tools and its downside. When I started the project, I was considering buying a VM from any of those websites that give cloud computing services and host many of those tools there. On consideration of price and my target clients, I knew it will be too expensive to go that route, if not, there are great Reporting and Charting tools that those big banks use which I can effortlessly deploy on my own VM.

On leaner bundle that you stressed, I know react with so many dependencies one has to install will not be sustainable, I know the size of the project will get unreasonable larger as the project get more functionalities, I am moving away from it soon. I don't know much about ASTRO you mentioned but I will surely do research on it.

And, if you don't mind, I don't mind having your contact, I am seeing you as someone I just need, if not as a mentor, as someone I can have around because you seem to be steps ahead of me. Thanks in advance.

Good catch i like how you think outside the box, but PHP damn!. Well using Nextjs as a case study, uhmm, it doesn't work the way php works. In summary, as you may already know, it allows you write api functions and then bundles them outside your frontend app. So it's more like you still doing dedicated fe + api except that it abstracts the api side for you and also allows you to manage both inside one codebase. And yes, you can still consume the api endpoints later in the future because it does provide endpoints like your regular nodejs and you can do your regular GET, POST, PATCH etc. Heck you can even rate-limit or secure with an API key should you choose to sell the api on a per-user or per-bandwidth basis. You options are unlimited. The most important takeaway being you can manage all these codes in one place (good for future/legacy development) and then you don't have to worry too much about servers and the hassles that come with it e.g. security and best practices. Astro is very nice especially with their architecture called "Islands". you should definitely look into it. It removes a lot of bottlenecks that would occasionally spring up using traditional react or even Nextjs.

Steps ahead of you? I'm flattered but not really. Just that i've worked with too many teams and seen too many use-cases where "unanticipated" issues often neglected would then pop up and throw a wrench. I use prontonmail as my handle.
Re: Help Needed On React Project by donproject2(m): 12:15pm On Dec 23, 2022
QuoteJustOnce:


Good catch i like how you think outside the box, but PHP damn!. Well using Nextjs as a case study, uhmm, it doesn't work the way php works. In summary, as you may already know, it allows you write api functions and then bundles them outside your frontend app. So it's more like you still doing dedicated fe + api except that it abstracts the api side for you and also allows you to manage both inside one codebase. And yes, you can still consume the api endpoints later in the future because it does provide endpoints like your regular nodejs and you can do your regular GET, POST, PATCH etc. Heck you can even rate-limit or secure with an API key should you choose to sell the api on a per-user or per-bandwidth basis. You options are unlimited. The most important takeaway being you can manage all these codes in one place (good for future/legacy development) and then you don't have to worry too much about servers and the hassles that come with it e.g. security and best practices. Astro is very nice especially with their architecture called "Islands". you should definitely look into it. It removes a lot of bottlenecks that would occasionally spring up using traditional react or even Nextjs.

Steps ahead of you? I'm flattered but not really. Just that i've worked with too many teams and seen too many use-cases where "unanticipated" issues often neglected would then pop up and throw a wrench. I use prontonmail as my handle.

Good morning, do you please have any cheap SMS API service you can recommended. The ones I am seeing are quite expensive. Thanks in advance.
Re: Help Needed On React Project by Nobody: 12:30pm On Dec 23, 2022
donproject2:


Good morning, do you please have any cheap SMS API service you can recommended. The ones I am seeing are quite expensive. Thanks in advance.
Twilio
Re: Help Needed On React Project by donproject2(m): 12:37pm On Dec 23, 2022
GREATIGBOMAN:

Twilio

That's SendGrid I guess, their service charge is around $0.1 per SMS for Nigeria...
Re: Help Needed On React Project by Nobody: 12:44pm On Dec 23, 2022
donproject2:


That's SendGrid I guess, their service charge is around $0.1 per SMS for Nigeria...

Is there no Nigerian version?
Re: Help Needed On React Project by QuoteJustOnce: 12:46pm On Dec 23, 2022
donproject2:


Good morning, do you please have any cheap SMS API service you can recommended. The ones I am seeing are quite expensive. Thanks in advance.

Hi there, to be quite frank, SMS is the last resort to communicating with your customers (unless you've got big money) cos it's freaking expensive when you want reliability. Fun fact, even with big money, you still have to approach the key players for discounted pricing else your big money turns to small money soon.
Major names i've worked with are Twilio and AWS Pinpoint for their insane reliability; but once again expensive not because they are expensive (no pun intended) but because of our weak currency. There are many others like the homegrown "smartsmssolutions" but not quite reliable in my opinion.
Re: Help Needed On React Project by Nobody: 12:52pm On Dec 23, 2022
donproject2:


That's SendGrid I guess, their service charge is around $0.1 per SMS for Nigeria...
Why not use email instead as a replacement for the sms thingy since you're looking for a way to cut costs? >
Re: Help Needed On React Project by QuoteJustOnce: 12:58pm On Dec 23, 2022
p.s: whatever sms solution you decide to go for, if you're using it for like a password reset, don't forget to implement some form of exponential backoff else it will end in premium tears for you. grin grin
Re: Help Needed On React Project by donproject2(m): 3:12pm On Dec 23, 2022
GREATIGBOMAN:

Why not use email instead as a replacement for the sms thingy since you're looking for a way to cut costs? >

I have that in place already. My choice of SMS option is because of the type app I am building...my client will prefer Verification Codes being sent to mobile numbers instead of emails.
Re: Help Needed On React Project by donproject2(m): 3:13pm On Dec 23, 2022
QuoteJustOnce:


Hi there, to be quite frank, SMS is the last resort to communicating with your customers (unless you've got big money) cos it's freaking expensive when you want reliability. Fun fact, even with big money, you still have to approach the key players for discounted pricing else your big money turns to small money soon.
Major names i've worked with are Twilio and AWS Pinpoint for their insane reliability; but once again expensive not because they are expensive (no pun intended) but because of our weak currency. There are many others like the homegrown "smartsmssolutions" but not quite reliable in my opinion.

Oh...thanks for the input
Re: Help Needed On React Project by donproject2(m): 3:15pm On Dec 23, 2022
GREATIGBOMAN:


Is there no Nigerian version?

There are, but as someone has mentioned earlier, they are far from being reliable
Re: Help Needed On React Project by QuoteJustOnce: 4:36pm On Dec 23, 2022
donproject2:


I have that in place already. My choice of SMS option is because of the type app I am building...my client will prefer Verification Codes being sent to mobile numbers instead of emails.

if you can find a way to integrate firebase (and like using firebase and don't mind getting locked to firebase) into your app, then you can use

spark plan:
$0/verification up to 10k times a month.

pay as you go:
a) standalone sms auth at $0.06/verification
b) complete identity package at $0/verification until you hit 50k active users/month

both options being cheaper than twilio and aws

1 Like

Re: Help Needed On React Project by donproject2(m): 5:06pm On Dec 23, 2022
QuoteJustOnce:


if you can find a way to integrate firebase (and like using firebase and don't mind getting locked to firebase) into your app, then you can use

spark plan:
$0/verification up to 10k times a month.

pay as you go:
a) standalone sms auth at $0.06/verification
b) complete identity package at $0/verification until you hit 50k active users/month

both options being cheaper than twilio and aws

Okay thanks.
Re: Help Needed On React Project by Nobody: 10:13pm On Dec 23, 2022
donproject2:


I have that in place already. My choice of SMS option is because of the type app I am building...my client will prefer Verification Codes being sent to mobile numbers instead of emails.

Why not discuss the cost with your client?

Since it's not a personal project financing something like this shouldn't be your problem.

You should tell the client the cost of getting a good sms API

if they can't handle the cost then they use the email alternative.


If you use a cheap service you may end up losing this client when the project goes live and the setback from your cheap sms api solution starts surfacing
Re: Help Needed On React Project by donproject2(m): 6:28pm On Dec 24, 2022
GREATIGBOMAN:


Why not discuss the cost with your client?

Since it's not a personal project financing something like this shouldn't be your problem.

You should tell the client the cost of getting a good sms API

if they can't handle the cost then they use the email alternative.


If you use a cheap service you may end up losing this client when the project goes live and the setback from your cheap sms api solution starts surfacing

The thing is, the app is a laundry management system whereby customers that leave their garments unclaimed for a certain period will be sent messages reminding them of their unclaimed orders and many other instances where messages need to be sent. Email service wouldn't suffice in this case and cost of per sms shouldn't be much, if not, any client will insist I look for a cheaper one.

Twilio's $0.15/sms for Nigeria client is equivalent to around N100/sms with $1/N750 exchange rate, this is a huge some to present to any client to start with.
Re: Help Needed On React Project by truthCoder2: 10:54pm On Dec 24, 2022
QuoteJustOnce:


if you can find a way to integrate firebase (and like using firebase and don't mind getting locked to firebase) into your app, then you can use

spark plan:
$0/verification up to 10k times a month.

pay as you go:
a) standalone sms auth at $0.06/verification
b) complete identity package at $0/verification until you hit 50k active users/month

both options being cheaper than twilio and aws

Implement a firebase admin-sdk that creates a user on firebase then on success, creates same user on your database. Update your user data with the uid returned from firebase before final transaction commit. When you want to send a message, you fetch uid from your message and pass props to the relevant firebase function.

You still have the chance to handle your authentication or allow firebase handle same from the frontend
Re: Help Needed On React Project by donproject2(m): 9:57pm On Jan 09, 2023
truthCoder2:


Implement a firebase admin-sdk that creates a user on firebase then on success, creates same user on your database. Update your user data with the uid returned from firebase before final transaction commit. When you want to send a message, you fetch uid from your message and pass props to the relevant firebase function.

You still have the chance to handle your authentication or allow firebase handle same from the frontend

Thank you bro...
Re: Help Needed On React Project by donproject2(m): 10:19pm On Jan 09, 2023
QuoteJustOnce:


Yes something like Nextjs would have given you an all-in-one package (fe + api). So i wonder why you had to make a standalone api (server). Unless of course you plan on making the api available publicly or would want to sell it later as a paid integration. else, it's an overkill. You also have to think of portability and scalability. if you are deploying several tools on servers minus your application, then how fast can you move these to a new server, if the client would want to switch servers? then the financial aspect, why should you incur extra cost just to host some kind of tool that your app needs. There are special cases for these, so you have to decide is it worth it? If it isn't, then an all-in-one solution would be the better and faster option. Once again reduce your need for overbloated node_modules, unless absolutely required without another way out, client project or not. The world is moving towards leaner bundles (that's why we now have stuffs like Astro) and if you can help it, do it. it pays in the long run.

I had to come back to this because you said a lot of things that will help and may be raise further question whenever I want to see what is up Nextjs. I think I am done with the laundry ERP project, testing phase I guess I am. You may want to see what I have done lol.

Moving on. Before I start learning new tools, I always love to be convinced that such tool is worth my time and may be my money. I picked few introductory tutorials recently on Nextjs and what I saw actually wowed me, I remember what you said about all-in-one package (fe + api) , I never knew Nextjs has that capability. This literally means I can eliminate Express for building APIs with NExtjs(I believe I am not wrong). I have not started learning it per se, I watched few videos, browsed through internet to read generally about Nextjs, its pros and cons, where it better performs above React. I need few clarification which I believe it is best to bring it here.

Not to beat around the bush so much, let me tell you what I can do with Express or what I did with it during my last project.
1. I could separate routing and the actual API functions (controllers) and matrch them together later, for cleaner code, I know with Next, folder structure (inside the api folder created by Next) and the name of the file serves as the API endpoint when needed to be called from the Frontend. This is cleared out
2. I could create Middlewares that must return TRUE in order to allow next function called close to it to be called, i.e I can use a kind of authentication on selected routes, these routes are only accessible if the middleware called before them returns TRUE. Can you tell me I can do this with Nextjs as well. (If this is possible, I am jumping right into it)
Re: Help Needed On React Project by LikeAking: 11:14pm On Jan 09, 2023
U for use word press for jobs like this..
Re: Help Needed On React Project by QuoteJustOnce: 11:36pm On Jan 09, 2023
@donproject2

I'll highlight your concerns in "strong" text and my answers in black

Moving on. Before I start learning new tools, I always love to be convinced that such tool is worth my time and may be my money.
Without arguments, Nextjs is one of the best frontend frameworks, no cap! A few comparison videos on YTube will clear your doubts. These days they even work together with the React to ensure any new React features are incorporated. One good example would be internationalized routing by default i.e. setting up different locales for your project. So a user in France sees your app in French and a user in Nigeria sees it in English, or one in Spain sees it in Spanish. Of course you have to provide the content or use something like i18n but then Next will automatically detect the locale and serve the appropriate page; without waiting for the page to load and have the user select the appropriate language. If you think about it deeply, that's more like server-side logic for static pages; 2 different paradigms that shouldnt naturally coexist and Next makes it happen.

I remember what you said about all-in-one package (fe + api) , I never knew Nextjs has that capability. This literally means I can eliminate Express for building APIs with NExtjs(I believe I am not wrong).
Yes, you aint wrong. In fact, you could build out your API's only without frontend and then that would be a direct replacement for an Express API app. Which means you could do FE only, BE only or both if you wish to.

I could separate routing and the actual API functions (controllers) and matrch them together later, for cleaner code, I know with Next, folder structure (inside the api folder created by Next) and the name of the file serves as the API endpoint when needed to be called from the Frontend. This is cleared out
Yes, Then there is the more advanced one called the Edge API routing. They dont' use the native Nodejs runtime but the Edge runtime i.e. they are built with standard web apis. And you can do one powerful thing with this.... Streaming!

I could create Middlewares that must return TRUE in order to allow next function called close to it to be called, i.e I can use a kind of authentication on selected routes, these routes are only accessible if the middleware called before them returns TRUE. Can you tell me I can do this with Nextjs as well.
Oh yes, Nextjs has middlewares as you would do in Express and more. Authentication? check. Bot protection? check. A/B testing? check. Localization? check. If you don't like the automatic locale detection mentioned above, then you could use middlewares to serve the correct content for a locale.

1 Like

Re: Help Needed On React Project by QuoteJustOnce: 11:42pm On Jan 09, 2023
p.s.: if you want to share what you've done, then i'd be much obliged to see it, sir!
Re: Help Needed On React Project by donproject2(m): 1:20pm On Jan 10, 2023
QuoteJustOnce:
@donproject2

I'll highlight your concerns in "strong" text and my answers in black

Moving on. Before I start learning new tools, I always love to be convinced that such tool is worth my time and may be my money.
Without arguments, Nextjs is one of the best frontend frameworks, no cap! A few comparison videos on YTube will clear your doubts. These days they even work together with the React to ensure any new React features are incorporated. One good example would be internationalized routing by default i.e. setting up different locales for your project. So a user in France sees your app in French and a user in Nigeria sees it in English, or one in Spain sees it in Spanish. Of course you have to provide the content or use something like i18n but then Next will automatically detect the locale and serve the appropriate page; without waiting for the page to load and have the user select the appropriate language. If you think about it deeply, that's more like server-side logic for static pages; 2 different paradigms that shouldnt naturally coexist and Next makes it happen.

I remember what you said about all-in-one package (fe + api) , I never knew Nextjs has that capability. This literally means I can eliminate Express for building APIs with NExtjs(I believe I am not wrong).
Yes, you aint wrong. In fact, you could build out your API's only without frontend and then that would be a direct replacement for an Express API app. Which means you could do FE only, BE only or both if you wish to.

I could separate routing and the actual API functions (controllers) and matrch them together later, for cleaner code, I know with Next, folder structure (inside the api folder created by Next) and the name of the file serves as the API endpoint when needed to be called from the Frontend. This is cleared out
Yes, Then there is the more advanced one called the Edge API routing. They dont' use the native Nodejs runtime but the Edge runtime i.e. they are built with standard web apis. And you can do one powerful thing with this.... Streaming!

I could create Middlewares that must return TRUE in order to allow next function called close to it to be called, i.e I can use a kind of authentication on selected routes, these routes are only accessible if the middleware called before them returns TRUE. Can you tell me I can do this with Nextjs as well.
Oh yes, Nextjs has middlewares as you would do in Express and more. Authentication? check. Bot protection? check. A/B testing? check. Localization? check. If you don't like the automatic locale detection mentioned above, then you could use middlewares to serve the correct content for a locale.

This is very very helpful...thanks man

(1) (2) (Reply)

Mobile App With Ionic - Cors / Somebody Should Help Me With Php Function That Generate Barcode(qr CODE) / English Dictionary In Xml/json Format

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 107
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.