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.
โ
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

Basic Filters:
Advanced Name Filters:
_ i _ a _ _)Advanced Filters:



| ### Main Search Interface (Desktop)  *Advanced filtering with real-time results* | ### Search Results Grid  *Pokรฉmon displayed in responsive card layout* |
| ### Pokรฉmon Details View  *Complete information with stats and abilities* | ### Evolution Chain Display  *Interactive evolution tree with requirements* |
| ### Type Effectiveness Page  *Visual type matchups for Normal type* | ### Type Pokรฉmon Listing  *All Normal-type Pokรฉmon displayed* |
| ### Abilities Overview  *Searchable ability database with descriptions* | ### Ability Details  *Detailed stats and information sections* |
|  *Mobile search interface* |  *Mobile Pokรฉmon cards* |  *Mobile navigation menu* |
Fully responsive design optimized for mobile devices
# 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
# 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 | 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 |
| Technology | Version | Purpose |
|---|---|---|
| HTML5 | - | Semantic structure |
| CSS3 | - | Styling with animations |
| JavaScript | ES6+ | Client-side logic and interactivity |
| Fetch API | - | Asynchronous HTTP requests |
| 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 |
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

| 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) |
โ
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
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)
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;
Prerequisites:
Steps:
git clone https://github.com/yourusername/pokemon-search.git
cd pokemon-search
# Create .env file
cp .env.example .env
# Edit .env (optional)
ORACLE_PASSWORD=your_password
FLASK_PORT=5000
NGINX_PORT=80
docker-compose up -d
# Windows
.\import_data.bat
# Linux/Mac
chmod +x import_data.sh
./import_data.sh
# Check all containers running
docker-compose ps
# View logs
docker-compose logs -f
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
Prerequisites:
Backend Setup:
XE)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;
sqlplus pokedb/5687@xe @sql/pokedb.sql
cd backend
pip install -r requirements.txt
# 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
)
python app.py
# Server runs on http://localhost:5000
Frontend Setup:
cd frontend
# Python 3
python -m http.server 8000
# Python 2
python -m SimpleHTTPServer 8000
# Node.js
npx http-server -p 8000
Using Nginx + Gunicorn:
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 app:app
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;
}
}
sudo ln -s /etc/nginx/sites-available/pokemon /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d yourdomain.com
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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
oracleinanutshell/oracle-xe-11g/u01/app/oracle2. 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;"]
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
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:
# Check memory (needs 2GB)
docker stats oracle-db
# View logs
docker logs oracle-db
# Verify Oracle is ready
docker exec oracle-db lsnrctl status
# Test connection
docker exec flask-api curl http://localhost:5000/api/pokemon
# Check Flask is running
docker ps | grep flask-api
# Test backend
curl http://localhost:5000/api/pokemon
Ngrok creates secure tunnels to expose local servers to the internet, perfect for:
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
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
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>
Free Tier:
Paid Tier Benefits ($):
pokemon.ngrok.io)Local: http://localhost:5000/api
Ngrok: https://your-ngrok-url.ngrok-free.app/api
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"
}
]
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
}
}
}
}
GET /api/types
Response:
[
{
"id": 1,
"name": "Normal",
"pokemon_count": 98
},
{
"id": 2,
"name": "Fire",
"pokemon_count": 64
}
]
GET /api/types/:name
Example: GET /api/types/fire
GET /api/abilities
GET /api/abilities/:id
Example: GET /api/abilities/65
{
"error": "Pokรฉmon not found"
}
Status Codes:
200 - Success404 - Resource not found500 - Server errorโ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
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
API not loading:
curl http://localhost:5000/api/pokemonCORS(app)This project is licensed under the MIT License.
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