Attendance roster that lets you set students as present/absent. Roster information is stored persistently in a MySQL database.
Vue.js, Laravel, MySQL, phpunit
- Open MySQL
mysql --local-infile=1 -u root -p
- In MySQL, Create a database:
CREATE DATABASE attendance_DB;
USE attendance_DB;
- 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)
);
- 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);
- cd into attendance-roster
cd attendance-roster
- Start up the laravel server
php artisan serve
- for first-time use, ensure vue is installed
npm install
- run a hot deploy
npm run hot
- cd into attendance-roster
cd attendance-roster
- Confirm & add feature tests in ./test/Feature
- Confirm & add unit tests in ./test/Unit
- Run all tests
php artisan test --verbose
- Note: feature tests only pass if laravel, vue, & the MySQL db is running