This is a simple, elegant responsive portfolio template built using plain JavaScript, HTML, CSS, and PHP with MySQL database. It features a complete admin panel for content management, allowing you to easily update your portfolio information without editing code.
- Responsive Design
- Single-page layout
- MySQL Database Integration
- Admin Panel for content management
- Image Upload functionality
- Dark Mode Toggle
- PHP Mailer Integration
- RESTful API Architecture
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Apache/Nginx web server
- PHP extensions: PDO, PDO_MySQL
git clone https://github.com/hhlitval/simple-portfolio-template.git
cd simple-portfolio-template-
Create a MySQL database:
CREATE DATABASE portfolio_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-
Import the database schema:
mysql -u root -p portfolio_db < database.sqlOr using phpMyAdmin:
- Open phpMyAdmin
- Select the
portfolio_dbdatabase - Go to Import tab
- Choose
database.sqlfile and click Go
Edit config/database.php and update the database credentials:
private $host = 'localhost';
private $db_name = 'portfolio_db';
private $username = 'root'; // Your MySQL username
private $password = ''; // Your MySQL passwordEdit mail.php and update with your SMTP credentials:
$mail->Host = 'smtp.example.com';
$mail->Username = 'user@example.com';
$mail->Password = 'secret';
$mail->Port = 465;
$mail->setFrom('from@example.com', $title);
$mail->addAddress('youraddress@mail.me');Make sure the uploads/ and img/ directories are writable:
chmod -R 755 uploads/
chmod -R 755 img/- Frontend: Open
http://localhost/simple-portfolio-template/in your browser - Admin Panel: Navigate to
http://localhost/simple-portfolio-template/admin/
Default Login Credentials:
- Username:
admin - Password:
admin123(Please change this after first login)
-
Generate a new password hash:
<?php echo password_hash('your_new_password', PASSWORD_DEFAULT); ?>
-
Update the password in
database.sqlor directly in MySQL:UPDATE users SET password = 'your_hashed_password' WHERE username = 'admin';
The application uses the following main tables:
users- Admin user accountsprofile- Portfolio profile informationsocial_links- Social media linksskills- Skills with percentagesservices- Services offerededucation- Education historywork_experience- Work experienceachievements- Achievements and awardsprojects- Portfolio projects
- Login at
/admin/with your credentials - Navigate through different sections using the sidebar
- Add, edit, or delete content items
- Upload images directly through the admin interface
- Preview images by clicking the eye icon in tables
- Images are automatically organized into folders:
- Hero images →
img/hero/ - Service icons →
img/services/ - Achievement images →
img/achievements/ - Project images →
img/works/ - Social icons →
img/social_icons/
- Hero images →
- Edit
index.htmlfor HTML structure - Modify
css/main.cssfor styling - Update
js/main.jsfor frontend functionality
The admin panel provides a user-friendly interface to manage all portfolio content:
- Profile: Update personal information, hero image, and about text
- Social Links: Manage social media links and icons
- Skills: Add/edit skills with percentage values
- Services: Manage services offered
- Education: Add education history
- Work Experience: Manage work experience entries
- Achievements: Add achievements with images
- Projects: Manage portfolio projects
All changes are saved to the MySQL database and reflected immediately on the frontend.
- Change the default admin password immediately
- Keep database credentials secure
- Use prepared statements (already implemented) to prevent SQL injection
- Ensure proper file permissions on upload directories
- Consider using HTTPS in production
This project is licensed under the MIT License.
