Skip to content

lawcunanan/FixMyRoad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fix My Road (FMR) 2.0

A small PHP web application for reporting and managing road issues (potholes, hazards, etc.). This repository contains the FMR 2.0 web app built to run on a local PHP environment (for example XAMPP).

Table of contents

Project overview

FMR 2.0 is a PHP-based web application for users to report road issues and for administrators to manage reports. It's built with plain PHP and uses a MySQL database. The project is intended to run in a typical LAMP/WAMP stack — on Windows we recommend XAMPP.

Features

  • User signup, login, profile and report submission.
  • Admin panel to list, review, update and manage reports.
  • Email notifications (PHPMailer included under model/PHPMailer).
  • Simple map integration (see map.js) for report locations.

Prerequisites

  • Windows, macOS or Linux
  • PHP 7.4+ (or compatible) with mysqli
  • MySQL / MariaDB
  • XAMPP (recommended for Windows) or equivalent local server
  • Composer (optional, for PHPMailer updates)

Installation

  1. Place the project folder in your web server root. For XAMPP on Windows, copy the folder to C:\xampp\htdocs\ so the app is reachable at http://localhost/FMR 2.0/.
  2. Start Apache and MySQL in the XAMPP control panel.
  3. Import the database:
    • Open phpMyAdmin (http://localhost/phpmyadmin)
    • Create a new database (for example fmr_db).
    • Import the SQL file fixmyroad.sql from the project root.
  4. Update the database credentials in model/database.php to match your MySQL user, password and database name.

Configuration

  • model/database.php: set DB_HOST, DB_USER, DB_PASS, DB_NAME.
  • model/email.php (and model/PHPMailer files): configure SMTP settings if you want outbound email. See the PHPMailer notes below.
  • If the project uses any hard-coded base URL, search for http:// references and update them for your environment.

Database

The repository contains fixmyroad.sql in the project root — import this to create the tables and example data. After importing, ensure the database user has the required privileges.

Running the app

  1. Ensure Apache and MySQL are running (via XAMPP).
  2. Open a browser and navigate to http://localhost/FMR 2.0/ (or the folder name you used).
  3. Use the UI to register, login, and create reports. Admin interfaces are under view/admin/.

File structure (high level)

  • index.php — main entry page
  • navbar.php, sidebar.php — shared UI pieces
  • model/ — database, email, JS and helper code
    • database.php — DB connection
    • email.php — email wrapper
    • PHPMailer/ — bundled PHPMailer library
  • controller/ — controllers for admin, security, and user actions
  • view/ — UI: admin/, security/, user/ folders with pages
  • style/ — CSS files used by the UI
  • fixmyroad.sql — database dump for import

PHPMailer / Email setup

PHPMailer is included in model/PHPMailer. To enable sending email:

  1. Edit model/email.php or the file where SMTP is configured and provide SMTP host, port, username and password.
  2. If using Gmail or other providers, ensure the account allows SMTP access (app passwords or OAuth may be required).
  3. (Optional) Run composer install inside model/PHPMailer if you want to manage dependencies via Composer (not required for the bundled files).

Development notes & tips

  • Sanitize and validate user inputs in controller/ before using them in queries.
  • Consider moving DB credentials to an environment file (not committed to git) instead of keeping them in model/database.php.
  • Ensure uploaded files (if any) are validated and stored outside web-root or with safe names.

Contributing

If you'd like to add features or fixes:

  1. Fork the repository on GitHub.
  2. Create a branch: feature/your-feature.
  3. Make changes and test locally.
  4. Submit a pull request with a description of your changes.

Please include migration steps if your change modifies the DB schema.

License

This repository does not include an explicit license file. If you want to make the project open-source with a standard license, consider adding an LICENSE file (for example, MIT). If you'd like, I can add an MIT license file for you.

About

A small PHP web application for reporting and managing road issues (potholes, hazards, etc.). This repository contains the FMR 2.0 web app built to run on a local PHP environment (for example XAMPP).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors