> ## Documentation Index
> Fetch the complete documentation index at: https://interview.anantapoudel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

A complete, structured guide for mastering Node.js at an intermediate and senior level.\
This documentation is divided into five main pillars, each containing detailed technical topics, best practices, and interview-grade explanations.

***

## 1. JavaScript Foundations & Node.js Internals

This section builds the core understanding required to program effectively in Node.js.

### Core JavaScript Topics

* Scope, closures, hoisting
* Promises and async/await
* Event loop, microtasks, macrotasks
* `this` binding and arrow functions
* Destructuring, rest/spread
* Array and object manipulation
* Higher-order functions
* ES6+ features (modules, classes, generators)
* Error handling in async environments

### Node.js Runtime

* V8 engine internals
* Libuv event loop phases
* Call stack, callback queue, microtask queue
* Thread pool and non-blocking I/O
* Worker Threads API
* Process lifecycle
* Environment variables
* Global objects and timers
* Differences between browser and server JavaScript

### Modules & Packages

* CommonJS (`require`, `module.exports`)
* ES Modules (`import`, `export`)
* Core modules (`fs`, `path`, `os`, `crypto`, `http`)
* npm/yarn package management
* Semantic versioning
* Module resolution and caching
* Writing CLI tools and npm packages

***

## 2. Async Architecture, Streams, Events & Networking

Master Node.js’ asynchronous nature and I/O systems.

### Asynchronous Programming

* Callbacks and callback hell
* Promises and chaining
* Async/await best practices
* `Promise.all`, `Promise.race`, `Promise.any`
* Non-blocking I/O
* Race conditions and synchronization
* Error handling in async workflows

### File System & Streams

* Reading/writing files (sync/async)
* Directories and permissions
* `Readable`, `Writable`, `Duplex`, `Transform` streams
* Piping and backpressure
* Compression (`zlib`)
* Large file handling
* File watchers

### Events & EventEmitter

* Creating and listening to custom events
* Removing listeners
* Error events
* Modular event-based architecture

### HTTP, HTTPS & Networking

* Creating HTTP/HTTPS servers
* Working with URL, query params
* CORS handling
* SSL/TLS configuration
* WebSockets (`ws`, `socket.io`)
* Reverse proxying with Nginx
* Clustering and load balancing

***

## 3. Express.js, API Development & Validation

This section focuses on building production-ready APIs using Express.js.

### Express.js Fundamentals

* Creating apps and routers
* Middleware lifecycle
* Serving static files
* Error handling middleware
* Express 5 improvements
* Environment-based configuration

### Routing & Middleware

* `app.use`, `app.get`, `app.post`, `app.put`, `app.delete`
* Modular routing
* Route prefixes
* Chaining middlewares
* Third-party middleware (`cors`, `helmet`, `morgan`)
* Global vs scoped middleware

### Request Handling & Validation

* Parsing body, params, and query
* Input validation using `express-validator`, `Joi`
* Sanitizing inputs
* File uploads with `multer`
* Multipart form handling
* Rate limiting and throttling

### Authentication & Authorization

* Sessions and cookies
* JWT authentication
* Refresh token strategy
* OAuth2 and OpenID Connect
* Passport.js strategies
* Role-based and policy-based access
* CSRF and CORS security
* Password hashing (`bcrypt`, `argon2`)

***

## 4. Databases, Caching, Queues & Performance

Modern backend systems depend on databases, caching layers, and performance techniques.

### Database Integration

* MongoDB with Mongoose
* PostgreSQL, MySQL using query clients
* SQLite for testing
* Connection pooling
* Transactions and ACID
* Database indexing and query optimization

### ORMs & Query Builders

* Prisma ORM
* Sequelize
* TypeORM
* Knex.js
* Handling relationships
* Lazy vs eager loading
* Migrations and seeding

### Caching & Queues

* In-memory cache
* Redis distributed caching
* TTL strategies
* Rate limiting with Redis
* Queues with BullMQ, RabbitMQ, Kafka
* Background processing
* Pub/Sub architecture

### Performance Optimization

* Cluster mode
* Worker threads
* Streams vs buffering
* Load balancing
* Database connection pooling
* CPU/memory profiling
* PM2 for multi-process management
* Lazy loading modules
* Monitoring GC and event loop delays

***

## 5. Microservices, DevOps, Deployment & System Design

Advanced topics required to build scalable Node.js systems in real-world production environments.

### Microservices & Distributed Systems

* Designing microservices with Express/Fastify
* Communication via HTTP, gRPC, or message queues
* API Gateway pattern
* Event-driven architecture
* Circuit breaker and retry patterns
* Service discovery
* Saga pattern for distributed transactions

### Background Jobs & Scheduling

* Cron jobs (`node-cron`)
* BullMQ delayed, retry, backoff jobs
* Scheduled notifications
* Queue-based processing workflows
* Cleaning stale data

### DevOps & Deployment

* Environment configuration (`dotenv`, `config`)
* Docker and multi-stage builds
* CI/CD pipelines (GitHub Actions, CircleCI)
* Deployments on AWS, GCP, Azure
* PM2/systemd for production
* Reverse proxy with Nginx
* Zero-downtime deployments

### Monitoring & Observability

* Application metrics
* Uptime and health checks
* Logging aggregation (ELK stack, Graylog)
* Distributed tracing (Jaeger, OpenTelemetry)
* Alerts and dashboards (Prometheus, Grafana)
* API analytics and audit logs

### System Design Concepts

* Designing scalable REST APIs
* Stateless and idempotent services
* Real-time architecture via WebSockets
* Caching layers and CDNs
* Database sharding and partitioning
* Multi-tenant architecture
* Fault tolerance and graceful degradation

***

# Start Learning

Choose a topic below to begin your Node.js learning journey.

<Columns cols={2}>
  <Card title="JavaScript & Node.js Internals" href="/node/fundamentals/javascript">
    Learn Node.js internals, runtime architecture, and advanced JavaScript.
  </Card>

  <Card title="Async Architecture & I/O Systems" href="/node/fundamentals/asynchronous">
    Understand streams, events, networking, and the event-driven model.
  </Card>

  <Card title="Express.js, Validation & Authentication" href="/node/express/fundamentals">
    Build production-ready APIs with routing, middleware, and security.
  </Card>

  <Card title="Databases, Caching & Performance" href="/node/database/mongodb">
    Master databases, ORMs, caching, queues, and performance optimization.
  </Card>

  <Card title="Microservices, DevOps & System Design" href="/node/system/architecture">
    Learn microservices, DevOps, deployment, and distributed architecture.
  </Card>
</Columns>
