Getting Started
This guide will help you get the Pokedex application running on your local machine quickly. Make sure you’ve completed the Installation steps before proceeding.Development Server
Start the Development Server
Run the following command in your project directory:This starts the Vite development server with hot module replacement (HMR) enabled.
Open in Browser
Once the server starts, you’ll see output similar to:Open your browser and navigate to
http://localhost:5173/Vite provides instant Hot Module Replacement (HMR), so any changes you make to the code will be reflected in the browser immediately without a full page reload.
Application Features
Once the application is running, you can explore the following features:Navigation Menu
The application includes a top navigation bar with the following routes:Home
Welcome page with general information
About
Information about the application
Pokemons
Browse all Pokemon with search and pagination
Favoritos
View your saved favorite Pokemon
Pokemon Browser
Navigate to/pokemons to access the main Pokemon browser:
Pokemon Details
Click on any Pokemon card to view detailed information:- About Tab
- Stats Tab
- Moves Tab
- Height and weight measurements
- Abilities (clickable to see other Pokemon with same ability)
- Pokemon number and types
Favorites System
The application uses Pinia for state management to handle favorites:src/stores/favoritos.js
Building for Production
When you’re ready to build the application for production:Preview Production Build
Test the production build locally:This serves the production build on a local server for testing.
The production build is optimized with:
- Code splitting for better performance
- Minified JavaScript and CSS
- Optimized asset loading
- Tree-shaking to remove unused code
Available Scripts
Here are all the npm scripts available in the project:package.json
dev
Starts the Vite development server with HMR
build
Builds the app for production to
dist/ folderpreview
Previews the production build locally
Development Tips
Hot Module Replacement
Vite’s HMR is extremely fast. When you save changes:- Vue components update instantly
- State is preserved when possible
- No full page reload needed
Path Aliases
The project uses@ as an alias for the src/ directory:
Composables Pattern
The application uses composables for shared logic. For example, API calls:src/composables/useGetData.js
Live Demo
View Live Application
Check out the live deployed version of this application on Netlify
Troubleshooting
Development server won't start
Development server won't start
- Check if port 5173 is already in use
- Verify Node.js version is 16.x or higher
- Try deleting
node_modulesand runningnpm installagain
Pokemon images not loading
Pokemon images not loading
- Check your internet connection (images are loaded from PokeAPI)
- The app includes fallback images for failed loads
- Open browser console to check for specific errors
Favorites not persisting
Favorites not persisting
Favorites are stored in memory and will reset when you refresh the page. To persist favorites, you could:
- Add localStorage support to the Pinia store
- Implement a backend API for user accounts
HMR not working
HMR not working
- Ensure you’re using a modern browser
- Check for any console errors
- Try restarting the dev server
- Clear browser cache
Next Steps
Now that you have the application running, explore the codebase to learn more:- Study the router configuration in
src/router/index.js - Examine component composition in the views
- Learn about Pinia stores in
src/stores/favoritos.js - Experiment with adding new features!