yarn install
to install all project dependencies.yarn start
: Start the local development server.
yarn build
: Build the application bundle using parcel-bundler to the build
folder that is ready to be published to the web.
yarn transfer
: Transfers the built app (from yarn build
) to SEASnet to be served from mentorship.seas.ucla.edu. This is currently authenticated through Simon Zhou's SEASnet account so you'll need his SEASnet password to authorize this action.
yarn deploy
: Runs yarn build
then yarn transfer
I've only listed files/directories that are particularly important to understanding the overall project
config/
webpack.config.dev.js
webpack.config.prod.js
public/
scripts/
src/
components/
pages/
HomePage/
StaffPage/
views/
app.js
index.js
There is a three-tiered hierarchy of React components, in order from smallest to largest.
src/app.js
default exports a Switch
component that routes between the site's pages, which are exported as { pages }
from src/app.js
as well. As such, the following import is possible.import App, { pages } from 'app'
src/index.js
imports the Switch
from src/app.js
and renders it into the DOM
The contents of a page directory should be absolutely minimal. For example, src/pages/HomePage
should be limited to:
import
statements relative to the project entry folder, meaning that no matter which file you are in, you can write clean imports like:import Foo from '/components/Foo'
instead of
import Foo from '../../../../components/Foo'