-
Notifications
You must be signed in to change notification settings - Fork 3
Tips and Tricks
Random tips and tricks that might be useful
-
Want to develop locally? Make sure you start the MySQL daemon via MAMP/WAMP, then navigate to localhost:. The default port (in the URL) will be 80 on Windows and 3000 on Mac.
-
The Event table gets wiped every semester, but attendance data does not (stored in the AttendsEvent table).
-
Want to release changes but are currently off-campus?
- Push your changes to GitHub.
- Log into the VPN (setup instructions here).
- Release changes like usual through Plesk Web Admin.
-
Once set up, PHPStorm's Database tab is extremely useful, primarily allowing you to view and manipulate your local SQL database in PHPStorm's GUI, rather than accessing it through the command line. When developing new features that access the SQL database, you are most likely going to want to test SQL queries and check their responses before using them in live code. You can access the SQL console from the PHPStorm Database tab by right-clicking on a table name, hitting "Jump to Console", and then selecting either "New console" or the default option (the default probably works in most cases).
-
PHPStorm's Run tab is also similarly useful. While developing locally and after starting up the site through PHPStorm's Run button (aka: the green play button in the top right of your window), you can navigate to any page in the site and view every file that's loaded by your browser for that webpage.
-
Using GitHub Desktop abstracts away a significant portion of command-line Git and will be extremely helpful if you are not comfortable using the command line. From experience, one of the app's most underrated benefits is that it allows you to only commit certain parts of the changes you've made to the codebase and discard others easily.
-
NEVER commit
database_connect.php
andmemberLogin.php
to the main codebase. These files must be individually configured for your system and changing them (and subsequently releasing the changes to the live site) will break the live site. -
Keep master clean. The
master
branch should always be 100% working. If you are working on a new feature or page, follow the following flow:- Create a new branch off
master
. - Make your changes.
- Commit and push your changes to GitHub.
- Create a pull request and have someone look it over (if there are more than two Tech Chairs or if you want an extra set of eyes on something).
- Verify that the code on your branch is working on the staging site (http://reckclub.gtorg.gatech.edu).
- Merge your changes into
master
.
- Create a new branch off
-
Because of Plesk's weirdness, you will need to replace environment variable placeholders with their actual values after every deployment to the live site. The most important ones to fix are in the Big Buzz and Reck appearance request handlers:
httpdocs/big-buzz/request-handler.php
andhttpdocs/reck/request-handler.php
, respectively. ReplaceSENDGRID_API_KEY
,RECK_REQUEST_RECIPIENT
, andBIG_BUZZ_REQUEST_RECIPIENT
with their proper values (a previous tech chair will have the SendGrid key, while the other two are the emails of their respective request recipients). If you have other environment variables that need to be set for the site to work properly, replace them at this time as well. DO NOT COMMIT ANY ENVIRONMENT VARIABLE VALUES TO GIT. -
familyEvents.php
was once lost to time, but has since been found and is (sparingly) used again. The intended usage of the page was to configure family events (which were previously thought to have disappeared into the aether when the relevant box was checked during event creation). When creating a family event as a family head, you're typically going to want to:- Create the event and make sure the family event checkbox is selected
- Navigate to /familyEvents.php.
- Pick your event from the dropdown and the family you want to assign it to (probably yours).
- Hit "Add" (or "Remove", if you want to remove an existing event-family association).
-
DO NOT make any changes to /editFamilies.php. That page's CSS essentially runs on black magic and it should be preserved in a working state.
-
To update the remote copy of the Reck history site, make and commit your changes on the
reckhistory
repo. After runningjekyll serve
, copy all files from the generated_site
folder from that project over into thereckhistory
folder in this one. If you're asked if you want to overwrite anything, hitYes
orAccept
or whatever. This manual process can probably be automated with a shell script if you're feeling adventurous. -
If you ever get into a weird state with MAMP's MySQL server where you are unable to log into the root account via PHPStorm or otherwise, you can reset the root password using these steps: https://www.tech-otaku.com/local-server/resetting-mamp-mysql-root-user-password/