This is the repository that holds the web client for Mee Panyar.
- For the associated backend repository, go to: https://github.com/calblueprint/meepanyar-node
- Documentation hub: https://github.com/calblueprint/meepanyar/wiki
-
Clone Repository a. Click on the green
Codebutton and copy the https URL in the dropdown b. In your terminal, cd to the desired directory and dogit clone {COPIED URL} -
Setting Up Environment Variables For security reasons, this project uses secrets that are passed via environment variables held in a
.envfile. You will create and set up your.envfile in the following steps. a. In the top level directory (where.env.exampleis located), create a copy of.env.exampleand rename the copied file.env. b. Fill out the environment variables with their appropriate values in the.envfile. TheREACT_APP_AIRTABLE_ENDPOINT_URLshould point to the URL where themeepanyar-nodeserver is located. c. You may locate yourREACT_APP_AIRTABLE_BASE_IDby going to https://airtable.com/api and clicking on the appropiate Airtable base to use.For example, if your launched
meepanyar-nodeserver is onlocalhost:4000, which is the default, your.envfile could look like the following:AIRTABLE_EMAIL=my_airtable_email@berkeley.edu AIRTABLE_PASSWORD=my_airtable_password REACT_APP_AIRTABLE_BASE_ID=my_airtable_base_id REACT_APP_AIRTABLE_ENDPOINT_URL=http://localhost:4000 -
Running the development environment
- Since the web client relies on the
meepanyar-nodebackend server, make sure that an instance ofmeepanyar-nodeis running and that the environment variableREACT_APP_AIRTABLE_ENDPOINT_URLin the.envfile points to it. Local setup instructions for themeepanyar-nodeserver can be found at the repo here - run
npm installto install the dependencies necessary to run the app. - Start the web client by running
npm startin the terminal while in the root directory (where thepackage.jsonfile is located)
- Since the web client relies on the
-
Running the production environment (Not usually necessary for standard develop)
A production build must be used to test offline functionality of the app. This is because service workers, which control the app logic when offline, are only active in the production build. This section will list how to create and run a production build of the app locally.
- As with the development environment, a working
meepanyar-nodebackend must be running. Do step 3i (Running the development environment) - run
npm installto install the dependencies necessary to run the app. - In the root directory, run
npm run buildto create the production build for the app. This command creates abuild/folder that contains the production build for the app. - Run the production build by running
serve -s buildin the root directory
Note: if you get an error when running 4iv, you may need to install
servevianpm install -g serve. - As with the development environment, a working
This app uses the Airtable Schema Generator to generate boilerplate Airtable CRUD functions. When the Airtable base's schema is changed (tables or columns are added or deleted), the schema must be regenerated. You can regenerate the airtable by following the steps:
- In your
.envfile make sure theAIRTABLE_EMAIL,AIRTABLE_PASSWORD, andREACT_APP_AIRTABLE_BASE_IDare populated. - Run
npm run generate-schemain the root directory. - Apply the patches located in
src/lib/airtable/patches. Instructions to apply patches are located in a README.md file in the patches directorysrc/lib/airtable/patches/README.md. NOTE: These patches are needed to fix grammar mistakes in CRUD naming convention and adjust functions for offline functionality in the app