Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Awesome JavaScript & React Roadmap 2026 ⚛️

Step-by-step learning paths, production-grade code examples, and project blueprints for modern JavaScript, React, Next.js, and TypeScript engineers.

License JavaScript React Platform PRs Welcome


📑 Table of Contents

  1. Full-Stack JavaScript Roadmap
  2. Core JavaScript Reference
  3. React & Next.js Production Patterns
  4. TypeScript Essentials
  5. Hands-On Project Blueprints
  6. Curated Learning Resources
  7. Contributing

1. Full-Stack JavaScript Roadmap

flowchart TD
    subgraph Phase1["Phase 1: JavaScript Foundations"]
        A1["ES6+ Syntax, Closures, Prototypes"] --> A2["Promises, async/await, Event Loop"]
        A2 --> A3["DOM Manipulation & Browser APIs"]
        A3 --> A4["Modules, Bundlers, npm Ecosystem"]
    end

    subgraph Phase2["Phase 2: React & Component Architecture"]
        B1["JSX, Props, State, Hooks"] --> B2["Custom Hooks, Context, useReducer"]
        B2 --> B3["React Server Components & Suspense"]
        B3 --> B4["State Management: Zustand / Redux Toolkit"]
    end

    subgraph Phase3["Phase 3: Next.js & Full-Stack"]
        C1["App Router, SSR, ISR, SSG"] --> C2["API Routes, Server Actions, Middleware"]
        C2 --> C3["Auth: NextAuth.js / Clerk / JWT"]
        C3 --> C4["Database: Prisma ORM, PostgreSQL"]
    end

    subgraph Phase4["Phase 4: Production & DevOps"]
        D1["TypeScript Strict Mode"] --> D2["Testing: Vitest, Playwright, Cypress"]
        D2 --> D3["CI/CD: GitHub Actions, Vercel"]
        D3 --> D4["Monitoring: Sentry, Analytics, Core Web Vitals"]
    end

    Phase1 --> Phase2
    Phase2 --> Phase3
    Phase3 --> Phase4
Loading

2. Core JavaScript Reference

Modern Async Patterns

// Concurrent fetching with error isolation
async function fetchDashboardData(userId) {
  const results = await Promise.allSettled([
    fetch(`/api/user/${userId}/profile`).then(r => r.json()),
    fetch(`/api/user/${userId}/courses`).then(r => r.json()),
    fetch(`/api/user/${userId}/certificates`).then(r => r.json()),
  ]);

  return {
    profile: results[0].status === 'fulfilled' ? results[0].value : null,
    courses: results[1].status === 'fulfilled' ? results[1].value : [],
    certificates: results[2].status === 'fulfilled' ? results[2].value : [],
    errors: results.filter(r => r.status === 'rejected').map(r => r.reason),
  };
}

Functional Composition & Pipelines

const pipe = (...fns) => (x) => fns.reduce((acc, fn) => fn(acc), x);

const sanitize = (str) => str.trim().toLowerCase();
const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
const slugify = (str) => str.replace(/\s+/g, '-').replace(/[^\w-]/g, '');

const toUrlSlug = pipe(sanitize, slugify);
const toDisplayName = pipe(sanitize, capitalize);

console.log(toUrlSlug('  Learn React Hooks  ')); // "learn-react-hooks"
console.log(toDisplayName('  jAVAscript  '));      // "Javascript"

WeakRef & FinalizationRegistry (Advanced Memory)

const cache = new Map();
const registry = new FinalizationRegistry((key) => {
  const ref = cache.get(key);
  if (ref && !ref.deref()) cache.delete(key);
});

function getCachedObject(key, factory) {
  const ref = cache.get(key);
  if (ref) {
    const obj = ref.deref();
    if (obj) return obj;
  }
  const newObj = factory();
  cache.set(key, new WeakRef(newObj));
  registry.register(newObj, key);
  return newObj;
}

3. React & Next.js Production Patterns

Custom Hook: Debounced Search with AbortController

