A Pokedex web application built with Node.js and Express.js, featuring a layered architecture pattern. This project serves as a learning resource for understanding modern web development practices.
- 📋 Paginated list of Pokemon
- 🔍 Search Pokemon by name
- 🏷️ Filter Pokemon by type
- 📄 Detailed Pokemon information pages
- 🌐 RESTful JSON API endpoints
- 🎨 Server-side rendered HTML views with EJS
| Technology | Purpose |
|---|---|
| Node.js | JavaScript runtime |
| Express.js | Web framework |
| EJS | Template engine |
| Axios | HTTP client |
| PokeAPI | Pokemon data source |
| Jest | Testing framework |
This project includes a comprehensive step-by-step guide for building the application:
| Part | Topic | Link |
|---|---|---|
| 00 | Introduction | Read |
| 01 | Project Setup | Read |
| 02 | Understanding Architecture | Read |
| 03 | Configuration | Read |
| 04 | Building the Repository | Read |
| 05 | Building the Service | Read |
| 06 | Building the Controller | Read |
| 07 | Building the Routes | Read |
| 08 | Building the Views | Read |
| 09 | Styling | Read |
| 10 | Testing | Read |
| 11 | Running the App | Read |
- Node.js (version 18 or higher)
- npm (comes with Node.js)
-
Clone the repository
git clone https://github.com/your-username/interns-pokedex.git cd interns-pokedex -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000
| Command | Description |
|---|---|
npm start |
Start the production server |
npm run dev |
Start development server with hot reload |
npm test |
Run tests with coverage |
npm run lint |
Check code for linting errors |
npm run lint:fix |
Fix linting errors automatically |
npm run format |
Format code with Prettier |
npm run format:check |
Check code formatting |
This project follows a layered architecture pattern:
Routes → Controllers → Services → Repositories → External API (PokeAPI)
src/
├── app.js # Application entry point
├── config/ # Configuration files
├── controllers/ # HTTP request handlers
├── repositories/ # Data access layer
├── routes/ # URL routing
├── services/ # Business logic
└── views/ # EJS templates
public/
└── css/ # Stylesheets
Run the test suite:
npm testTests are located in the tests/ directory and cover:
- API endpoints (
api.test.js) - Repository layer (
pokemonRepository.test.js) - Service layer (
pokemonService.test.js)
This project is licensed under the MIT License.
Happy Coding! 🎮