Prerequisites:
- Node.js 12
- Yarn (
npm install -g yarn
)
-
Install the dependencies
yarn install
-
Run the development server
yarn dev
Now your app is available at http://localhost:3000
. Keep in mind that you should have the server (or services) running for the
app to work appropriately.
- Build the app
REACT_APP_BASE_API_URL=http://urlToYourDeployedCampsiteApi.com:port yarn build
- Go to
https://aws.amazon.com/console/
and sign in. - Click Services (in the upper top corner) and choose S3.
- Click Create bucket
- In Bucket name field enter your bucket name, for example
campsite-ui
. You can change the region if you want . Click next. - Click Next.
- Uncheck Block all public access and check I acknowledge that .... Click next.
- Click Create bucket
- Click on the created bucket's link (in our case it's
campsite-ui
). - Click Upload
- Open the
build
directory we've created during the 2nd step, which is inpackages/ui/build
- Drag all the files from the
build
directory onto the Upload page and click Upload. - Click Properties.
- Click Static website hosting box.
- Check Use this bucket to host a website, type index.html into the index.html placeholder and click save.
- Click Overview, select all the files by clicking the first box, click Actions and then Make public, and click the Make public button.
Your ui
page has been deployed! Now you can click the index.html
link, and there's a field Object URL
with
the
link to your website (in our case it's https://campsite-ui.s3.eu-central-1.amazonaws.com/index.html
). Click it and
see your results! Remember, we gotta have the backend running as
well for the
application to run properly.