This document will help you to configure the front and back ends of the Flipted project for team Webrew. You will need to download the AWS CLI, Node.js and Node Package Manager to run the project. The instructions for acquiring each are below. Once downloaded and configured, follow along the front and back end instructions to complete project configuration.
- While following the instructions below, be sure to install software of platform-specific version. (Windows/Linux/MacOS)
- The following setup does not depend on any IDEs or code editors. However, it's suggested to have the
prettierandeslintat hand. This will ensure uniform coding style and good code quality.
-
Download the AWS CLI version 2, follow the instructions in the docs for your specific operating system. [Installing, updating, and uninstalling the AWS CLI version 2
-
Configure your default profile to be used in the AWS CLI (This will have to be updated with each session due to time limits with AWS Educate).
a. Navigate to AWS Educate homepage and sign in.
b. Enter our classroom homepage.

c. ClickAccount Details.
d. ClickAWS CLI.
e. Execute the commandaws configure --profile <PROFILE NAME>with a profile name, ('default' is normally fine).
f. Type in the corresponding "Access Key" and "Secret Access Key" that is in theAccount Detailsinformation.
g. Type inus-east-1for default region.
h. Type injsonfor default output.
- Install
npmjsandnpm. [npm | build amazing things] - Alternative -
nvm. See more here. [Node Version Manager]
- Clone the webrew repo using this link for the front-end. [webrew]
- Run the
npm installcommand in the root of the project. - Run the
npm install -g @aws-amplify/clicommand to acquire the AWS Amplify CLI. - Create two new files, one called
.env.developmentand.env.productionin the root of your project.
# In development, add this line
REACT_APP_URI="https://yhsh20etn5.execute-api.us-east-1.amazonaws.com/dev/graphql"
# In production, add this line
REACT_APP_URI="https://ej6mrk55gd.execute-api.us-east-1.amazonaws.com/prod/graphql"
# They are currently the same since production has not been deployed.
- Run
npm startto start the project.
Please following the link for instructions.
Withint the front end repo, a workflow is setup with Github Actions. The workflow includes a series of actions, spining up a runtime environement, installing dependencies, linting coding, building the project and running test suites.
Q: How to trigger the workflow?
A: The workflow will be triggered automatically on two events,
1). any push to branches other than main.
2). any pull_request to main branch.
Q: Where do I check the output of the workflow
A: Go to the home page of the repo, and click the Actions. You will set the real time workflow log and all history logs as well. If any of the workflow fails, it should not be merged back to main branch.
Q: How does linting work?
A: We use eslint as our linting tool. Right now we are using default setting from eslint. This might be changed in future.
Q: How does testing work?
A: We use jest as our test runner and testing-library/react to write ui test cases.
- Checkout latest version from the project repo.
- Make a new feature branch and name the branch of your own choice.
- Work on the feature branch and make changes
- Push it to the remote (Github) when the work id done. Inspect the Github Actions output and fix any error if necessary.
- Deploy the feature branch with Amplify.
- Go to awseducate console and search for AWS Amplify service,
- Click "Get Started" within "Deliver" section, connect with Github
- Select the right repo and the branch you are working on, follow the next button and to save and deploy
- After the provision, build, deploy, verify progress bar turn green, then you have a dedicated version of your branch deployed, follow the link it provides and see the new changes.
Documentations
- Hosting
- AWS Amplify Pricing
- Github Actions
- actions/setup-node
- actions/checkout
- ESLint - Find and fix problems in your JavaScript Code
- Running Test
- Jest
Others
- Clone the flipped-backend repo using this link. [flipted-backend]
- Run the
npm install -g serverlesscommand. - Run the
npm installcommand. - Use the
serverless offlinecommand to test the back end offline. - When you're ready, you can deploy or redeploy with serverless deploy. To specify the stage (dev/prod), use the following
serverless deploy --stage prodorserverless deploy --stage dev.