Capstone Projects
Apply everything you've learned by building three progressively challenging projects.
Project Overview
| Project | Difficulty | Core Concepts |
|---|---|---|
| Todo Application | Beginner | DOM, Events, localStorage, Classes |
| Real-Time Dashboard | Intermediate | Async/Await, Promises, API Integration |
| Mini Framework | Advanced | Proxy, WeakMap, Generators, Modules |
Project 1: Todo Application
Build a fully-featured todo list with:
- CRUD Operations: Create, read, update, delete todos
- Filtering: View all, active, or completed todos
- Persistence: Save to localStorage
- Responsive UI: Clean, functional interface
Concepts Applied
javascript1// Class-based architecture2class TodoApp {3 constructor(container) {4 this.container = container;5 this.todos = this.loadTodos();6 this.filter = 'all';7 this.render();8 }910 // DOM manipulation11 render() {12 const fragment = document.createDocumentFragment();13 this.getFilteredTodos().forEach(todo => {14 fragment.appendChild(this.createTodoElement(todo));15 });16 this.container.replaceChildren(fragment);17 }1819 // Event delegation20 bindEvents() {21 this.container.addEventListener('click', (e) => {22 if (e.target.matches('.delete-btn')) {23 this.deleteTodo(e.target.closest('[data-id]').dataset.id);24 }25 });26 }2728 // localStorage persistence29 saveTodos() {30 localStorage.setItem('todos', JSON.stringify(this.todos));31 }32}
Learning Goals
- Class-based application architecture
- DOM manipulation and event handling
- State management with persistence
- Clean separation of concerns
Project 2: Real-Time Dashboard
Build a dashboard displaying data from multiple APIs:
- Multi-API Integration: Fetch from multiple endpoints
- Real-Time Updates: Auto-refresh with intervals
- Error Handling: Retry failed requests, show errors gracefully
- Loading States: Visual feedback during fetches
Concepts Applied
javascript1// Async data fetching2class Dashboard {3 async fetchAllData() {4 const results = await Promise.allSettled([5 this.fetchUsers(),6 this.fetchStats(),7 this.fetchNotifications()8 ]);910 return results.map((result, i) => ({11 source: this.dataSources[i],12 status: result.status,13 data: result.value,14 error: result.reason15 }));16 }1718 // Retry logic19 async fetchWithRetry(url, retries = 3) {20 for (let i = 0; i < retries; i++) {21 try {22 const response = await fetch(url);23 if (!response.ok) throw new Error(response.status);24 return await response.json();25 } catch (error) {26 if (i === retries - 1) throw error;27 await this.delay(1000 * (i + 1)); // Exponential backoff28 }29 }30 }3132 // Real-time updates33 startAutoRefresh(interval = 30000) {34 this.refreshInterval = setInterval(() => {35 this.refresh();36 }, interval);37 }38}
Learning Goals
- Promise.all and Promise.allSettled
- Error handling and retry patterns
- Interval-based updates
- Managing loading and error states
Project 3: Mini Framework
Build a reactive mini-framework with:
- Reactive State: Proxy-based state management
- Component System: Reusable component classes
- Data Binding: Auto-update DOM when state changes
- Module Architecture: Clean imports/exports
Concepts Applied
javascript1// Reactive state with Proxy2function reactive(target, onChange) {3 return new Proxy(target, {4 set(obj, prop, value) {5 const oldValue = obj[prop];6 obj[prop] = value;7 onChange(prop, value, oldValue);8 return true;9 }10 });11}1213// Component base class14class Component {15 #state;16 #element;17 #subscriptions = new WeakMap();1819 constructor(element) {20 this.#element = element;21 this.#state = reactive({}, () => this.render());22 }2324 get state() { return this.#state; }2526 setState(updates) {27 Object.assign(this.#state, updates);28 }2930 render() {31 // Override in subclass32 }33}3435// Generator for unique IDs36function* idGenerator(prefix = 'id') {37 let id = 0;38 while (true) {39 yield `${prefix}_${id++}`;40 }41}
Learning Goals
- Proxy for reactivity
- WeakMap for private component data
- Generators for sequences
- Module organization
Common Requirements
All projects should demonstrate:
Code Quality
javascript1// Clear naming2const addTodo = (text) => { /* ... */ };3const toggleComplete = (id) => { /* ... */ };45// Proper error handling6try {7 await saveData(data);8} catch (error) {9 showError('Failed to save');10 console.error(error);11}1213// Type-safe operations14const count = items?.length ?? 0;15const name = user?.profile?.name || 'Anonymous';
Project Structure
1project/2├── index.html3├── main.js # Entry point4├── styles.css # Styles5└── modules/6 ├── app.js # Main application class7 ├── storage.js # localStorage utilities8 └── utils.js # Helper functions
User Experience
- Clear visual feedback for actions
- Loading states during async operations
- Error messages that help users
- Accessible keyboard navigation
Assessment Criteria
Your projects will be evaluated on:
- Functionality - Does it work correctly?
- Code Organization - Is it well-structured?
- ES6+ Features - Are modern features used appropriately?
- Error Handling - Are edge cases handled?
- User Experience - Is it pleasant to use?
Getting Started
Choose a project that matches your current skill level:
- Beginner: Start with the Todo App
- Confident: Try the Dashboard
- Ambitious: Tackle the Mini Framework
Each project builds on skills from the previous one. You can complete them in order or jump to your challenge level.
Good luck! Apply what you've learned and build something great.