Frontend with React & Next.js
From HTML basics to shipped Next.js apps.
Build a solid base in HTML, CSS and JavaScript, add TypeScript, then learn React and the Next.js App Router to build fast, accessible apps. Finish by testing with Vitest and Playwright and deploying to production.
01HTML & CSS foundations
The structure and styling every framework compiles down to.
- Semantic HTML, forms & document structureSemantic HTML uses elements that describe meaning, like nav, main and button, instead of generic divs. Browsers, search engines and screen readers rely on that meaning to understand and navigate your page.10 min
- Selectors, cascade, box model & unitsCSS applies styles through selectors, and the cascade decides which rule wins when several match. The box model defines how content, padding, border and margin add up to an element's size.9 min
- Flexbox & Grid layoutFlexbox lays items out along one axis, which suits nav bars and toolbars. Grid controls rows and columns together, which suits card grids and page layouts. Most real layouts combine both.9 min
- Responsive design & media queriesResponsive design makes one layout adapt from phones to desktops. A mobile-first approach writes base styles for small screens, then adds min-width media queries for larger ones.9 min
- Accessibility fundamentalsAccessibility means people using keyboards, screen readers or low vision can use your site. Most problems are found with a keyboard test, a contrast check and an automated audit, then fixed in the markup.9 min
02Modern JavaScript
The language of the browser, without the old quirks.
- Values, functions, objects & arraysModern JavaScript uses const and let, arrow functions, destructuring and array methods. These features make data transformations short and predictable, and they appear everywhere in React code.9 min
- DOM & eventsThe DOM is the browser's tree of objects representing the page. JavaScript selects elements, changes them and listens for events like clicks to make pages interactive.8 min
- Promises, async/await & fetchNetwork requests take time, so JavaScript handles them asynchronously with promises. async/await makes that code read top to bottom, and fetch is the built-in way to call APIs.8 min
- ES modules, npm & toolingES modules split code into files that import and export values. npm installs third-party packages, and a dev server like Vite serves your modules with instant reloads.8 min
03TypeScript
Catch bugs before the browser does.
- Types, interfaces & type inferenceTypeScript adds types to JavaScript and checks them before your code runs. It catches typos, missing fields and wrong arguments in the editor, then compiles to plain JavaScript.11 min
- Unions, narrowing & genericsUnion types say a value can be one of several types, and narrowing lets TypeScript know which one you have. Generics let one function or type work with many types while staying type safe.11 min
- tsconfig & strict modetsconfig.json controls how TypeScript checks and compiles your project. Turning on strict mode enables the checks that catch the most real bugs, especially around null and undefined.10 min
04React
Think in components and state.
- Components, JSX & propsReact apps are built from components: functions that take props and return JSX describing UI. Small components compose into a tree, which makes UIs easier to reuse and reason about.11 min
- State, events & conditional renderingState is data a component remembers between renders, created with useState. Calling the setter schedules a re-render with the new value, and React updates only what changed on screen.11 min
- Lists, keys & formsLists are rendered by mapping arrays to JSX, and each item needs a stable key so React can track it. Controlled forms keep input values in state, which makes validation and submission straightforward.11 min
- Effects & refs (and when not to use them)useEffect runs code after React commits to the screen, to sync with systems outside React like timers, subscriptions or browser APIs. Many effects are unnecessary and can be replaced by computing values during render or handling events directly.11 min
- Context, reducers & shared stateContext passes a value deep into the component tree without threading props through every level. useReducer centralises complex state changes in one pure function, and the two combine well for app-wide state.11 min
- Custom hooks & compositionA custom hook is a function starting with use that calls other hooks to package reusable logic. Components share the logic, but each call gets its own independent state.10 min
- Rendering & performance basicsA component re-renders when its state changes, its parent re-renders, or a context it uses changes. Most re-renders are cheap; measure with the React Profiler before reaching for memo, useMemo or useCallback.11 min
05Next.js App Router
Full-stack React with routing, rendering and data built in.
- File-based routing, layouts & navigationIn the Next.js App Router, folders inside app define URL segments and page.tsx makes a segment visitable. layout.tsx wraps child routes and persists across navigation, while loading.tsx and error.tsx handle waiting and failure.10 min
- Server vs client componentsIn the App Router, components are server components by default: they render on the server and send no JavaScript for themselves. Add 'use client' only for parts that need state, effects or browser APIs.11 min
- Data fetching, caching & revalidationServer components can fetch data directly with async/await. Next.js then renders routes statically at build time, dynamically per request, or statically with periodic or on-demand revalidation.11 min
- Server actions & formsServer actions are async functions marked 'use server' that run on the server but can be called from forms and client code. They handle mutations without writing a separate API endpoint.10 min
- Route handlers & middlewareRoute handlers are route.ts files that export functions like GET and POST to build HTTP endpoints. Middleware runs before matching routes and can redirect or block requests, for example when a user is not signed in.10 min
- Metadata, images & fontsNext.js has built-in tools for page metadata, images and fonts. They improve SEO and sharing previews, and they prevent slow loads and layout shifts with little effort.10 min
- Auth & a databaseMost apps need users to sign in and data saved per user. An auth library handles sign-in and sessions, a hosted database stores data, and every page and action checks who the user is.10 min
06Styling at scale
Consistent UI without a pile of one-off CSS.
- Tailwind CSSTailwind CSS styles elements with small utility classes like p-4 and text-lg written directly in markup. It generates only the CSS you use, from a shared theme of colors, spacing and breakpoints.10 min
- Component libraries & design tokensA design system is a shared set of tokens and components that keeps UI consistent. Tokens define values like colors and spacing; primitives like Button and Input use them and handle accessibility once.10 min
- Theming & dark modeTheming stores colors in CSS variables and swaps their values per theme. Respect the user's system preference by default, and let them override it with a toggle that is remembered.10 min
07Testing
Ship changes without clicking through every page.
- Unit tests with VitestUnit tests check small pieces of logic, like utilities and hooks, in isolation. Vitest runs them fast with a Jest-compatible API and re-runs affected tests as you save.10 min
- Component tests with Testing LibraryTesting Library renders components and lets tests interact with them like a user would: finding elements by role and label, typing and clicking. Tests that avoid internals survive refactors.10 min
- End-to-end tests with PlaywrightEnd-to-end tests drive a real browser through your running app, covering full user flows like signing in and checking out. Playwright auto-waits for elements and runs in CI on every push.10 min
08Performance & deployment
Fast for users, boring to release.
- Core Web Vitals & LighthouseCore Web Vitals are three user-centred metrics: loading speed, responsiveness and visual stability. Lighthouse and real-user data show which one is weakest so you fix the biggest problem first.12 min
- Deploying with CI & preview environmentsContinuous deployment builds and ships your app on every push. Each pull request gets a preview URL and automated checks, and merging to main deploys to production.11 min
09Capstone project
A real app you can link on your resume.
- Design the app: pages, data model & component treePlanning before coding saves rework. Sketch each page, list the routes, define a typed data model and plan the component tree so the build follows a clear map.11 min
- Build a full Next.js app (e.g. habit tracker or recipe manager)The capstone combines everything into one deployed app: typed pages, auth, a database, server actions, tests and good performance. Build in thin vertical slices so something works end to end early.12 min