import { useState, useEffect, useRef } from 'react';

export function useDebouncedSearch<T>(
  searchFn: (query: string, signal: AbortSignal) => Promise<T[]>,
  delay: number = 300
) {
  const [query, setQuery] = useState('');
  const [results, setResults] = useState<T[]>([]);
  const [isLoading, setIsLoading] = useState(false);
  const abortRef = useRef<AbortController | null>(null);

  useEffect(() => {
    if (!query.trim()) {
      setResults([]);
      return;
    }

    abortRef.current?.abort();
    const controller = new AbortController();
    abortRef.current = controller;

    const timer = setTimeout(async () => {
      setIsLoading(true);
      try {
        const data = await searchFn(query, controller.signal);
        if (!controller.signal.aborted) setResults(data);
      } catch (err) {
        if (err instanceof DOMException && err.name === 'AbortError') return;
        console.error('Search failed:', err);
      } finally {
        if (!controller.signal.aborted) setIsLoading(false);
      }
    }, delay);

    return () => {
      clearTimeout(timer);
      controller.abort();
    };
  }, [query, delay, searchFn]);

  return { query, setQuery, results, isLoading };
}

Next.js Server Action with Zod Validation

'use server';

import { z } from 'zod';
import { revalidatePath } from 'next/cache';

const enrollmentSchema = z.object({
  courseId: z.string().uuid(),
  userId: z.string().uuid(),
  couponCode: z.string().optional(),
});

export async function enrollInCourse(formData: FormData) {
  const parsed = enrollmentSchema.safeParse({
    courseId: formData.get('courseId'),
    userId: formData.get('userId'),
    couponCode: formData.get('couponCode'),
  });

  if (!parsed.success) {
    return { error: parsed.error.flatten().fieldErrors };
  }

  // Database operation (e.g., Prisma)
  // await prisma.enrollment.create({ data: parsed.data });

  revalidatePath('/dashboard');
  return { success: true };
}

4. TypeScript Essentials

Discriminated Unions for Type-Safe API Responses

type ApiResponse<T> =
  | { status: 'success'; data: T; timestamp: number }
  | { status: 'error'; message: string; code: number }
  | { status: 'loading' };

function handleResponse<T>(response: ApiResponse<T>) {
  switch (response.status) {
    case 'success':
      console.log('Data received:', response.data);
      break;
    case 'error':
      console.error(`Error ${response.code}: ${response.message}`);
      break;
    case 'loading':
      console.log('Loading...');
      break;
  }
}

Generic Repository Pattern

interface Repository<T extends { id: string }> {
  findById(id: string): Promise<T | null>;
  findMany(filter?: Partial<T>): Promise<T[]>;
  create(data: Omit<T, 'id'>): Promise<T>;
  update(id: string, data: Partial<T>): Promise<T>;
  delete(id: string): Promise<boolean>;
}

5. Hands-On Project Blueprints

Level Project Stack Deliverable
Beginner Interactive Quiz App Vanilla JS, Local Storage Multi-step quiz with score persistence
Intermediate Real-Time Chat Application React, Socket.io, Express WebSocket chat with typing indicators
Advanced E-Commerce Storefront Next.js 14, Stripe, Prisma SSR product catalog with checkout & webhooks
Expert AI-Powered Learning Dashboard Next.js, OpenAI API, PostgreSQL Adaptive course recommendations with vector similarity search

6. Curated Learning Resources

Open-Source References

Accredited Courses with Verifiable Certificates


7. Contributing

We welcome contributions! To add tutorials, exercises, or improved code patterns:

  1. Fork this repository.
  2. Create a feature branch (git checkout -b feature/add-react-pattern).
  3. Ensure code examples are tested and well-documented.
  4. Submit a Pull Request with a clear description.

Distributed under CC0-1.0 by Lucebra Global Education (www.lucebra.com)

About

Full-stack JavaScript & React learning path from ES6+ through React Server Components, Next.js App Router, and TypeScript.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors