diff --git a/README.md b/README.md index 3a88ae4..937ffea 100644 --- a/README.md +++ b/README.md @@ -6,23 +6,18 @@ --- -- [Links](#links) - [Installation](#installation) -- [Start](#start) + - [Installation for development](#installation-for-development) + - [Installation for production](#installation-for-production) +- [Start the development server](#start-the-development-server) - [Project structure](#project-structure) +- [Stable version](#stable-version) +- [Deploying](#deploying) - [Visual Studio Code](#visual-studio-code) - [Scripts](#scripts) - [Gnerate a new React component](#gnerate-a-new-react-component) -- [Add a TODO](#add-a-todo) -- [Pre-commit hooks](#pre-commit-hooks) -- [Extensions](#extensions) - ---- - -## Links - -- [TODOS](./todos.md) -- [IDEAS](./ideas.md) +- [Git hooks](#git-hooks) +- [Packages and tools](#packages-and-tools) --- @@ -51,7 +46,7 @@ npm run prepare 5. Check the `.env.development` file and make sure all the variables are set correctly. -6. [Start the frontend development server](#start). +6. [Start the frontend development server](#start-the-development-server) ### Installation for production @@ -80,7 +75,7 @@ npm run build --- -## Start +## Start the development server To start the frontend development server run: @@ -88,9 +83,13 @@ To start the frontend development server run: npm run start ``` -This script will make preparations to start the newest version. +This script will make preparations to start the frontend development server: -_Check the console for instructions!_ +- Check if the backend server is running (_if not it will warn you_) +- Creates the table structure in the backend server (_if not already created_) +- Start the frontend development server and opens the browser + +**_Check the console for instructions!_** > Note that also the backend server should be running. Otherwise the frontend will not work correctly. See [here](https://github.com/lw86ruwo/wannadbBackend) for more information. @@ -98,7 +97,11 @@ _Check the console for instructions!_ ## Project structure -- **[scripts](scripts)** - Scripts for the project +- **[.github](.github)** - GitHub related files + - **[workflows](.github/workflows)** - GitHub actions workflows +- **[.husky](.husky)** - Git hooks managed by husky +- **[.vscode](.vscode)** - Visual Studio Code settings +- **[scripts](scripts)** - Scripts for development - **[src](src)** - The source code - **[assets](src/assets)** - The assets - **[audio](src/audio)** - The audio files @@ -113,6 +116,38 @@ _Check the console for instructions!_ --- +## Stable version + +To manage stable versions of the frontend, a separate branch `stable` is used. When you have a stable version of the frontend, you can merge it into the `stable` branch. This will ensure that in the stable branch is always a version of the frontend that is working. + +To create a new stable version, you have the following options: + +- Run the `Create New Stable Version (Manual)`workflow: + - Go to the `Actions` tab on GitHub + - Select the `Create New Stable Version (Manual)` workflow + - Open the `Run workflow` dropdown + - Click on the `Run workflow` button again +- Run the `Create New Stable Version (Push)` workflow: + - Create a commit with the message containing `[stable]` and push it to the `main` branch. This will trigger the `Create New Stable Version (Push)` workflow and create a new stable version. + +> The same concept applies to the backend and makes sure (when you have done it correctly) that the stable versions of the frontend and backend are always compatible and stable. + +--- + +## Deploying + +To deploy a new version of the frontend you can run the `scripts/deploy.sh` script. This script will update the frontend and backend to the latest version. + +You can specify from which branch you want to deploy from via the `-b`flag. E.g. When you want to the newest version from the `stable` branch you can run: + +```bash +./scripts/deploy.sh -b stable +``` + +_**Note:**_ This script will only work if the frontend is in the directory `/home/wannadb/frontend` on the server and the backend is in the directory `/home/wannadb/backend` on the server. To change this you have to modify the environment variables in the script. + +--- + ## Visual Studio Code **I recommend using [Visual Studio Code](https://code.visualstudio.com/) as your IDE.** @@ -127,12 +162,12 @@ In the [.vscode](.vscode) folder you can find some settings in the [settings.jso Run a script with: ```bash -npm run