This is a simple anime review site built with PHP and MySQL. Users can register, log in, view anime details, leave reviews, and manage their profile.
- User registration and login
- View anime details and reviews
- Add, edit, and delete reviews
- Change user profile information
- Responsive design with a clean user interface
To set up this project on your local machine, follow these steps:
- PHP >= 7.0
- MySQL or MariaDB
- Git (for cloning the repository)
-
Clone the repository:
git clone https://github.com/Fatihparm/anime-site-php.git cd anime-site-php
-
Set up the database:
- Create a database named
anime_site
. - Import the provided
anime_site.sql
file into your database. This file contains the necessary tables and sample data. - You can manually connect it by phpmyadmin or you can run the code below.
mysql -u your_username -p anime_site < anime_site.sql
- Create a database named
-
Run the application:
If you're using a local server like XAMPP or WAMP, place the project in the
htdocs
orwww
directory, respectively.Alternatively, you can use PHP's built-in server:
php -S localhost:8000
Then, open your browser and navigate to
http://localhost:8000
.
-
Register a new account:
Go to the registration page, fill in your details, and submit the form to create a new account.
-
Log in:
Use your registered email and password to log in.
-
View Anime Details:
On the homepage, click on an anime to view its details, including the description, score, and reviews.
-
Add a Review:
If you are logged in, you can add a review by filling out the form at the bottom of the anime details page.
-
Edit or Delete Your Review:
On your profile page, you can see all your reviews. You can edit or delete your reviews from there.
-
Change Name:
On the profile page, you can change your name.
-
Change Password:
On the profile page, you can change your password by providing your old password and the new password.
-
Delete Account:
You can delete your account from the profile page.
The scrape.py
script is used to scrape anime data from a source and populate the database. This script is written in Python and requires BeautifulSoup and requests libraries.
This script should only be used once if animes table somehow empty.
Please don't run this script if animes table is full. It will duplicate entire database and we don't want that.
-
Install the required Python libraries:
pip install beautifulsoup4 requests
-
Add .env file:
DB_HOST=127.0.0.1 DB_USER=root DB_PASSWORD=your_password DB_NAME=your_db_name
-
Run the script:
python scrape.py
The script will scrape anime data from the specified source and insert it into the
animes
table in the database.
The scrape.py
script performs the following tasks:
- Connects to a specified anime data source.
- Scrapes relevant information such as title, description, image URL, score, rank, popularity, and season.
- Inserts the scraped data into the
animes
table in the database.