I used Sequel Pro (Mac-exclusive) for my manager, but feel free to use whatever you like
- Connection Type: SSH
- MySQL Host: 159.89.159.138
- Username: Dylan
- Password: Please See Credentials Document For Password
- Database: mathLearningDB
- SSH Host: 159.89.159.138
- SSH User: Derek
- SSH Password: Please See Credentials Document For Password
In Seqel Pro, this is done by going to File --> Export, then selecting .sql as the export type and exporting all of the data from all of the tables
sudo apachectl start
sudo nano /etc/apache2/httpd.conf
Then, find the line with the #LoadModule php7_module
comment and remove the #
to turn it into an executable statement
sudo apachectl restart
Go to System Preferences --> MySQL
Click on the Active Instance and click Initialize Database
Select Use Legacy Password Encryption and make a password (i.e., newpassword, etc.)
NOTE: This password will need to be added later to the db.js
file
sudo /usr/local/mysql/bin/mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
NOTE: Use whatever password you defined when initializing the database (in my example, I used newpassword)
- Connection Type: Standard
- Host: 127.0.0.1
- Username: root
- Password: newpassword
NOTE: Use whatever password you defined when initializing the database (in my example, I used newpassword)
NOTE: If the 'test' DB doesn't already exist, create it
In Sequel Pro, navigate to import, then select the .sql file exported earlier
Navigate to db.js in whichever IDE you please
Change the following line to match your password created when initializing the DB
const sequelize = new Sequelize("test", "root", "newpassword", {
Where 'test' is the name of the local DB you created (in our case, we called it 'test')
Where 'root' is root
Where 'newpassword' is whichever password you assigned when initializing the DB
Remove the 'port' from the sequelize object
Remove the 'dialectOptions' from the sequelize object
NOTE: Make sure you stash these changes before committing (or add db.js to a .gitignore) as the server relies on this file for its own DB
You should now be able to run a development server
Run npm start
, first, in the Ampd directory
Run npm start
, second, in the react-ui directory
I have noticed that whenever I shut off my computer (or even log off), I have to reinitialize the MySQL Server before running npm start
in the respective directories. Just be sure to use the legacy password and keep it consistent with what you used before. You shouldn't have to re-import any data into the local DB.
For additional help with Mac installation, contact Zach
- Go to https://dev.mysql.com/downloads/windows/installer/8.0.html
- Click on the download button for the version with the larger file size.
- It will ask you to sign in. Just click on the small blue text stating
"No thanks, just start my download."
- Run the installer.
- Select
Custom
in the "Setup Type" tab. - In the "Select Products" tab, make sure
MySQL Server
,MySQL Workbench
,MySQL Shell
, andMySQL Router
are in the "Products To Be Installed" box. - In the "Installation" tab, press
Execute
to begin installation. - After installation, configuration will come up for the MySQL server.
- Press
Next
until you reach the "Accounts and Roles" tab and enter a root password for your MySQL server. - Click
Next
and eventuallyExecute
andFinish
. - Just click
Finish
on the Router Configuration. - Finish the installer.
After installation, the MySQL Workbench should already have connected to your new MySQL server.
- Double click on the created
Local Instance MySQL80
to open the administration screen. - Open and run the database creation SQL script.
- Download or fork and pull the Math-Learning repository from https://github.com/Schallenballa/Math-Learning/tree/master
- Place the
.env
file into the\Math-Learning\Ampd
folder. (This contains the secret credentials for the Twilio API) Take care not to push this file to GitHub. - You will need to alter
db.js
to match your MySQL server credentials. (\Math-Learning\Ampd\database) - If your IDE has terminal functionality, open 3 terminal windows. (You will need these everytime you want to start the server)
- Ensure that the current directory of the first terminal window is the base project folder (\Math-Learning\Ampd)
- Run
npm install
. When it is finished runnpm audit fix
to patch some vulnerabilities. - Ensure that the current directory of the seccond terminal window is the react-ui folder (\Math-Learning\Ampd\react-ui)
- Run
npm install
(this will take upto 10 mins). When it is finished runnpm audit fix
to patch some vulnerabilities. - Ensure that the current directory of the third terminal window is the folder containing mysql.exe (C:\Program Files\MySQL\MySQL Server 8.0\bin)
- Enter
mysql -u root -p
into the third terminal window. - It will ask for a password. Enter the password you created when setting up the MySQL server.
- Your should see the directory change to
mysql>
- In the first terminal window (base folder) run
npm start
and wait for the 'listening on port 5000' message. - In the second terminal window (react-ui) run
npm start
and wait for the website to automatically open in a new browser tab.