Web development example for filtering non-profit organizations from IRS data.
Included below is a brief overview of the project structure and workflow.
This web application features two views:
The first page allows text/plain files to be uploaded via a form. File validation is performed on the client-side via HTML5 input type='text/plain'
, as well as on the server-side via PHP.
The second page displays data in the view, and provides various sorting and filtering options.
The directory tree of the project is outlined below with comments.
-- contains core application files
- app
-- application assets - php class files, views, javascripts, and stylesheets
- assets
- css
- data
- js
- php
-- helper files for processing files and server-side logic
- helpers
-- views for displaying data
- views
-- contains database schema file for creating the database
- db
-- database build queries in mysql
- sql
-- index
index.html
-- readme
readme.md
-
The uploaded file is sent to the server via a post request, and processed via a helper in
app/helpers/processFile.php
. The uploaded file is checked for validation. The file is read into the table via theLOAD DATA INFILE
SQL query. -
Once the upload is complete, the helper file
app/helpers/processFile.php
redirects to a viewapp/views/display.php
to display the data. This view features various sorting and filtering operations on the data. -
Filtering and sorting is performed asynchronously via XMLHTTP requests in
app/assets/js/actions.js
. This file sends GET requests to a PHP helperapp/helpers/actions.php
which performs various queries on the database. The data is returned to be displayed on the view.
- PHP 5.6
- MySQL
This project uses an open-source PHP/MySQL PDO connection class, available here.
Debugging and testing was performed via XAMPP.