Drive Into NodeJS
Project Directory
-
Models
-
User
- Name
- Password
- Profile
-
Profile
- User
- Title
- Bio
- ProfilePic
- Links
- Post
- Bookmarks
-
Post
- Title
- Body
- Authore,
- Tags
- Thumbnail
- Read Time
- Likes
- Dislikes
- Comments
-
Comment
- Post
- User
- Body
- Replies
- Body
- User
- Time
-
-
Controllers
Authentication Controllers
-
signupGetController
-
signupPostController
-
LoginGetController
-
LoginPostController
-
LogoutController
Dashboard Controller
Upload Controller
-
-
Middleware
-
authMiddleware
-
setLocals
-
middlewares
-
uploadMiddleware
-
-
Routes
-
Authentication Routes
* Get Signup * Post Signup * Get Login * Post Login * Get Logout
-
Dashboard Routes
-
Routes
-
-
Config
- config.js
- default.json
- development.json
- production.json
- custom-evnironment-variables.json
-
Api
- Controlers
- Routes
-
Utils
- validationErrorFormatter
-
Views
- Pages
- auth
-
login.ejs
-
signup.ejs
-
- auth
- Partials
-
header.ejs
-
navigation.ejs
-
footer.ejs
-
- Dashboard
-
dashboard.ejs
-
create-profile.ejs
-
- Pages
-
Validator
- Auth
-
loginValidator.js
-
signupValidator.js
-
- Auth
-
Public
- Images
- scripts
-
profilePicsUpload.js
-
- styles
-
style.css
-
- Uploads
-
Uploads All Images
-
-
node_modules Auto Genereted
Files
- app.js Main file
- package.json Atometed Generated
- README.md For Markdown this project
- .gitingonre Don't Send the github repo using this file
- yarn.lock Auto Generated
Working Process Fronend
- Signup page
- Login page
Working Process Backend
-
mongodb database connected
-
password hashed
-
env
Authentication Validation
-
username
-
email
-
password
-
confirmPassword
Profile Info
-
Create Profile
-
Update Profile
Show Error Message
-
Signup page
-
Login page
-
Set Session Cookie in brawser
-
Set Session on Database
-
Create Flash Message Every Controller
-
Show Alert Message Every page for errors
Upload File
-
create Storage using multer (npm pakage)
-
Upload and Remove Profile Picture
plyground for validation
-
playground function
-
express-validator
-
create error object
Environment
-
Set Development
- export NODE_ENV=DEVELOPMENT
- export NODE_ENV=production
Error
-
Syntax Error
-
Runtime Error
-
Logical Error
Error Page Handle
- 404 page not found
- 500 server Error
app.js inspect mode
-
node inspect app.js
-
Open Browser write urlbar chrome://inspect