Prerequisites
Before you begin, ensure you have the following installed:- Node.js (v16 or higher) - Download here
- npm, yarn, or pnpm - Package manager (npm comes with Node.js)
- Code Editor - VS Code recommended with TypeScript extensions
Getting Started
Clone or Access the Repository
Navigate to the source code directory. The project contains two main learning modules:You should see:
01-reforzamientoTs/- TypeScript fundamentals02-primeros-pasos/- React basics
Each directory is a standalone Vite project with its own dependencies and configuration.
Install Dependencies for TypeScript Fundamentals
Start with the first module to learn TypeScript essentials:This installs:
- TypeScript (^5.5.3)
- Vite (^5.4.1) for fast development
Run the TypeScript Development Server
Start the development server with hot module replacement:Your browser will open at
http://localhost:5173 (or similar). The server will automatically reload when you make changes to the code.Install Dependencies for React Basics
Once comfortable with TypeScript, move to the React module:This installs:
- React (^18.3.1) and React DOM
- TypeScript type definitions
- Vite with React plugin
- ESLint for code quality
- Vitest for testing
Project Structure
Understanding the project organization will help you navigate the learning materials:TypeScript Fundamentals (01-reforzamientoTs/)
Each file in the
bases/ directory demonstrates a specific TypeScript concept. Start from 01-const-let.ts and work your way through sequentially.React Basics (02-primeros-pasos/)
Development Workflow
Working with TypeScript Examples
- Navigate to a file in
01-reforzamientoTs/src/bases/ - Open your browser’s developer console
- Modify the code and save
- Watch the console output update automatically
01-const-let.ts:
Working with React Components
- Edit components in
02-primeros-pasos/src/ - The browser automatically refreshes with your changes
- Use React DevTools to inspect component state
ItemCounter component in shopping-cart/ItemCounter.tsx:
Running Tests
The React project includes Vitest for testing:Additional Build Commands
TypeScript Project
React Project
Troubleshooting
Port Already in Use
If you get a port conflict error, Vite will automatically suggest an alternative port. You can also specify a custom port:TypeScript Errors
If you see TypeScript errors, ensure yourtsconfig.json is properly configured. Both projects include working configurations.
Module Not Found
Make sure you’ve runnpm install in the correct directory. Each project has its own node_modules folder.
Next Steps
Now that your environment is set up, you’re ready to start learning! We recommend:- Start with the TypeScript fundamentals in
01-reforzamientoTs - Work through the files in
src/bases/sequentially - Experiment with the code and console output
- Move to
02-primeros-pasosto learn React - Study the
ItemCountercomponent to understand hooks - Modify the shopping cart example to add your own features
Take your time with each concept. The hands-on examples are designed to build upon each other progressively.