This is a user profile dashboard application.
It includes:
- Backend API with Express and MongoDB
- Routes for auth, login, register, profile page
- JWT authentication stored in browser local storage
- Middleware for verifying JWT token
- Error messages with Toast library
- React frontend for login, register, profile page
- Tailwind CSS
- In the frontend folder, create a file named
.env
, and put the following inside it, remember to change the server domain to yours:
REACT_APP_SERVER_DOMAIN=<YOUR_SERVER_DOMAIN>
- In the backend folder, create a file named
config.js
and put the following inside it:
export default {
JWT_SECRET: <'YOUR_JWT_SECRET_KEY'>,
ATLAS_URI:
<'YOUR_ATLAS_URI'>,
};
- Open the termial, and type in:
openssl rand -base64 32
- Press enter, copy the returned value, and replace it in the
JWT_SECRET
in theconfig.js
file. - Go to MongoDB Atlas, sign in and create a new database, copy the
Atlas URI
and replace it in theATLAS_URI
in the ``config.js` file.
- fontend
cd frontend
npm install
- backend
cd backend
npm install
- fontend
cd frontend
npm start
- backend
cd backend
npm start