Attempt to streamline the process of assigning TT tokens to students so as to reduce manpower costs =P
Idea: Instead of scanning 3 (TT token, nric, contact number) items in SupplyAlly, this app will keep track of the students to be tagged, so it sufficies to just scan the TT token
- Copy
.env.example
to.env
and set the variables accordingly. - Install gem dependencies
bundle install
rails s
to start server
Make sure that an instance of postgres is running. An instance of postgres can be started in docker by running docker-compose -f docker-compose-local.yml up
- Start fresh with a new database by running:
rails db:setup
-
If you need to make changes to existing tables, add a new migration
rails generate migration <migration_name>
-
Run the new migrations
rails db:migrate
-
Update schema diagram
make schema
Load a single Excel file:
bin/rails 'data:load[./27Feb5pm/S2-2-Fairfield\ Methodist\ Primary\ School\ \(HQ\).xlsx]'
Load all Excel files in a directory:
find ./27Feb5pm/ -mindepth 1 -type f -print0 | xargs -0 -I{} bin/rails 'data:load[{}]';