This setup guide will walk you through the prerequisites needed for the workshop. This setup process is crucial to ensure the remaining exercises function as expected.
-
Install dependencies
yarn
-
Generate a secret.
yarn rw g secret
-
Copy the secret from the previous step and add it to your
.env
at the root of this00-setup
directory as theSESSION_SECRET
. Your.env
file should look similar to the following:SESSION_SECRET=VALUE_FROM_PREVIOUS_STEP
-
Apply the database schema to your database.
yarn rw prisma migrate dev
-
Seed the database with Spotify data.
yarn rw prisma db seed
NOTE: If you'd like to customize the user or device information for the workshop, see the workshop customization section for more information.
-
Start the app
yarn rw dev
If everything works as expected, you should see a home screen with the contents of this README. You may continue these instructions in the browser or proceed to log into the app. Logging in will ensure your database is setup correctly. Once logged in, you should see a grid of albums along with the "RedwoodJS Conf 2023" playlist in the sidebar.
You can personalize the workshop app by modifying the workshop.config.toml
file at the root of this setup directory. This step is not required, though highly encouraged to get the most of your experience.
This configuration allows you to set your display name, avatar, and device information used for playback. Feel free to tweak these settings at any time throughout the workshop. Just be sure to apply your changes when doing so.
Changes to the workshop.config.toml
file can be applied by running the seed script.
yarn rw prisma db seed
NOTE: You may execute the seed script as often as you'd like. The data will be updated to match any change applied to
workshop.config.toml
.
You can customize your user information displayed in the user menu. Changes to your user information is done under the [user]
table header.
To change your display name, update the displayName
property in the [user]
table. By default this will be "RedwoodConf Attendee".
[user]
displayName = "RedwoodConf Attendee"
To customize your avatar, add a png
image to web/public/avatar.png
. By default, the web/public/defaultAvatar.png
will be used. Adding this file will require you to apply changes to the database by running the seed script, otherwise the default avatar will be displayed.
To replicate the Spotify UI, the app displays a device for playback. Changes to the playback device is done under the [device]
table header.
To change the name of the device, update the name
property in the [device]
table. By default this will be "My Computer".
[device]
name = "My Computer"
The change the type of the device, update the type
property in the [device]
table. By default this will be "computer". Valid values are computer
, smartphone
and speaker
.
[device]
type = "computer"
If you haven't done so already, log into the app to check that everything is working. And with that, you're all set 🎉🔥! I truly hope that you enjoy this workshop!
The work performed here will be used by each exercise. Each exercise will link to the database, workshop.config.toml
, and the .env
files in this directory. This should be done for you automatically. If you start an exercise and files don't seem to link correctly, run the setup
script to see if it resolves the issue.
yarn rw exec setup