Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🛒 Local Marketplace MVP

A monolithic classified ads marketplace built with PHP, MySQL, HTML5/CSS3 and Bootstrap 5, inspired by local buy-and-sell platforms. This project emphasizes software architecture fundamentals, secure authentication mechanisms, relational database integrity, and clean separation of concerns without relying on external frameworks.


🚀 Tech Stack

PHP MySQL Bootstrap HTML5 CSS3


✨ Core Features

👤 User Management & Security

  • Secure user registration and login system.
  • Session-based authentication.
  • Password hashing using BCRYPT.
  • Centralized route protection via auth-guard.php.
  • User profile management interface.
  • Secure session validation for protected pages.

📢 Classified Posts

  • Full CRUD operations for listings.
  • Secure image upload support.
  • Reverse chronological marketplace feed.
  • Keyword-based search on listing titles.
  • Ownership verification before editing or deleting ads.

⭐ Favorites System

  • Save listings to a personal favorites collection.
  • Dedicated "My Favorites" page.
  • Prevention of duplicate favorite entries through database constraints.

💬 Messaging System

  • Context-aware conversations linked to listings.

  • One unique chat room per:

    • Listing
    • Buyer
    • Seller
  • Timestamped messaging history.

🛠️ Administration Panel

  • User management dashboard.
  • User promotion to administrator role.
  • Account suspension and deletion.
  • Administrative action safeguards.
  • Protection against self-deletion and self-suspension.

🏗️ Technical Architecture

Layer Technology
Backend PHP
Database MySQL
Frontend HTML5
Styling Bootstrap 5 / CSS3
Authentication PHP Sessions

🔒 Security Features

SQL Injection Protection

Input sanitization is enforced using:

mysqli_real_escape_string($conn, $input);

Identifier lookups are strictly cast:

$postId = (int) $_GET['id'];

Password Security

Passwords are hashed using:

password_hash($password, PASSWORD_BCRYPT);

Access Control

  • Server-side authorization checks.
  • Session validation before sensitive actions.
  • Ownership verification for content modifications.

Administrative Safeguards

  • Prevention of self-account deletion.
  • Prevention of self-suspension.
  • Verification of administrator privileges before mutations.

📂 Project Structure

luky/
│
├── config/
│   ├── database.php       # Database connection
│   ├── database.sql       # Database schema
│   └── init_db.php        # Database initialization script
│
├── public/
│   ├── auth/              # Authentication pages
│   ├── components/        # Reusable UI components
│   ├── handlers/          # Form processing & business logic
│   ├── security/          # Security utilities and guards
│   ├── uploads/           # Uploaded listing images
│   ├── user/              # User-related pages
│   │
│   ├── admin.php          # Administration dashboard
│   ├── details.php        # Listing details page
│   ├── index.php          # Marketplace homepage
│   ├── search.php         # Search results page
│   └── style.css          # Global stylesheet
│
└── README.md

Directory Responsibilities

Directory Purpose
config/ Database configuration and initialization scripts
auth/ Login and registration features
components/ Shared layouts, headers, footers, and reusable UI parts
handlers/ Form submissions and business logic processing
security/ Authentication guards and security utilities
uploads/ User-uploaded images
user/ Profile management and user-specific pages

⚙️ Installation

1. Clone or Copy the Project

Place the project inside your local web server directory.

WampServer

C:/wamp64/www/luky/

2. Create the Database

  1. Open phpMyAdmin
  2. Create a database named:
luky_db
  1. Select collation:
utf8mb4_general_ci
  1. Import:
database.sql

or execute

init_db.php

located at the root of the project.


4. Create a Virtual Host

WampServer (Recommended)

  1. Launch WampServer.
  2. Left-click the WampServer icon in the system tray.
  3. Navigate to:
Tools → Add a Virtual Host
  1. Fill in the form:
Virtual Host Name:
luky.local

Project Path:
C:/wamp64/www/luky/public
  1. Click Start the creation of the VirtualHost.
  2. Once the process is complete, restart WampServer if prompted.

WampServer will automatically:

  • Create the Apache virtual host configuration.
  • Update the Windows hosts file.
  • Configure the local domain.

5. Run the Application

Open your browser and visit:

http://luky.local

🎯 Learning Objectives

This project demonstrates:

  • Session-based authentication
  • Secure password management
  • Relational database design
  • Foreign key constraints
  • CRUD application architecture
  • PHP application structuring
  • User authorization workflows
  • Administrative role management
  • Messaging system implementation

📜 License

Developed as a group project for the Web Development course during the B1 (Bachelor Year 1) program at ECE Engineering School.

Feel free to modify, extend, and use it as a learning resource.

For educational and portfolio purposes only.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages