# mrunmay07/mca-3rd-sem architecture

> Architecture diagram of the GitHub repository mrunmay07/mca-3rd-sem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mrunmay07/mca-3rd-sem
- Repository: https://github.com/mrunmay07/mca-3rd-sem

## Overview

This repository is a collection of independent Node.js, Express, database, and cryptography exercises, not one integrated application. Its clearest end-to-end product workflow is the Express blog app: users register or log in (including optional OTP login), authenticated requests create and manage blogs, and routes read or update MongoDB-backed records. Other exercises demonstrate standalone server, middleware, database, and security topics. Relationships below are limited to those visible in the sampled source or SOURCE INDEX; several standalone examples have no evidenced internal connections.

Main entry points: [`Express/blogs app/routes/userRoutes.js`](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/routes/userRoutes.js) (User routes), [`Express/blogs app/app.js`](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/app.js) (Blog server), [`Express/blogs app/routes/blogRoutes.js`](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/routes/blogRoutes.js) (Blog routes), [`Express/blogs app/middleware/authMiddleware.js`](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/middleware/authMiddleware.js) (Session auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_blog["Blog application"]
  node_blog_server["Blog server<br/>[app.js]"]
  node_user_routes["User routes<br/>[userRoutes.js]"]
  node_user_controller["User controller<br/>[userController.js]"]
  node_auth["Session auth<br/>[authMiddleware.js]"]
  node_blog_routes["Blog routes<br/>[blogRoutes.js]"]
  node_user_model["User model<br/>[User.js]"]
  node_session_model["Session model<br/>[Session.js]"]
  node_otp_model["OTP model<br/>[OTP.js]"]
  node_blog_model["Blog model<br/>[Blog.js]"]
  node_db_connect["DB connection<br/>[db.js]"]
end

subgraph group_node["Node.js examples"]
  node_commonjs_app["CommonJS demo<br/>[app.js]"]
  node_commonjs_math["Math exports<br/>[math.js]"]
  node_http_demo["HTTP server demo<br/>[app.js]"]
  node_module_demo["Module-system demo<br/>[app.js]"]
  node_sub_module["Sub module<br/>[sub.js]"]
end

subgraph group_express["Express examples"]
  node_express_basics["Express basics<br/>[app.js]"]
  node_cors_demo["CORS demo<br/>[app.js]"]
  node_preflight_demo["Preflight demo<br/>[app.js]"]
  node_cookies_demo["Cookie demo<br/>[app.js]"]
  node_middleware_demo["Middleware demo<br/>[app.js]"]
  node_static_demo["Static files demo<br/>[app.js]"]
  node_multer_demo["Multer demo<br/>[app.js]"]
  node_multer_revised["Multer revision<br/>[app.js]"]
end

subgraph group_data["Data and security"]
  node_hash_demo["Hashing demo<br/>[app.js]"]
  node_bcrypt_demo["Bcrypt demo<br/>[app.js]"]
  node_pg_sample["PostgreSQL sample"]
  node_mongo_basics["Mongo basics<br/>[app.js]"]
  node_mongo_cursors["Mongo cursors<br/>[app.js]"]
  node_mongo_validation["Schema validation<br/>[app.js]"]
  node_mongoose_demo["Mongoose demo<br/>[app.js]"]
end

node_client(("API client"))
node_mongo[("MongoDB")]
node_smtp["SMTP mail"]
node_cloudinary["Cloudinary"]

node_client -->|"sends requests"| node_blog_server
node_blog_server -->|"mounts routes"| node_user_routes
node_blog_server -->|"mounts routes"| node_blog_routes
node_blog_server -->|"connects database"| node_db_connect
node_db_connect -->|"connects"| node_mongo
node_user_routes -->|"dispatches auth"| node_user_controller
node_user_routes -->|"guards logout"| node_auth
node_user_routes -->|"stores OTP"| node_otp_model
node_user_routes -->|"creates sessions"| node_session_model
node_user_routes -->|"looks up users"| node_user_model
node_user_routes -->|"sends OTP mail"| node_smtp
node_user_controller -->|"manages sessions"| node_session_model
node_user_controller -->|"looks up users"| node_user_model
node_auth -->|"checks session"| node_session_model
node_auth -->|"loads user"| node_user_model
node_blog_routes -->|"guards mutations"| node_auth
node_blog_routes -->|"queries blogs"| node_blog_model
node_blog_routes -->|"uploads images"| node_cloudinary
node_commonjs_app -->|"imports functions"| node_commonjs_math
node_module_demo -->|"imports module"| node_sub_module

click node_blog_server "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/app.js"
click node_user_routes "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/routes/userRoutes.js"
click node_user_controller "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/controllers/userController.js"
click node_auth "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/middleware/authMiddleware.js"
click node_blog_routes "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/routes/blogRoutes.js"
click node_user_model "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/models/User.js"
click node_session_model "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/models/Session.js"
click node_otp_model "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/models/OTP.js"
click node_blog_model "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/models/Blog.js"
click node_db_connect "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/db/db.js"
click node_commonjs_app "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Node.js/CommonJS/app.js"
click node_commonjs_math "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Node.js/CommonJS/math.js"
click node_http_demo "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Node.js/http%20module/app.js"
click node_module_demo "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Node.js/module%20system/app.js"
click node_sub_module "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Node.js/module%20system/sub.js"
click node_express_basics "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/Basics/app.js"
click node_cors_demo "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/CORS/app.js"
click node_preflight_demo "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/CORS%20and%20preflght%20request/app.js"
click node_cookies_demo "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/cookies/app.js"
click node_middleware_demo "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/middlewares/app.js"
click node_static_demo "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/serving%20static%20files%20using%20express/app.js"
click node_multer_demo "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/multer/app.js"
click node_multer_revised "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/multer%20revise/app.js"
click node_hash_demo "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Cryptography/01_hashing/app.js"
click node_bcrypt_demo "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Cryptography/02_brcypt/app.js"
click node_pg_sample "https://github.com/mrunmay07/mca-3rd-sem/blob/main/Database%20Design%20using%20PostgreSQL/00_sample%20data/constant_running_query_sample.php"
click node_mongo_basics "https://github.com/mrunmay07/mca-3rd-sem/blob/main/mongodb/01_basics/app.js"
click node_mongo_cursors "https://github.com/mrunmay07/mca-3rd-sem/blob/main/mongodb/02_cursors/app.js"
click node_mongo_validation "https://github.com/mrunmay07/mca-3rd-sem/blob/main/mongodb/03_Schema_validation/app.js"
click node_mongoose_demo "https://github.com/mrunmay07/mca-3rd-sem/blob/main/mongodb/04_mongoose/app.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_blog_server,node_user_routes,node_user_controller,node_auth,node_blog_routes,node_user_model,node_session_model,node_otp_model,node_blog_model,node_db_connect,node_client toneBlue
class node_commonjs_app,node_commonjs_math,node_http_demo,node_module_demo,node_sub_module,node_mongo toneAmber
class node_express_basics,node_cors_demo,node_preflight_demo,node_cookies_demo,node_middleware_demo,node_static_demo,node_multer_demo,node_multer_revised toneMint
class node_hash_demo,node_bcrypt_demo,node_pg_sample,node_mongo_basics,node_mongo_cursors,node_mongo_validation,node_mongoose_demo toneRose
class node_smtp,node_cloudinary toneIndigo
```

## Components

### Blog application

- [Blog server](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/app.js): `Express/blogs app/app.js`
- [User routes](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/routes/userRoutes.js): `Express/blogs app/routes/userRoutes.js`
- [User controller](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/controllers/userController.js): `Express/blogs app/controllers/userController.js`
- [Session auth](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/middleware/authMiddleware.js): `Express/blogs app/middleware/authMiddleware.js`
- [Blog routes](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/routes/blogRoutes.js): `Express/blogs app/routes/blogRoutes.js`
- [User model](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/models/User.js): `Express/blogs app/models/User.js`
- [Session model](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/models/Session.js): `Express/blogs app/models/Session.js`
- [OTP model](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/models/OTP.js): `Express/blogs app/models/OTP.js`
- [Blog model](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/models/Blog.js): `Express/blogs app/models/Blog.js`
- [DB connection](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/blogs%20app/db/db.js): `Express/blogs app/db/db.js`

### Node.js examples

- [CommonJS demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Node.js/CommonJS/app.js): `Node.js/CommonJS/app.js`
- [Math exports](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Node.js/CommonJS/math.js): `Node.js/CommonJS/math.js`
- [HTTP server demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Node.js/http%20module/app.js): `Node.js/http module/app.js`
- [Module-system demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Node.js/module%20system/app.js): `Node.js/module system/app.js`
- [Sub module](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Node.js/module%20system/sub.js): `Node.js/module system/sub.js`

### Express examples

- [Express basics](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/Basics/app.js): `Express/Basics/app.js`
- [CORS demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/CORS/app.js): `Express/CORS/app.js`
- [Preflight demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/CORS%20and%20preflght%20request/app.js): `Express/CORS and preflght request/app.js`
- [Cookie demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/cookies/app.js): `Express/cookies/app.js`
- [Middleware demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/middlewares/app.js): `Express/middlewares/app.js`
- [Static files demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/serving%20static%20files%20using%20express/app.js): `Express/serving static files using express/app.js`
- [Multer demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/multer/app.js): `Express/multer/app.js`
- [Multer revision](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Express/multer%20revise/app.js): `Express/multer revise/app.js`

### Data and security

- [Hashing demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Cryptography/01_hashing/app.js): `Cryptography/01_hashing/app.js`
- [Bcrypt demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Cryptography/02_brcypt/app.js): `Cryptography/02_brcypt/app.js`
- [PostgreSQL sample](https://github.com/mrunmay07/mca-3rd-sem/blob/main/Database%20Design%20using%20PostgreSQL/00_sample%20data/constant_running_query_sample.php): `Database Design using PostgreSQL/00_sample data/constant_running_query_sample.php`
- [Mongo basics](https://github.com/mrunmay07/mca-3rd-sem/blob/main/mongodb/01_basics/app.js): `mongodb/01_basics/app.js`
- [Mongo cursors](https://github.com/mrunmay07/mca-3rd-sem/blob/main/mongodb/02_cursors/app.js): `mongodb/02_cursors/app.js`
- [Schema validation](https://github.com/mrunmay07/mca-3rd-sem/blob/main/mongodb/03_Schema_validation/app.js): `mongodb/03_Schema_validation/app.js`
- [Mongoose demo](https://github.com/mrunmay07/mca-3rd-sem/blob/main/mongodb/04_mongoose/app.js): `mongodb/04_mongoose/app.js`

### Other components

- **API client**
- **MongoDB**
- **SMTP mail**
- **Cloudinary**

## Connections

- API client → Blog server: sends requests (evidence: `Express/blogs app/app.js`)
- Blog server → User routes: mounts routes (evidence: `Express/blogs app/app.js`)
- Blog server → Blog routes: mounts routes (evidence: `Express/blogs app/app.js`)
- Blog server → DB connection: connects database (evidence: `Express/blogs app/app.js`)
- DB connection → MongoDB: connects (evidence: `Express/blogs app/db/db.js`)
- User routes → User controller: dispatches auth (evidence: `Express/blogs app/routes/userRoutes.js`)
- User routes → Session auth: guards logout (evidence: `Express/blogs app/routes/userRoutes.js`)
- User routes → OTP model: stores OTP (evidence: `Express/blogs app/routes/userRoutes.js`)
- User routes → Session model: creates sessions (evidence: `Express/blogs app/routes/userRoutes.js`)
- User routes → User model: looks up users (evidence: `Express/blogs app/routes/userRoutes.js`)
- User routes → SMTP mail: sends OTP mail (evidence: `Express/blogs app/routes/userRoutes.js`)
- User controller → Session model: manages sessions (evidence: `Express/blogs app/controllers/userController.js`)
- User controller → User model: looks up users (evidence: `Express/blogs app/controllers/userController.js`)
- Session auth → Session model: checks session (evidence: `Express/blogs app/middleware/authMiddleware.js`)
- Session auth → User model: loads user (evidence: `Express/blogs app/middleware/authMiddleware.js`)
- Blog routes → Session auth: guards mutations (evidence: `Express/blogs app/routes/blogRoutes.js`)
- Blog routes → Blog model: queries blogs (evidence: `Express/blogs app/routes/blogRoutes.js`)
- Blog routes → Cloudinary: uploads images (evidence: `Express/blogs app/routes/blogRoutes.js`)
- CommonJS demo → Math exports: imports functions (evidence: `Node.js/CommonJS/app.js`)
- Module-system demo → Sub module: imports module (evidence: `Node.js/module system/app.js`)
