React Node.js Fiverr App Full Tutorial | MERN Stack Freelance Service App w/ Stripe
If you’re looking to build a freelance service app using the MERN stack and integrate payment processing with Stripe, you’ve come to the right place. In this tutorial, we’ll walk through the process of creating a Fiverr-like application using React for the front end, Node.js for the back end, and MongoDB as the database. We’ll also cover how to integrate Stripe for processing payments from clients.
Prerequisites
Before getting started, make sure you have the following tools and technologies installed:
- Node.js
- npm or yarn
- React
- Express
- MongoDB
- Stripe account
Setting up the backend
First, we’ll create the backend using Node.js and Express. Start by creating a new directory for your project and initializing a new Node.js project with npm. Then, install the necessary dependencies:
mkdir freelance-app
cd freelance-app
npm init -y
npm install express mongoose stripe
Next, create a server file (e.g. server.js) and set up the Express app to handle routes and connect to the MongoDB database. You’ll also need to set up routes for handling user authentication, creating gigs, and processing payments using Stripe.
Creating the frontend with React
Now that the backend is set up, it’s time to create the front end using React. Start by creating a new React app within the same project directory:
npx create-react-app client
This will generate a new subdirectory called “client” with all the necessary boilerplate for a React app. You can then start building out the front end by creating components for displaying and managing gigs, user authentication, and integrating with the Stripe payment processing.
Integrating Stripe for payments
To enable payment processing in your app, you’ll need to set up a Stripe account and obtain your API keys. Once you have your keys, you can use the Stripe SDK to create a payment form and process payments securely on your app.
Testing and deployment
Before deploying your app, be sure to thoroughly test its functionality and security. You can use tools like Postman to test your API endpoints and Stripe’s test mode for processing payments without using real credit cards. Once you’re confident in your app, you can deploy it to a hosting service like Heroku or AWS.
Conclusion
Building a freelance service app with the MERN stack and integrating Stripe for payments is a challenging but rewarding endeavor. By following this tutorial, you’ll gain valuable experience in creating full-stack applications and handling online payments, which can be applied to a wide range of e-commerce and service-based projects.
Hi. Does it have payment for every user. Will each user recieve their payment when buyer makes an order?
That approach to cloudinary upload was a master move
but after the payment , money is in your stripe account only 😢
at 1:08:21 can anybody explain how the verifyToken middleware's next() function knows which next() function has to be called, the deleteUser one or the Errorone
Hi there,
once you created your gig it won't show but if you change at "CatCard" component line 7
<Link to="/gigs?cat=design">
<Link to="/gigs?cat="> // delete design , then it will show the Gigs
cheers😄
At 1:58:00 i got another error in console – 404 and you got 401. Can somebody tell me what happend?
Handle submit should be async
My gig is not showing because we pass id instead we have to pass ._id inside useQuery newRequest
did anyone hosted this? is it working fine ?
Is it ready to launch?
Thanks Very Much 😘🥰🤩
I learned more about Node+React 💫👍
You are an amazing person i am missing words to thank you, Omg Thank you so much for this
Has anyone found a solution for the myGigs page? I am having difficulty fetching and rendering all gigs for a particular seller. The page is supposed to show all gigs added for the seller, however I keep coming up with an empty page…
I am having error in 4:27:06 whenever i am creating a gig, console says it has axios error. Anyone has the fix? Thanks!
Please make video on how to deploy it
Fully appreciable can You make a video on how to host this Website on Internet
use MERN again
{withCredentials:true} throwing an error. Any solution??
I would recommend to use "luxon" library instead of "moment". Thanx Lama!
Hello, @LamaDev you have really been very helpful with these video tutorials. I would like to ask a question and it goes this way, is it possible to prevent the profile picture from being uploaded when the user is already registered or when there is an error in registering the user.