Directory Overview
The source code is organized into logical directories undersrc/:
Directory Purposes
assets/
assets/
Contains static files like images, fonts, and global stylesheets. The styles are organized into:
- base/: Foundation styles including CSS reset, typography, layout, and CSS variables
- utils/: Utility classes and animations for reusable styling patterns
components/
components/
Reusable Vue components that can be used across multiple views:
Favoritos.vue- Favorites button/display componentNumPost.vue- Posts per page selectorPaginacion.vue- Pagination controls (next/previous)VolverPokemons.vue- Back to Pokemon list buttonicons/- SVG icon components
composables/
composables/
Vue Composition API composables for reusable logic:
useGetData.js- HTTP request handling with axios
router/
router/
Vue Router configuration defining all application routes:
index.js- Route definitions and router setup
stores/
stores/
Pinia stores for global state management:
favoritos.js- Manages user’s favorite Pokemon
views/
views/
Page-level components that represent routes:
HomeView.vue- Landing pagePokemonsView.vue- Pokemon list with search and paginationPokeView.vue- Individual Pokemon detailsFavoritosView.vue- User’s favorite PokemonHabilidadView.vue- Pokemon by abilityAboutView.vue- About pageNotFoundView.vue- 404 error page
Entry Point
The application starts insrc/main.js:
src/main.js
- Imports global styles
- Creates the Vue app instance
- Registers Pinia for state management
- Registers Vue Router for navigation
- Mounts the app to the DOM
Component Architecture
Component Hierarchy
The application uses a hierarchical component structure:
- App.vue - Root component with router-view
- Views - Route-level components
- Components - Reusable UI elements
- Composables - Shared logic
- Stores - Global state
Best Practices
- Views handle routing and page layout
- Components are reusable and focused on a single responsibility
- Composables extract and share reactive logic
- Stores manage cross-component state
- Assets are organized by type and purpose
Next Steps
Routing
Learn about route configuration and navigation
State Management
Understand Pinia stores and global state
Composables
Explore reusable composition functions