Top Tweets for #AuthMiddleware
Learning MERN BY Building 50 projects
Project 2 : To Do App with CRUD API
Phase 2 :
1. Added User Auth
-> bcrypt , JWT, authMiddleware
2. Mutli - User Design
3. Rate limiting & security Middleware
-helmet , xss-clean,cors, express-rate-limit
#buildinginpublic
Learning MERN BY Building 50 projects
Project 2 : To Do App with CRUD API
Phase 2 :
1. Added User Auth
-> bcrypt , JWT, authMiddleware
2. Mutli - User Design
3. Rate limiting & security Middleware
-helmet , xss-clean,cors, express-rate-limit
#buildinginpublic

Learning MERN BY Building 50 projects
Project 2 : To Do App with CRUD API
Phase 2 :
1. Added User Auth
-> bcrypt , JWT, authMiddleware
2. Mutli - User Design
3. Rate limiting & security Middleware
-helmet , xss-clean,cors, express-rate-limit
#buildinginpublic

progress so far,
> added product and category schema
> implmented authMiddleware, adminMiddleware and adminOrSellerMiddleware for route protection and RBAC

Day 120 of my FULL STACK DEV JOURNEY
Spent the day debugging and refining the backend of my blog project.
• Fixed swapped createBlog & getAllBlogs functions
• Resolved a critical bug in authMiddleware
• Cleaned up redundant checks and typos
Will share the repo tonight
Day 25
> Completed all the endpoints for the app
> Ran into couple of issue the major one being me not realizing that the name of tables were different in the server and frontend (USERS <-> users)
> Another auth concept is the authMiddleware which intercepts the incoming requ-

