├── backend
├── .gitignore
├── .env
├── utils
│ ├── errorResponse.js
│ └── cloudinary.js
├── routes
│ ├── banner.js
│ ├── category.js
│ ├── user.js
│ ├── auth.js
│ └── product.js
├── models
│ ├── category.js
│ ├── banner.js
│ ├── product.js
│ └── user.js
├── package.json
├── controllers
│ ├── categoryController.js
│ ├── bannerController.js
│ ├── user.js
│ ├── auth.js
│ └── productController.js
├── middleware
│ ├── error.js
│ └── auth.js
└── app.js
├── frontend
├── public
│ ├── robots.txt
│ ├── favicon.ico
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── index.html
├── src
│ ├── setupTests.js
│ ├── App.test.js
│ ├── pages
│ │ ├── admin
│ │ │ ├── AdminDashboard.js
│ │ │ ├── AdminAddBanner.js
│ │ │ └── AdminCreateProduct.js
│ │ ├── user
│ │ │ └── UserDashboard.js
│ │ ├── SignIn.js
│ │ ├── SignUp.js
│ │ └── Home.js
│ ├── component
│ │ ├── PrivateRoute.js
│ │ ├── Footer.js
│ │ ├── Card.js
│ │ ├── Header.js
│ │ └── Banner.js
│ ├── index.css
│ ├── reportWebVitals.js
│ ├── index.js
│ ├── App.js
│ └── App.css
├── .gitignore
├── package.json
└── README.md
└── README.md
/backend/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/frontend/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/frontend/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emmannweb/mernstackproject/HEAD/frontend/public/favicon.ico
--------------------------------------------------------------------------------
/frontend/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emmannweb/mernstackproject/HEAD/frontend/public/logo192.png
--------------------------------------------------------------------------------
/frontend/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emmannweb/mernstackproject/HEAD/frontend/public/logo512.png
--------------------------------------------------------------------------------
/backend/.env:
--------------------------------------------------------------------------------
1 | PORT = 8000
2 | DATABASE =
3 | JWT_SECRET = JBFSJKEFNJK23INU78
4 | EXPIRE_TOKEN = 1*60*60*1000
5 | CLOUD_NAME=
6 | CLOUD_KEY=
7 | CLOUD_KEY_SECRET=
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MERN stack Project
2 | ## This is a Youtube series, where we are building a MERN stack project from scratch.
3 |
4 | ### Youtube Link: https://www.youtube.com/playlist?list=PLw9dqMP7HQV77fkIZvUfsVJkM_WPvw-J-
5 |
--------------------------------------------------------------------------------
/backend/utils/errorResponse.js:
--------------------------------------------------------------------------------
1 | class ErrorResponse extends Error{
2 |
3 | constructor(message, statusCode){
4 | super(message);
5 | this.statusCode = statusCode;
6 | }
7 |
8 | }
9 |
10 | module.exports = ErrorResponse;
--------------------------------------------------------------------------------
/backend/utils/cloudinary.js:
--------------------------------------------------------------------------------
1 | const cloudinary = require('cloudinary').v2;
2 |
3 | cloudinary.config({
4 | cloud_name: process.env.CLOUD_NAME,
5 | api_key: process.env.CLOUD_KEY,
6 | api_secret: process.env.CLOUD_KEY_SECRET
7 | });
8 |
9 | module.exports= cloudinary;
--------------------------------------------------------------------------------
/frontend/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/frontend/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render(