Skip to content

Latest commit

 

History

79 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PokemonDB

PokemonDB is a web application built with PHP and MySQL that allows users to browse a complete database of Pokémon (up to generation 5). Registered users can create and manage their own personal Pokédex by "catching" and "releasing" Pokémon. This dynamic functionality uses an asynchronous, REST-like API, which users can also query directly using their personal account ID (UUID) found on their account page.

Features

  • User Authentication: Users can create new account, log in, log out and delete their account.
  • National Pokédex: A full gallery of all Pokémon (up to generation 5), showing their sprites and types.
  • Personal Pokédex: Logged-in users have a personal Pokédex page.
    • "Caught" Pokémon are shown in full color.
    • "Uncaught" Pokémon are shown as silhouettes.
  • Catch/Release: Users can add or remove Pokémon from their personal Pokédex using the Pokéball button.
  • Pokémon Details: Users can click on a Pokémon to view a more detailed page about it like stats and moves.

Technology Stack

  • Backend: PHP
  • Database: MySQL/MariaDB
  • Frontend: HTML, CSS, JavaScript
  • API: A simple REST-like API that supports getting, adding and deleting pokemon with GET, POST, DELETE.
  • API Authentication: Uses a Bearer Token in the Authorization header to identify users for API requests.

Setup and Installation

To run this project locally, follow these steps:

  1. Clone this repo: Place the contents of this repo into your web server's root.
  2. Database Setup:
    • Create a new MySQL database. The application is configured to use the name pokemon.
    • Import the pokemon.sql file into your database. This file contains the complete schema for all tables (nationaldex, moves, users, user_pokedex, etc.) and pre-populates them with the necessary data.
  3. Configure Credentials:
    • Open the config.php file.
    • Update the DB_HOST, DB_NAME, DB_USERNAME, and DB_PASSWORD constants to match your local database environment.
  4. Run: Start your web server.

Deployment

This application was originally hosted on Amazon Web Services (AWS).

  • The main PHP application was served from an Amazon EC2 instance running an Apache web server.
  • The MySQL database was hosted using Amazon RDS, providing a scalable and managed database solution.

The deployment used a Virtual Private Cloud (VPC) with two subnets to securely separate the web server from the database.

  • Public Subnet: The EC2 Instance was placed in a public subnet.
  • Private Subnet: The RDS Instance was placed in a private subnet.

Security Group Configuration:

  1. EC2 Security Group (web-server-sg):
    • Inbound Rules:
      • Allow HTTP (port 80) from 0.0.0.0/0 (Anywhere) to let users access the website.
      • Allow SSH (port 22) from my IP that let me manage the server.
    • Outbound Rules:
      • (Default) Allow 0.0.0.0/0 (Anywhere).
  2. RDS Security Group (database-sg):
    • Inbound Rules:
      • Allow MySQL (port 3306) from the web-server-sg.
    • Outbound Rules:
      • (Default) Allow 0.0.0.0/0 (Anywhere).

About

A PHP web application with a relational database containing all Pokémon and move data up to Generation V.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages