the Student Success Tool is built on:
-
Laravel Framework. Documentation
-
Inertiajs. Documentation
-
Reactjs. Documentation
-
Tailwindcss. Documentation
For the record: How to set-up an env from scratch DO NOT DO THIS FOR fellows dev environment or local development as this has already been done
- Create a Cloud Bucket to store the static files (the files we'll generate in the cloudbuild autodeploy flow)
- Update the cors-config.json with allowed origin URLs
- Run
gcloud storage buckets update gs://<BUCKET_NAME> --cors-file=cors-config.json
- Run
gsutil cors get gs://<BUCKET_NAME>
to check that the cors config applied to the bucket - Run
gcloud storage buckets add-iam-policy-binding gs://<BUCKET_NAME> --member=allUsers --role=roles/storage.objectViewer
to enable public internet access to the bucket
NOTE: DO NOT STORE SENSITIVE/SECRET INFO IN THIS BUCKET -- this bucket should be only used to store static vite generated files.
- Static Asset Creation: handled automatically on push by Cloudbuild.yaml using npm install and npm build and cp to cloud bucket Cloud Build
- Database migrations: Cloud Run Job
- Auto-deploy: orchestrated by Cloud Build (currently stored inline) on Github push
You only have to do this once in your local development system.
brew install composer
(Assuming you are on Mac, but install as you think best)brew install npm
(Assuming you are on Mac, but install as you think best)
If you use npm run dev
it'll allow for realtime updates in the local site as you make changes.
- Clone this project
cd [project-name]
composer install
- Copy
.env.example
file to.env
in the root of the repo folder. npm install
(and potentially clear your cache:php artisan cache:clear
,php artisan route:clear
,php artisan view:clear
,php artisan optimize:clear
,composer dump-autoload
)php artisan key:generate
php artisan migrate
npm run dev
Alternatively, you can also use ./local_run.sh which will perform the above actions (with the exceptions of cd'ing into the directory or copying the .env file so you should still do that first).
NOTE: if you've made any db changes and want to reload the db you will have to remove the database/database.sqlite file before running ./local_run.sh.
And in a separate terminal run:
php artisan serve
Optionally install the React Dev Tools: https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en
Use console.log() and fn+12 to open chrome dev panel.
Similar to Python's Black, you can use run ./vendor/bin/pint
to autoformat your PHP.
- routes/web.php is the main entrypoint to define all routes and available functions.
- resources/js/Layouts/AppLayout.jsx contains the page layout and function renderNavLinks() modifies which links are available in the nav bar.
- resources/js/Pages/ contains all the separate page views (e.g. Welcome.jsx is the front page, Dashboard.jsx is what's shown when the Dashboard route is clicked etc.)
So for example, to add a new page, Foopage, which you'd like to be visible in the nav bar, you'd have to:
- Add a Foopage route in web.php (include auth middleware if that page should require user login:
Route::middleware('auth')->get('/foopage', function () { return Inertia::render('Foopage'); })->name('foopage');
- In AppLayout.jsx add the Foopage item to route mapping in renderNavLinks():
const renderNavLinks = () => (['home', 'FAQ', 'data-dictionary', 'dashboard', 'foopage'].map((routeName)...
- Add a Foopage.jsx file under resources/js/Pages/... subdirectory that contains the actual page rendering code.
When deploying to dev, make sure to also check the outcome of the associated migration job in Cloud Run > Jobs.