This is the first project I have built using MERN Stack.
I have learnt so much from this project.
From configuring a NoSQL Database like MongoDB, using express and node as servers, to using a complex framework like React for the frontend. It is overwhelming.
As you can already see, the project is coded in a neatly structured way and I have used some not-so-common React concepts in making it.
I have used React useContext() hook to provide the user data to the whole app and used a useReducer() hook for better usage of the useContext() hook.
The useReducer() hook is a bit complex to understand at the beginning. But, you will get used to it.
The major part of the Authentication at the backend is provided using a middleware file i.e., requireAuth.js.
We have used two schema types that are declared using Mongoose. One is for the data and the other one is for the user's data.
For the backend part, the server.js file serves as the main file through which all of the backend is integrated.
I have also created custom hooks to support the useContext() hooks, and to provide the Login, Signup, and Logout functionalities repsectively.
There are only three pages that the users can access. The Login form, The Signup form, and the Home page.
There is so much to improve in this project.
Any contributions are welcomed.