This README provides information on setting up and running a React app that utilizes Node modules. Please note that the node_modules directory has been ignored in this GitHub repository. Follow the steps below to properly set up and run the app.
Make sure you have the following installed on your machine:
- Node.js (v16.17.1.)
- npm (npm: '8.15.0')
- MySQL Workbench
- Setup Video for Mac
-
Clone the repository to your local machine:
git clone https://github.com/sjcineas/scoreboard.git
-
Navigate to the project directory:
cd scoreboard -
Install project dependencies:
npm install
This will install the necessary Node modules.
- Create .env file inside server folder with the following and fill in the
DB_HOST=localhost
DB_USER=<usually 'root' but may be different'
DB_PASSWORD= <password>
DB_NAME=score
- You will need to create tables and seed data. Run the following commands (not together) to do so.
grunt create-tablesgrunt seed-dataTo automate database setup, seeding, and app startup, use the following Grunt commands:
Creates the necessary tables (register, membership, events, attendance) in your score database if they don't already exist.
grunt create-tablesSeeds the database tables with initial test data from JSON files located in ./test-data. It adds members, admin users, events, and attendance data by making HTTP POST requests to your API.
grunt seed-dataStarts the application (npm start) in a new terminal tab, waits 20 seconds for it to initialize, then seeds the database with the initial data.
grunt start-and-seedDrops all tables (membership, events, register, attendance) from the database.
grunt drop-tablesnpm run launch