> Added balances and transactions endpoints using mongoose transactions to PayTM project.
> Spent an hour fixing bugs only to realise I assigned authMiddleware as const and not function.
> On easier counterparts looked into Dijkstra Algo
> Started assignment on making PayTM end to end today made the User Routes and authMiddleware.
> Revised Kahn algorithm and how it can be used in various scenarios.
Love how challenging every day has become.
Day 5: E-commerce Backend 🚀
✅ Built authMiddleware for secure access
✅ Created a public Featured Products route
✅ Integrated Cloudinary for image storage
✅ Added admin-only product creation & deletion
✅ Implemented Recommendations API
#Backend #Ecommerce #NodeJS
HOW TO STRUCTURE YOUR Fullstack Development PROJECT (Serverless Stack with JavaScript, TypeScript, and AWS)⬇️
📁 `serverless-project/`
├── 📁 `client/` (Frontend - React.js)
│ ├── 📁 `src/`
│ │ ├── 📁 `components/`
│ │ │ ├── 📄 `Header.js`
│ │ │ ├── 📄 `Footer.js`
│ │ │ └── 📄 `Navbar.js`
│ │ ├── 📁 `pages/`
│ │ │ ├── 📄 `Home.js`
│ │ │ ├── 📄 `About.js`
│ │ │ └── 📄 `Contact.js`
│ │ ├── 📁 `assets/`
│ │ │ ├── 📁 `images/`
│ │ │ │ ├── 📄 `logo.png`
│ │ │ │ └── 📄 `banner.jpg`
│ │ │ ├── 📁 `css/`
│ │ │ │ ├── 📄 `style.css`
│ │ │ │ └── 📄 `theme.css`
│ │ │ └── 📁 `js/`
│ │ │ ├── 📄 `utils.js`
│ │ │ └── 📄 `constants.js`
│ │ ├── 📄 `App.js`
│ │ ├── 📄 `index.js`
│ │ └── 📄 `package.json`
│ └── 📄 `.env` (Frontend environment variables)
│
├── 📁 `backend/` (Serverless Backend - AWS Lambda)
│ ├── 📁 `functions/`
│ │ ├── 📄 `getUser.ts`
│ │ ├── 📄 `createPost.ts`
│ │ └── 📄 `deletePost.ts`
│ ├── 📁 `middlewares/`
│ │ ├── 📄 `authMiddleware.ts`
│ │ └── 📄 `errorHandler.ts`
│ ├── 📁 `helpers/`
│ │ ├── 📄 `logger.ts`
│ │ └── 📄 `utilities.ts`
│ ├── 📁 `models/`
│ │ ├── 📄 `UserModel.ts`
│ │ └── 📄 `PostModel.ts`
│ ├── 📄 `serverless.yml` (Infrastructure as Code)
│ ├── 📄 `tsconfig.json` (TypeScript Configuration)
│ ├── 📄 `.env` (Environment variables for Lambda)
│ ├── 📄 `package.json`
│ └── 📄 `.gitignore`
│
├── 📁 `database/` (DynamoDB or Aurora Serverless)
│ ├── 📄 `schema.json` (DynamoDB table schema)
│ ├── 📄 `seed.json` (Sample data for testing)
│ └── 📄 `migrations.sql` (Optional: Aurora Serverless migrations)
│
├── 📁 `logs/`
│ ├── 📄 `error.log`
│ ├── 📄 `access.log`
│ └── 📄 `debug.log`
│
├── 📁 `docs/` (Documentation)
│ └── 📄 `https://t.co/shpCukooKd`
├── 📄 `LICENSE`
└── 📄 `.gitignore`
Explanation of Key Directories:
1️⃣ `client/`: Frontend (React.js with JavaScript)
- `src/components/`: Reusable UI components (e.g., Header, Footer, Navbar).
- `src/pages/`: Contains route-specific React components (e.g., Home, About).
- `src/assets/`: Static assets like images, stylesheets, and JavaScript utilities.
- `App.js`: Main React app component.
- `index.js`: Entry point for rendering the React app.
2️⃣ `backend/`: Serverless Backend (AWS Lambda with TypeScript)
- `functions/`: Contains Lambda functions for API endpoints.
- `middlewares/`: Middleware for authentication and error handling.
- `helpers/`: Utility functions for logging and reusable code.
- `models/`: Schema definitions for data structures (e.g., UserModel, PostModel).
- `serverless.yml`: Infrastructure as Code file to configure AWS resources.
3️⃣ `database/`: NoSQL or Serverless Database
- `schema.json`: Defines the structure of your DynamoDB tables.
- `seed.json`: Sample data for populating the database.
- `migrations.sql`: Optional migration scripts for Aurora Serverless.
4️⃣ `logs/`: Application Logs
Tracks errors, access details, and debug information.
5️⃣ `docs/`: Documentation
Includes project details, setup instructions, and usage notes.
Use this structure for scalable and maintainable Serverless projects with JavaScript, TypeScript, and AWS services!
Get all resources at https://t.co/dM4eJfmwg8
Bookmark 💪
Follow me @e_opore 🔔 for more Fullstack project guides!

