PokemonGame

๐Ÿ” PokรฉSearch - Advanced Pokรฉmon Database System

![PokรฉSearch Banner](/PokemonGame/docs/images/banner.png) **A full-stack web application for exploring comprehensive Pokรฉmon data with Oracle 11g backend and modern JavaScript frontend** [![Oracle](https://img.shields.io/badge/Oracle-11g_XE-F80000?style=for-the-badge&logo=oracle&logoColor=white)](https://www.oracle.com/database/technologies/xe-prior-releases.html) [![Python](https://img.shields.io/badge/Python-3.8+-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/) [![Flask](https://img.shields.io/badge/Flask-3.1.2-000000?style=for-the-badge&logo=flask&logoColor=white)](https://flask.palletsprojects.com/) [![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?style=for-the-badge&logo=docker&logoColor=white)](https://www.docker.com/) [![JavaScript](https://img.shields.io/badge/JavaScript-ES6+-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)](https://developer.mozilla.org/en-US/docs/Web/JavaScript) [Features](#-features) โ€ข [Screenshots](#-screenshots) โ€ข [Quick Start](#-quick-start) โ€ข [Tech Stack](#-technology-stack) โ€ข [Documentation](#-documentation)

๐Ÿ“‹ Table of Contents


๐ŸŒŸ Overview

PokรฉSearch is a comprehensive web-based Pokรฉmon information system that provides an intuitive interface for searching, filtering, and exploring detailed information about all Pokรฉmon. Built with Oracle 11g database, Flask REST API, and vanilla JavaScript, this application demonstrates full-stack development with enterprise-grade database management.

Key Highlights

โœ… Complete Pokรฉmon Data - All 8 generations with 1000+ Pokรฉmon
โœ… Advanced Filtering - 15+ filter options including name patterns, stats ranges, abilities
โœ… Interactive Evolution Trees - Visual representation with evolution requirements
โœ… Type Effectiveness - Complete offensive/defensive matchup calculations
โœ… Responsive Design - Works flawlessly on desktop, tablet, and mobile devices
โœ… Docker Ready - One-command deployment with docker-compose
โœ… API Fallback - Automatic switching between localhost and ngrok endpoints
โœ… Real-time Search - Instant results as you type with no page reload


โšก Features

๐Ÿ”Ž Advanced Search & Filtering

Search Interface

Basic Filters:

Advanced Name Filters:

Advanced Filters:

๐Ÿ“Š Sorting Options (Ascending/Descending)

๐Ÿ“ฑ Pokรฉmon Details Page

Details Page

๐ŸŽจ Type Explorer

Type Page

๐Ÿ’ช Ability Browser

Abilities Page


๐Ÿ“ธ Screenshots

### Main Search Interface (Desktop) ![Search Interface](/PokemonGame/docs/images/search-interface1.png) *Advanced filtering with real-time results* ### Search Results Grid ![Search Results](/PokemonGame/docs/images/search-interface2.png) *Pokรฉmon displayed in responsive card layout*
### Pokรฉmon Details View ![Details](/PokemonGame/docs/images/details-page1.png) *Complete information with stats and abilities* ### Evolution Chain Display ![Evolution](/PokemonGame/docs/images/screenshot-evolution.png) *Interactive evolution tree with requirements*
### Type Effectiveness Page ![Types](/PokemonGame/docs/images/type-page1.png) *Visual type matchups for Normal type* ### Type Pokรฉmon Listing ![Type List](/PokemonGame/docs/images/type-page2.png) *All Normal-type Pokรฉmon displayed*
### Abilities Overview ![Abilities](/PokemonGame/docs/images/abilities-page1.png) *Searchable ability database with descriptions* ### Ability Details ![Ability Detail](/PokemonGame/docs/images/details-page2.png) *Detailed stats and information sections*

Mobile Responsive Design

![Mobile Search](/PokemonGame/docs/images/screenshot-mobile.jpeg) *Mobile search interface* ![Mobile Results](/PokemonGame/docs/images/screenshot-mobile1.jpeg) *Mobile Pokรฉmon cards* ![Mobile Menu](/PokemonGame/docs/images/screenshot-mobile2.jpeg) *Mobile navigation menu*

Fully responsive design optimized for mobile devices


๐Ÿš€ Quick Start

# 1. Clone repository
git clone https://github.com/hamza05-dot/PokemonGame.git
cd PokemonGame
# 2. Start all services
docker-compose up -d --build

# 3. Import database
./import_data.bat  # Windows
./import_data.sh   # Linux/Mac

# 4. Access application
# Open browser: http://localhost

Option 2: Local Development

# 1. Setup Oracle Database
sqlplus sys/password@xe as sysdba
CREATE USER pokedb IDENTIFIED BY 5687;
GRANT CONNECT, RESOURCE, DBA TO pokedb;
EXIT;

# 2. Import schema
sqlplus pokedb/5687@xe
@sql/pokedb.sql
EXIT;

# 3. Start backend
cd backend
pip install -r requirements.txt
python app.py

# 4. Start frontend
cd frontend
python -m http.server 8000

Access: http://localhost:8000


๐Ÿ›  Technology Stack

Backend Technologies

Technology Version Purpose
Python 3.8+ Backend programming language
Flask 3.1.2 Web framework & REST API server
Flask-CORS 6.0.2 Cross-origin resource sharing
python-oracledb 3.4.2 Oracle database driver (thick mode)
Oracle Database 11g XE Enterprise relational database
python-dotenv 1.0.1 Environment variable management

Frontend Technologies

Technology Version Purpose
HTML5 - Semantic structure
CSS3 - Styling with animations
JavaScript ES6+ Client-side logic and interactivity
Fetch API - Asynchronous HTTP requests

DevOps & Deployment

Technology Version Purpose
Docker Latest Container platform
Docker Compose v3.8 Multi-container orchestration
Nginx Alpine Web server & reverse proxy
Ngrok Latest Secure tunneling service

Development Tools


๐Ÿ“ Project Structure

pokemon-search/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ docs/                          # Documentation
โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ images/                    # Screenshots & diagrams
โ”‚       โ”œโ”€โ”€ banner.png
โ”‚       โ”œโ”€โ”€ database-schema.png       # ER diagram
โ”‚       โ”œโ”€โ”€ search-interface*.png     # Search UI screenshots
โ”‚       โ”œโ”€โ”€ details-page*.png         # Details page screenshots
โ”‚       โ”œโ”€โ”€ type-page*.png            # Type page screenshots
โ”‚       โ”œโ”€โ”€ abilities-page*.png       # Abilities page screenshots
โ”‚       โ”œโ”€โ”€ screenshot-*.png/jpeg     # Mobile & other screenshots
โ”‚       โ””โ”€โ”€ screenshot-evolution.png  # Evolution tree
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ backend/                       # Flask API Server
โ”‚   โ”œโ”€โ”€ app.py                        # Main application
โ”‚   โ”œโ”€โ”€ requirements.txt              # Dependencies
โ”‚   โ””โ”€โ”€ Dockerfile                    # Container config
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ frontend/                      # Web Interface
โ”‚   โ”œโ”€โ”€ *.html                        # HTML pages
โ”‚   โ”œโ”€โ”€ *.css                         # Stylesheets
โ”‚   โ”œโ”€โ”€ *.js                          # JavaScript
โ”‚   โ”œโ”€โ”€ nginx.conf                    # Web server config
โ”‚   โ””โ”€โ”€ Dockerfile                    # Container config
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ sql/                           # Database Scripts
โ”‚   โ””โ”€โ”€ pokedb.sql                    # Schema & data
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ database/                      # Backups
โ”‚   โ””โ”€โ”€ pokemon_backup.dmp            # Oracle export
โ”‚
โ”œโ”€โ”€ docker-compose.yml                # Orchestration
โ”œโ”€โ”€ .env                              # Environment variables
โ”œโ”€โ”€ .gitignore                        # Git ignore rules
โ”œโ”€โ”€ .dockerignore                     # Docker ignore rules
โ”œโ”€โ”€ import_data.bat                   # Data import (Windows)
โ”œโ”€โ”€ README.md                         # This file
โ””โ”€โ”€ LICENSE                           # MIT License

For detailed structure: See PROJECT_STRUCTURE.md


๐Ÿ—„ Database Architecture

Database Schema

Tables (8 Total)

Table Records Purpose
POKEMON 1000+ Core Pokรฉmon data (stats, generation, legendary)
TYPES 18 Type definitions (Fire, Water, Grass, etc.)
POKEMON_TYPES 1500+ Maps Pokรฉmon to their types (supports dual-types)
ABILITIES 300+ Ability definitions and descriptions
POKEMON_ABILITIES 2000+ Maps Pokรฉmon to their abilities
POKEMON_EVOLUTIONS 500+ Evolution chains with requirements
EVOLUTION_REQUIREMENTS 200+ Evolution methods (level, stone, trade, etc.)
TYPE_EFFECTIVENESS 324 Type matchup multipliers (18ร—18 matrix)

Key Features

โœ… Normalized Design - 3NF compliance with minimal redundancy
โœ… Primary Keys - All tables use ID as primary key
โœ… Foreign Keys - Referential integrity enforced
โœ… Junction Tables - Many-to-many relationships (types, abilities)
โœ… Recursive Relationships - Evolution chains support branching
โœ… Indexing - Optimized queries on name, type, generation
โœ… Constraints - Data validation with check constraints
โœ… VARCHAR2 - Unicode support for international names

Entity Relationships

POKEMON (1) โ”€โ”€โ”€โ”€โ”€โ”€< (M) POKEMON_TYPES (M) >โ”€โ”€โ”€โ”€โ”€โ”€ (1) TYPES
   โ”‚
   โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€< (M) POKEMON_ABILITIES (M) >โ”€โ”€โ”€โ”€โ”€โ”€โ”€ (1) ABILITIES
   โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€< (M) POKEMON_EVOLUTIONS
                       โ”‚
                       โ””โ”€โ”€โ”€โ”€โ”€โ”€> (1) EVOLUTION_REQUIREMENTS

TYPES (1) โ”€โ”€โ”€โ”€โ”€โ”€< (M) TYPE_EFFECTIVENESS (M) >โ”€โ”€โ”€โ”€ (1) TYPES
(Attack)                                         (Defense)

Sample Queries

Find all Electric-type Pokรฉmon:

SELECT p.* 
FROM POKEMON p
JOIN POKEMON_TYPES pt ON p.id = pt.pokemon_id
JOIN TYPES t ON pt.type_id = t.id
WHERE t.name = 'Electric';

Get evolution chain for Pikachu (ID 25):

WITH RECURSIVE evo_chain AS (
  SELECT * FROM POKEMON_EVOLUTIONS WHERE from_pokemon_id = 25
  UNION ALL
  SELECT e.* FROM POKEMON_EVOLUTIONS e
  JOIN evo_chain ec ON e.from_pokemon_id = ec.to_pokemon_id
)
SELECT * FROM evo_chain;

Type effectiveness for Fire attacks:

SELECT t.name AS defending_type, te.multiplier
FROM TYPE_EFFECTIVENESS te
JOIN TYPES t ON te.defense_type_id = t.id
WHERE te.attack_type_id = (SELECT id FROM TYPES WHERE name = 'Fire')
ORDER BY te.multiplier DESC;

๐Ÿ’ป Installation Methods

Prerequisites:

Steps:

  1. Clone Repository
    git clone https://github.com/yourusername/pokemon-search.git
    cd pokemon-search
    
  2. Configure Environment
    # Create .env file
    cp .env.example .env
       
    # Edit .env (optional)
    ORACLE_PASSWORD=your_password
    FLASK_PORT=5000
    NGINX_PORT=80
    
  3. Start Services
    docker-compose up -d
    
  4. Import Database
    # Windows
    .\import_data.bat
       
    # Linux/Mac
    chmod +x import_data.sh
    ./import_data.sh
    
  5. Verify Installation
    # Check all containers running
    docker-compose ps
       
    # View logs
    docker-compose logs -f
    
  6. Access Application
    • Frontend: http://localhost
    • API: http://localhost:5000/api

Docker Architecture:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Nginx     โ”‚โ”€โ”€โ”€โ”€โ”€>โ”‚   Flask     โ”‚โ”€โ”€โ”€โ”€โ”€>โ”‚   Oracle    โ”‚
โ”‚  (Port 80)  โ”‚      โ”‚  (Port 5000)โ”‚      โ”‚  (Port 1521)โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
   Frontend            REST API            Database

Useful Commands:

# Stop all services
docker-compose down

# Rebuild after code changes
docker-compose up -d --build

# View logs for specific service
docker-compose logs -f flask-api

# Execute SQL in Oracle container
docker exec -it oracle-db sqlplus pokedb/5687@xe

# Backup database
docker exec oracle-db exp pokedb/5687 file=backup.dmp full=y

Method 2: Local Development

Prerequisites:

Backend Setup:

  1. Install Oracle Database
    • Download Oracle 11g XE from Oracle website
    • Install with default settings
    • Note the SID (usually XE)
  2. Create Database User
    sqlplus sys/password@xe as sysdba
       
    CREATE USER pokedb IDENTIFIED BY 5687;
    GRANT CONNECT, RESOURCE, DBA TO pokedb;
    GRANT CREATE SESSION TO pokedb;
    GRANT UNLIMITED TABLESPACE TO pokedb;
    EXIT;
    
  3. Import Schema & Data
    sqlplus pokedb/5687@xe @sql/pokedb.sql
    
  4. Install Python Dependencies
    cd backend
    pip install -r requirements.txt
    
  5. Configure Oracle Client
    # In app.py, update:
    oracledb.init_oracle_client(
        lib_dir=r"C:\oracle\instantclient_21_3"  # Windows
        # lib_dir="/usr/lib/oracle/21/client64/lib"  # Linux
    )
    
  6. Start Flask Server
    python app.py
    # Server runs on http://localhost:5000
    

Frontend Setup:

  1. Navigate to Frontend
    cd frontend
    
  2. Start HTTP Server
    # Python 3
    python -m http.server 8000
       
    # Python 2
    python -m SimpleHTTPServer 8000
       
    # Node.js
    npx http-server -p 8000
    
  3. Access Application
    • Open browser: http://localhost:8000

Method 3: Production Deployment

Using Nginx + Gunicorn:

  1. Install Gunicorn
    pip install gunicorn
    
  2. Start Gunicorn
    gunicorn -w 4 -b 0.0.0.0:5000 app:app
    
  3. Configure Nginx
    server {
        listen 80;
        server_name yourdomain.com;
           
        location / {
            root /var/www/pokemon-search/frontend;
            try_files $uri $uri/ /index.html;
        }
           
        location /api {
            proxy_pass http://localhost:5000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }
    }
    
  4. Enable Site
    sudo ln -s /etc/nginx/sites-available/pokemon /etc/nginx/sites-enabled/
    sudo nginx -t
    sudo systemctl reload nginx
    
  5. Setup SSL (Optional)
    sudo certbot --nginx -d yourdomain.com
    

๐ŸŒ Docker Deployment

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  Docker Network                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚   nginx    โ”‚  โ”‚  flask-api โ”‚  โ”‚  oracle-db    โ”‚  โ”‚
โ”‚  โ”‚  (Alpine)  โ”‚  โ”‚  (Python)  โ”‚  โ”‚  (11g XE)     โ”‚  โ”‚
โ”‚  โ”‚  Port: 80  โ”‚  โ”‚  Port:5000 โ”‚  โ”‚  Port: 1521   โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚        โ”‚                โ”‚                  โ”‚          โ”‚
โ”‚        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ–ฒ
         โ”‚ Port Mapping
         โ”‚
    [Host Machine]

1. Oracle Database Container

2. Flask API Container

FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["python", "app.py"]

3. Nginx Container

FROM nginx:alpine
COPY . /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

Management Commands

Start Services:

# Start in detached mode
docker build 
docker-compose up -d

# Start with logs
docker-compose up

# Rebuild images
docker-compose up -d --build

Stop Services:

# Stop containers
docker-compose stop

# Stop and remove containers
docker-compose down

# Remove volumes too
docker-compose down -v

View Logs:

# All services
docker-compose logs -f

# Specific service
docker-compose logs -f flask-api

# Last 100 lines
docker-compose logs --tail=100

Execute Commands:

# Access Oracle SQL*Plus
docker exec -it oracle-db sqlplus pokedb/5687@xe

# Access Flask container bash
docker exec -it flask-api /bin/bash

# Import data to Oracle
docker cp sql/pokedb.sql oracle-db:/tmp/
docker exec -it oracle-db sqlplus pokedb/5687@xe @/tmp/pokedb.sql

Monitor Resources:

# Container stats
docker stats

# Inspect container
docker inspect oracle-db

# View volumes
docker volume ls

Troubleshooting

Container Health Checks:

# Check all containers
docker-compose ps

# Expected output:
NAME         STATUS    PORTS
oracle-db    Up        0.0.0.0:1521->1521/tcp
flask-api    Up        0.0.0.0:5000->5000/tcp
nginx        Up        0.0.0.0:80->80/tcp

Common Issues:

  1. Oracle not starting:
    # Check memory (needs 2GB)
    docker stats oracle-db
       
    # View logs
    docker logs oracle-db
    
  2. Flask API connection errors:
    # Verify Oracle is ready
    docker exec oracle-db lsnrctl status
       
    # Test connection
    docker exec flask-api curl http://localhost:5000/api/pokemon
    
  3. Nginx 502 errors:
    # Check Flask is running
    docker ps | grep flask-api
       
    # Test backend
    curl http://localhost:5000/api/pokemon
    

๐Ÿ”’ Ngrok Integration

Overview

Ngrok creates secure tunnels to expose local servers to the internet, perfect for:

Setup

1. Install Ngrok:

# Download from ngrok.com
# Or use package manager:

# Windows (Chocolatey)
choco install ngrok

# macOS
brew install ngrok/ngrok/ngrok

# Linux
snap install ngrok

2. Authenticate:

ngrok config add-authtoken YOUR_TOKEN_HERE

3. Start Tunnel:

# Basic HTTP tunnel
ngrok http 5000

# With custom domain (paid)
ngrok http 5000 --domain=pokemon.ngrok.io

# Multiple tunnels (ngrok.yml)
ngrok start --all

Configuration File

ngrok.yml:

version: "2"
authtoken: YOUR_TOKEN_HERE

tunnels:
  flask-api:
    proto: http
    addr: 5000
    inspect: true
  
  frontend:
    proto: http
    addr: 80
    inspect: true

Start multiple tunnels:

ngrok start flask-api frontend

Frontend Integration

Automatic Endpoint Detection:

// config.js
const API_CONFIG = {
  // Try ngrok first (set by user)
  ngrok: localStorage.getItem('NGROK_URL'),
  
  // Fallback to localhost
  local: 'http://localhost:5000/api',
  
  // Get active endpoint
  get endpoint() {
    return this.ngrok || this.local;
  }
};

// Usage
fetch(`${API_CONFIG.endpoint}/pokemon`)
  .then(res => res.json())
  .catch(err => {
    // Try fallback
    if (API_CONFIG.ngrok) {
      API_CONFIG.ngrok = null;
      location.reload();
    }
  });

UI for ngrok URL:

<!-- In index.html -->
<div id="settings">
  <label>Ngrok URL (optional):</label>
  <input 
    type="text" 
    id="ngrok-url" 
    placeholder="https://abc123.ngrok-free.app/api"
  />
  <button onclick="saveNgrokUrl()">Save</button>
</div>

<script>
function saveNgrokUrl() {
  const url = document.getElementById('ngrok-url').value;
  localStorage.setItem('NGROK_URL', url);
  location.reload();
}
</script>

Features & Limits

Free Tier:

Paid Tier Benefits ($):


๐Ÿ“ก API Documentation

Base URL

Local:  http://localhost:5000/api
Ngrok:  https://your-ngrok-url.ngrok-free.app/api

Endpoints

1. Get All Pokรฉmon

GET /api/pokemon

Response:

[
  {
    "id": 1,
    "name": "bulbasaur",
    "type1": "Grass",
    "type2": "Poison",
    "hp": 45,
    "attack": 49,
    "defense": 49,
    "sp_atk": 65,
    "sp_def": 65,
    "speed": 45,
    "bst": 318,
    "generation": 1,
    "legendary": 0,
    "height": 0.7,
    "weight": 6.9,
    "catch_rate": 45,
    "abilities": "Overgrow, Chlorophyll"
  }
]

2. Get Pokรฉmon by ID

GET /api/pokemon/:id

Example: GET /api/pokemon/25

Response:

{
  "id": 25,
  "name": "pikachu",
  "type1": "Electric",
  "type2": null,
  "description": "When several of these POKรฉMON gather...",
  "evolution_chain": {
    "id": 172,
    "name": "pichu",
    "evolutions": [
      {
        "id": 25,
        "name": "pikachu",
        "requirement": "Friendship",
        "evolutions": [
          {
            "id": 26,
            "name": "raichu",
            "requirement": "Thunder Stone"
          }
        ]
      }
    ]
  },
  "type_effectiveness": {
    "defensive": {
      "multipliers": {
        "ground": 2,
        "electric": 0.5,
        "flying": 0.5,
        "steel": 0.5
      }
    }
  }
}

3. Get All Types

GET /api/types

Response:

[
  {
    "id": 1,
    "name": "Normal",
    "pokemon_count": 98
  },
  {
    "id": 2,
    "name": "Fire",
    "pokemon_count": 64
  }
]

4. Get Type Details

GET /api/types/:name

Example: GET /api/types/fire

5. Get All Abilities

GET /api/abilities

6. Get Ability Details

GET /api/abilities/:id

Example: GET /api/abilities/65

Error Responses

{
  "error": "Pokรฉmon not found"
}

Status Codes:


๐Ÿ”ฎ Future Enhancements

Phase 1: User Features

Phase 2: Enhanced Data

Phase 3: Advanced Features

Phase 4: Technical Improvements


๐Ÿ”ง Troubleshooting

Common Issues

Oracle Connection Errors

โ€œDPI-1047: Cannot locate Oracle Client libraryโ€

# Solution: Update lib_dir in app.py
oracledb.init_oracle_client(lib_dir="/path/to/instantclient")

โ€œORA-12541: TNS:no listenerโ€

# Check Oracle service
lsnrctl status

# Start if stopped
lsnrctl start

Docker Issues

Containers wonโ€™t start:

# Check logs
docker-compose logs -f

# Recreate containers
docker-compose down
docker-compose up -d --build

Database connection timeout:

# Oracle takes 1-2 minutes to initialize
# Wait and check logs
docker-compose logs -f oracle-db

Frontend Issues

API not loading:

  1. Verify backend: curl http://localhost:5000/api/pokemon
  2. Check CORS in app.py: CORS(app)
  3. Open browser console (F12) for errors

๐Ÿ“„ License

This project is licensed under the MIT License.

Acknowledgments


๐Ÿ“ž Contact

Developer: Hamza Arfaoui
Email: arfaouihamzaa3@example.com
GitHub: @yourusername
LinkedIn: your-profile

๐ŸŒ Live Demo: https://hamza05-dot.github.io/PokemonGame/frontend/index

๐Ÿ“ Repository: https://github.com/hamza05-dot/PokemonGame
๐Ÿ› Issues: https://github.com/hamza05-dot/PokemonGame/issues


**Made with โค๏ธ and โ˜•** *Gotta query 'em all!* ๐Ÿ”โšก [![Stars](https://img.shields.io/github/stars/hamza05-dot/PokemonGame?style=social)](https://github.com/hamza05-dot/PokemonGame/stargazers) [![Forks](https://img.shields.io/github/forks/hamza05-dot/PokemonGame?style=social)](https://github.com/hamza05-dot/PokemonGame/network/members)