Step-by-step learning paths, production-grade code examples, and project blueprints for modern JavaScript, React, Next.js, and TypeScript engineers.
- Full-Stack JavaScript Roadmap
- Core JavaScript Reference
- React & Next.js Production Patterns
- TypeScript Essentials
- Hands-On Project Blueprints
- Curated Learning Resources
- Contributing
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
// 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),
};
}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"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;
}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 };
}'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 };
}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;
}
}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>;
}| 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 |
- MDN Web Docs — JavaScript Guide — The definitive reference.
- React Official Documentation — Learn React from the core team.
- Next.js Documentation — App Router, Server Components, and more.
- TypeScript Handbook — Official TypeScript learning path.
- 🌐 Web Foundations: Build a Professional Website from Scratch — HTML, CSS, responsive design fundamentals with digital certificate.
- 🤖 AI + JavaScript Integration: Using ChatGPT for Online Business — API integration patterns for web developers.
- 💡 Creative Problem Solving: Complete Creativity Course — Innovation frameworks applicable to software engineering.
We welcome contributions! To add tutorials, exercises, or improved code patterns:
- Fork this repository.
- Create a feature branch (
git checkout -b feature/add-react-pattern). - Ensure code examples are tested and well-documented.
- Submit a Pull Request with a clear description.
Distributed under CC0-1.0 by Lucebra Global Education (www.lucebra.com)