HOW TO STRUCTURE YOUR Fullstack Development PROJECT (PostgreSQL, Express, React, Node.js - PERN Stack)⬇️
📁 pern-project/
├── 📁 client/ (Frontend - React.js)
│ ├── 📁 src/
│ │ ├── 📁 components/
│ │ │ ├── 📄 Header.js
│ │ │ ├── 📄 Footer.js
│ │ │ └── 📄 Navbar.js
│ │ ├── 📁 pages/
│ │ │ ├── 📄 Home.js
│ │ │ ├── 📄 About.js
│ │ │ └── 📄 Contact.js
│ │ ├── 📁 assets/
│ │ │ ├── 📁 images/
│ │ │ │ ├── 📄 logo.png
│ │ │ │ └── 📄 banner.jpg
│ │ │ ├── 📁 css/
│ │ │ │ ├── 📄 style.css
│ │ │ │ └── 📄 theme.css
│ │ │ └── 📁 js/
│ │ │ ├── 📄 utils.js
│ │ │ └── 📄 constants.js
│ │ ├── 📄 App.js
│ │ ├── 📄 index.js
│ │ └── 📄 package.json
│ └── 📄 .env (Frontend environment variables)
│
├── 📁 server/ (Backend - Node.js & Express.js)
│ ├── 📁 controllers/
│ │ ├── 📄 userController.js
│ │ └── 📄 postController.js
│ ├── 📁 models/ (Database Models - Sequelize/Prisma)
│ │ ├── 📄 UserModel.js
│ │ └── 📄 PostModel.js
│ ├── 📁 routes/
│ │ ├── 📄 userRoutes.js
│ │ └── 📄 postRoutes.js
│ ├── 📁 middlewares/
│ │ ├── 📄 authMiddleware.js
│ │ └── 📄 errorHandler.js
│ ├── 📁 config/
│ │ ├── 📄 database.js
│ │ └── 📄 appConfig.js
│ ├── 📁 helpers/
│ │ ├── 📄 logger.js
│ │ └── 📄 utilities.js
│ ├── 📁 tests/ (Backend Testing)
│ │ ├── 📄 user.test.js
│ │ └── 📄 post.test.js
│ ├── 📄 server.js (Main entry point for the backend)
│ ├── 📄 .env (Backend environment variables)
│ ├── 📄 package.json
│ └── 📄 .gitignore
│
├── 📁 database/ (PostgreSQL)
│ ├── 📄 pern_project.sql (Database schema)
│ ├── 📄 migrations.sql (Migration scripts)
│ └── 📄 seed.sql (Sample data)
│
├── 📁 logs/
│ ├── 📄 error.log
│ ├── 📄 access.log
│ └── 📄 debug.log
│
├── 📁 docs/ (Documentation)
│ └── 📄 https://t.co/shpCukooKd
├── 📄 LICENSE
└── 📄 .gitignore
Explanation of Key Directories:
1️⃣ client/: Frontend (React.js)
➡️src/components/: Reusable UI components (e.g., Header, Footer, Navbar).
➡️src/pages/: Contains route-specific React components (e.g., Home, About).
➡️src/assets/: Static assets like images, stylesheets, and JavaScript utilities.
➡️App.js: Main React app component.
➡️index.js: Entry point for rendering the React app.
2️⃣ server/: Backend (Node.js & Express.js)
➡️controllers/: Business logic for handling requests (e.g., CRUD operations).
➡️models/: Database models (PostgreSQL with Sequelize/Prisma).
➡️routes/: API endpoint definitions (e.g., RESTful endpoints for users/posts).
➡️middlewares/: Middleware for authentication, error handling, and logging.
➡️config/: Configuration files (e.g., database connections, app settings).
➡️tests/: Backend test cases.
3️⃣ database/: PostgreSQL
➡️pern_project.sql: Schema for creating tables and relationships.
➡️migrations.sql: Migration files to modify the database structure.
➡️seed.sql: Sample data for initial testing.
4️⃣ logs/: Application Logs
Tracks errors, access details, and debug information.
5️⃣ docs/: Documentation
Includes project details, setup instructions, and usage notes.
Use this structure for scalable and maintainable Fullstack Projects with PostgreSQL, Express, React, and Node.js (PERN Stack)!
Bookmark 💪
Follow me @e_opore 🔔 for more Fullstack project guides!

HOW TO STRUCTURE YOUR Fullstack Development PROJECT (LAMP Stack)⬇️
📁 lamp-project/
├── 📁 public/ (Frontend - HTML, CSS, JavaScript)
│ ├── 📁 css/
│ │ ├── 📄 style.css
│ │ ├── 📄 theme.css
│ │ └── 📄 responsive.css
│ ├── 📁 js/
│ │ ├── 📄 app.js
│ │ ├── 📄 validation.js
│ │ └── 📄 api.js
│ ├── 📁 images/
│ │ ├── 📄 logo.png
│ │ └── 📄 banner.jpg
│ ├── 📄 index.html
│ ├── 📄 about.html
│ ├── 📄 contact.html
│ └── 📄 404.html
│
├── 📁 src/ (Backend - PHP)
│ ├── 📁 controllers/
│ │ ├── 📄 UserController.php
│ │ └── 📄 PostController.php
│ ├── 📁 models/
│ │ ├── 📄 UserModel.php
│ │ └── 📄 PostModel.php
│ ├── 📁 views/
│ │ ├── 📄 header.php
│ │ ├── 📄 footer.php
│ │ └── 📄 layout.php
│ ├── 📁 routes/
│ │ ├── 📄 web.php
│ │ └── 📄 api.php
│ ├── 📁 config/
│ │ ├── 📄 database.php
│ │ └── 📄 config.php
│ ├── 📁 middlewares/
│ │ ├── 📄 AuthMiddleware.php
│ │ └── 📄 ErrorHandler.php
│ ├── 📁 helpers/
│ │ ├── 📄 utilities.php
│ │ └── 📄 constants.php
│ ├── 📄 index.php (Main entry point)
│ ├── 📄 .htaccess (Apache configuration)
│ └── 📄 composer.json (Dependencies)
│
├── 📁 database/ (MySQL)
│ ├── 📄 lamp_project.sql (Database schema)
│ ├── 📄 seed.sql (Sample data for testing)
│ └── 📄 migrations.sql (Migration files)
│
├── 📁 logs/
│ ├── 📄 error.log
│ ├── 📄 access.log
│ └── 📄 debug.log
│
├── 📁 docs/ (Project documentation)
│ └── 📄 https://t.co/shpCukoWzL
├── 📄 LICENSE
├── 📄 .gitignore
└── 📄 .env (Environment variables)
Explanation of Key Directories:
1️⃣ public/: Frontend assets (HTML, CSS, JavaScript).
- css/: Stylesheets for the website.
- js/: JavaScript files for interactivity and API requests.
- images/: Static images used in the website.
2️⃣ src/: Backend code (PHP).
-controllers/: Handles user and business logic (e.g., CRUD operations).
-models/: Interacts with the database (MySQL).
-views/: Contains reusable PHP view files like headers and footers.
-routes/: Defines routes for web and API endpoints.
-config/: Contains configuration files like database connections.
-middlewares/: Handles authentication and error handling.
-helpers/: Utility functions and reusable constants.
3️⃣ database/: MySQL database schema, migration files, and seed data.
4️⃣ logs/: Application logs for debugging and error tracking.
5️⃣ docs/: Documentation for your project.
Use this structure for scalable and maintainable LAMP Stack projects!
Bookmark 💪
Follow me @e_opore 🔔 for more Fullstack project guides!

HOW TO STRUCTURE YOUR Fullstack Development PROJECT (MEAN Stack)⬇️
📁 mean-project/
├── 📁 client/ (Frontend - Angular)
│ ├── 📁 src/
│ │ ├── 📁 app/
│ │ │ ├── 📁 components/
│ │ │ │ ├── 📁 ui/
│ │ │ │ │ ├── 📄 button.component.ts
│ │ │ │ │ ├── 📄 card.component.ts
│ │ │ │ │ └── 📄 modal.component.ts
│ │ │ │ ├── 📁 forms/
│ │ │ │ │ ├── 📄 login-form.component.ts
│ │ │ │ │ └── 📄 register-form.component.ts
│ │ │ │ └── 📁 layout/
│ │ │ │ ├── 📄 header.component.ts
│ │ │ │ └── 📄 footer.component.ts
│ │ │ ├── 📁 pages/
│ │ │ │ ├── 📄 home.component.ts
│ │ │ │ ├── 📄 dashboard.component.ts
│ │ │ │ └── 📄 profile.component.ts
│ │ │ ├── 📁 services/
│ │ │ │ ├── 📄 auth.service.ts
│ │ │ │ └── 📄 api.service.ts
│ │ │ ├── 📁 models/
│ │ │ │ ├── 📄 user.model.ts
│ │ │ │ └── 📄 post.model.ts
│ │ │ ├── 📁 guards/
│ │ │ │ ├── 📄 auth.guard.ts
│ │ │ │ └── 📄 admin.guard.ts
│ │ │ ├── 📁 pipes/
│ │ │ │ └── 📄 format-date.pipe.ts
│ │ │ ├── 📄 app.module.ts
│ │ │ ├── 📄 app-routing.module.ts
│ │ │ └── 📄 app.component.ts
│ │ ├── 📁 assets/
│ │ │ ├── 📁 images/
│ │ │ │ └── 📄 logo.png
│ │ │ ├── 📁 styles/
│ │ │ │ ├── 📄 theme.scss
│ │ │ │ └── 📄 globals.scss
│ │ │ └── 📁 icons/
│ │ │ └── 📄 menu.svg
│ │ ├── 📄 environments/
│ │ │ ├── environment.ts
│ │ │ └── https://t.co/XHJaLBAiuY.ts
│ │ ├── 📄 index.html
│ │ ├── 📄 main.ts
│ │ └── 📄 polyfills.ts
│ ├── 📄 angular.json
│ ├── 📄 package.json
│ └── 📄 .env
│
├── 📁 server/ (Backend - Node.js & Express)
│ ├── 📁 controllers/
│ │ ├── 📄 authController.js
│ │ └── 📄 userController.js
│ ├── 📁 models/
│ │ ├── 📄 User.js
│ │ └── 📄 Post.js
│ ├── 📁 routes/
│ │ ├── 📄 authRoutes.js
│ │ └── 📄 userRoutes.js
│ ├── 📁 middlewares/
│ │ ├── 📄 authMiddleware.js
│ │ └── 📄 errorHandler.js
│ ├── 📁 config/
│ │ ├── 📄 db.js
│ │ └── 📄 keys.js
│ ├── 📄 server.js
│ ├── 📄 package.json
│ ├── 📄 .env
│ └── 📄 .gitignore
│
├── 📁 docs/
│ └── 📄 https://t.co/shpCukoWzL
├── 📄 LICENSE
└── 📄 .gitignore
Explanation of Key Directories:
1️⃣ client/: Frontend (Angular) codebase.
√app/: Main Angular application folder.
√components/: Reusable Angular components.
√pages/: Views or pages for the application.
√services/: Frontend services (e.g., API calls).
√models/: TypeScript interfaces/models.
√guards/: Route guards for authentication/authorization.
√pipes/: Custom Angular pipes.
√assets/: Static assets such as images, styles, and icons.
√environments/: Environment-specific configurations.
2️⃣ server/: Backend (Node.js + Express) codebase.
√controllers/: Functions for handling API requests.
√models/: Mongoose schemas for MongoDB collections.
√routes/: Express route handlers.
√middlewares/: Custom middleware for request processing.
√config/: Database and environment configurations.
3️⃣ docs/: Project documentation.
4️⃣ server.js: Entry point for the backend server.
For deep explanation of MEAN stack project structure with code snippets check here ( https://t.co/gIUcnTVsNt )
Use this structure to build scalable, maintainable MEAN Stack projects!
Bookmark 💪
Follow me @e_opore Turn on notifications🔔 for more Fullstack project guides!

HOW TO STRUCTURE YOUR Fullstack Development PROJECT (MERN Stack)⬇️
📁 mern-project/
├── 📁 client/ (Frontend)
│ ├── 📁 src/
│ │ ├── 📁 components/
│ │ │ ├── 📁 ui/
│ │ │ │ ├── 📄 Button.jsx
│ │ │ │ ├── 📄 Card.jsx
│ │ │ │ └── 📄 Modal.jsx
│ │ │ ├── 📁 forms/
│ │ │ │ ├── 📄 LoginForm.jsx
│ │ │ │ └── 📄 RegisterForm.jsx
│ │ │ └── 📁 layout/
│ │ │ ├── 📄 Header.jsx
│ │ │ └── 📄 Footer.jsx
│ │ ├── 📁 pages/
│ │ │ ├── 📄 Home.jsx
│ │ │ ├── 📄 Dashboard.jsx
│ │ │ └── 📄 Profile.jsx
│ │ ├── 📁 hooks/
│ │ │ ├── 📄 useAuth.js
│ │ │ └── 📄 useFetch.js
│ │ ├── 📁 contexts/
│ │ │ ├── 📄 AuthContext.jsx
│ │ │ └── 📄 ThemeContext.jsx
│ │ ├── 📁 services/
│ │ │ ├── 📄 api.js
│ │ │ └── 📄 auth.js
│ │ ├── 📁 styles/
│ │ │ ├── 📄 globals.css
│ │ │ └── 📄 components.css
│ │ ├── 📁 assets/
│ │ │ ├── 📁 images/
│ │ │ │ └── 📄 logo.png
│ │ │ └── 📁 icons/
│ │ │ └── 📄 menu.svg
│ │ ├── 📄 App.jsx
│ │ ├── 📄 index.jsx
│ │ └── 📄 setupProxy.js
│ ├── 📄 package.json
│ └── 📄 .env
│
├── 📁 server/ (Backend)
│ ├── 📁 controllers/
│ │ ├── 📄 authController.js
│ │ └── 📄 userController.js
│ ├── 📁 models/
│ │ ├── 📄 User.js
│ │ └── 📄 Post.js
│ ├── 📁 routes/
│ │ ├── 📄 authRoutes.js
│ │ └── 📄 userRoutes.js
│ ├── 📁 middlewares/
│ │ ├── 📄 authMiddleware.js
│ │ └── 📄 errorHandler.js
│ ├── 📁 config/
│ │ ├── 📄 db.js
│ │ └── 📄 keys.js
│ ├── 📄 server.js
│ ├── 📄 package.json
│ ├── 📄 .env
│ └── 📄 .gitignore
│
├── 📁 docs/
│ └── 📄 https://t.co/shpCukooKd
├── 📄 LICENSE
└── 📄 .gitignore
Explanation of Key Directories:
1️⃣ client/: Frontend (React) codebase.
•components/: Reusable React components.
•pages/: Application views/pages.
•hooks/: Custom React hooks.
•contexts/: Context API for global state management.
•services/: Frontend API requests and services.
•styles/: CSS for components and layouts.
•assets/: Images, icons, and other static files.
2️⃣ server/: Backend (Node.js + Express) codebase.
•controllers/: Functions for handling API requests.
•models/: Mongoose schemas for MongoDB collections.
•routes/: Express route handlers.
•middlewares/: Custom middleware for request processing.
•config/: Database and environment configurations.
3️⃣ docs/: Project documentation.
4️⃣ server.js: Entry point for the backend server.
Use this structure to maintain a clean, scalable MERN Stack project!
Bookmark 💪
Follow me @e_opore 🔔 for more Fullstack project templates 💻
Like ❤

Trends for you
Most Popular Users

Elon Musk 
@elonmusk
239.3M followers

Barack Obama 
@barackobama
118.5M followers

Cristiano Ronaldo 
@cristiano
114.3M followers

Donald J. Trump 
@realdonaldtrump
111.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
98.6M followers

NASA 
@nasa
92M followers

Justin Bieber 
@justinbieber
91.7M followers

KATY PERRY 
@katyperry
89.9M followers

Taylor Swift 
@taylorswift13
83.9M followers

Lady Gaga 
@ladygaga
75.4M followers

Virat Kohli 
@imvkohli
73.2M followers

Kim Kardashian 
@kimkardashian
70.8M followers

YouTube 
@youtube
68.6M followers

Neymar Jr 
@neymarjr
66.3M followers

Bill Gates 
@billgates
65.1M followers

Selena Gomez 
@selenagomez
63M followers

The Ellen Show
@theellenshow
62.1M followers

CNN 
@cnn
61.6M followers

X 
@x
60.6M followers










