COSC4606-Assignment-02

Database front end that allows for CRUD operations and user management
git clone git://mattcarlson.org/repos/COSC4606-Assignment-02.git
Log | Files | Refs | README

README.md (2531B)


      1 # COSC4606-Assignment-02
      2 
      3 Database front end that allows for CRUD operations and user management.
      4 
      5 ## Idea
      6 The idea here is that the database holds the students and employees (instructors, registrars, etc.) of a fictional university. Users can perform SQL operations through role-specific forms. Also supported is the ability for users to generate reports.
      7 
      8 ## Security
      9 This project was an exercise in security.
     10 
     11 First, users have roles which basically dictate what SQL operations they can perform. Each user account has associated with it a username and password. The latter is hashed via bcrypt.
     12 
     13 Second, all SQL statements are prepared, thereby making SQL injection a non-issue.
     14 
     15 ## Reports
     16 
     17 As stated above, users can generate reports. This is accomplished under the hood with FPDF, a free PHP class which contains a number of functions for creating and manipulating PDFs.
     18 
     19 ## Usage
     20 
     21 There are a few prerequisites for replicating the app:
     22 
     23 - GNU/Linux (Windows should also work)
     24 - MariaDB (download from [https://mariadb.org](https://mariadb.org))
     25 - PHP with MySQLi extension (MySQLi can easily be enabled in php.ini and is compatible with MariaDB)
     26 
     27 Before doing anything, the database needs to be imported into a server. Make sure a local MariaDB server is running on your machine and run the following commands (the default password for `root` is blank):
     28 
     29 ```
     30 $ mysql -u root -p
     31 mysql> CREATE DATABASE cosc4606_assignment_02;
     32 CTRL+D
     33 $ mysql -u root -p cosc4606_assignment_02 < cosc4606-assignment-02.sql
     34 ```
     35 This application extensively uses PHP, so make sure that a local server is running. That can be done by navigating to the base directory of the app and typing `php -S localhost:8000` into the terminal. Open up a web browser and type `localhost:8000` into the URL bar to see the login page.
     36 
     37 Once you are at the login page, you will be prompted for a username and password. You can use the admin account to log in. Use `admin` for both the username and the password.
     38 
     39 Logging in will redirect you to the home page. From there you can either log out or choose an action by clicking on the 'Actions' button.
     40 
     41 ## Screenshots
     42 
     43 ![cosc4606-assignment-02-login](https://mattcarlson.org/img/cosc4606-assignment-02-login.png)
     44 
     45 ![cosc4606-assignment-02-admin](https://mattcarlson.org/img/cosc4606-assignment-02-admin.jpg)
     46 
     47 ![cosc4606-assignment-02-add-user](https://mattcarlson.org/img/cosc4606-assignment-02-add-user.png)
     48 
     49 ![cosc4606-assignment-02-view-users](https://mattcarlson.org/img/cosc4606-assignment-02-view-users.png)