/BasicAttendanceRoster

Full stack attendance roster application to persistently store the present/absent status of students from a database

Primary LanguagePHP

Basic Attendance Roster

Attendance roster that lets you set students as present/absent. Roster information is stored persistently in a MySQL database.

Tech Stack

Vue.js, Laravel, MySQL, phpunit

Setup

Setting Up the Database

  1. Open MySQL
    mysql --local-infile=1 -u root -p
  1. In MySQL, Create a database:
    CREATE DATABASE attendance_DB;
    USE attendance_DB;
  1. Create a table in the database to store the roster
    CREATE TABLE students (
        student_id VARCHAR(255) NOT NULL, 
        first_name VARCHAR(255) NOT NULL, 
        last_name VARCHAR(255) NOT NULL, 
        email VARCHAR(255) NOT NULL, 
        PRIMARY KEY (student_id)
    );
  1. Import CSV data into the table (fill in correct path to csv file) (CSV used here is ./attendance_data.csv)
    LOAD DATA LOCAL INFILE 
    '/path/to/your/csv/file' 
    INTO TABLE students 
    FIELDS TERMINATED BY ',' 
    ENCLOSED BY '"'
    LINES TERMINATED BY '\n' 
    IGNORE 1 ROWS 
    (student_id, first_name, last_name, email);

Run the Laravel Backend

  1. cd into attendance-roster
    cd attendance-roster
  1. Start up the laravel server
    php artisan serve

Run the Vue Front End

  1. for first-time use, ensure vue is installed
    npm install
  1. run a hot deploy
    npm run hot

Testing

  1. cd into attendance-roster
    cd attendance-roster
  1. Confirm & add feature tests in ./test/Feature
  2. Confirm & add unit tests in ./test/Unit
  3. Run all tests
    php artisan test --verbose
  1. Note: feature tests only pass if laravel, vue, & the MySQL db is running