From 9d3d952619f32c815dc8260d6f354d7daab6ee58 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Fri, 16 May 2025 14:35:17 -0700 Subject: [PATCH] Update README.md --- frontend/README.md | 49 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index 793c018..8ed2216 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,15 +1,46 @@ # Backstory web frontend -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -When building the main docker containers, this application is built and served as static content. - -To use in development, you can launch the React server: +## Development ``` -docker compose exec backstory /opt/backstory/shell -cd frontend -npm start +docker compose up frontend -d ``` -At that point, you can then connect to the server running the container on port 3000. \ No newline at end of file +The container bind mounts frontend/ into the container, and launches `npm start`. Once running, you can now access https://localhost:3000 to view the frontend. + +To monitor progress and build errors: + +``` +docker compose logs -f frontend +``` + +When you are happy with your changes and wish to deploy to production: + +1. Commit your changes: + +``` +git commit +``` + +2. Build the static deployed version: +``` +docker compose exec frontend shell ./build.sh +``` + +3. If successful, tag your version: + +``` +git tag -a "deployed-$(date +%y%m%d)" -m "Deployed on $(date)" +``` + +4. Push your changes: + +``` +git push origin main --tags +``` + +## Production + +Static production build is in `deployed`. You do not need to be running the frontend container once deployed to production. + +When you run the `build.sh` script, it first builds to `build`. If that succeeds, it then runs `rsync -avprl --delete build/ deployed/` to update the deployed static content. \ No newline at end of file