restructure README.md
This commit is contained in:
52
README.md
52
README.md
@ -1,25 +1,47 @@
|
|||||||
# Irish Rail Tracker
|
# Irish Rail Tracker
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
### Local Installation
|
### Local Emulation
|
||||||
1. Ensure you have Java 11 or greater installed.
|
#### Prerequisites
|
||||||
2. Run `npm install` in the traintracker directory.
|
- Java 11 or greater
|
||||||
3. Run `npm install` in the functions directory.
|
- `npm`
|
||||||
4. Start the emulator (needed to emulate the functions locally) `firebase emulators:start &` (the `&` forks it into the background).
|
- `firebase`
|
||||||
5. Run `npm run dev`
|
- `firebase-tools`
|
||||||
You will need to click the "Populate Database" and "Fetch Data" buttons to get data into your local version of the webapp.
|
#### Setup
|
||||||
|
1. Run `npm install` in the root directory of the project (`traintracker/`). Note that this may require root privileges on certain operating systems (i.e., to be ran with `sudo`).
|
||||||
|
2. Run `npm install` in the `traintracker/functions/` directory.
|
||||||
|
4. Start the Firebase emulator, which is needed to emulate the Firebase functions locally. Note that the Firebase emulator will occupy the focus of your terminal while it is running, so you will either need to keep it in its own dedicated terminal window or fork it into the background by appending `&` to the following command:
|
||||||
|
```bash
|
||||||
|
firebase emulators:start
|
||||||
|
```
|
||||||
|
7. Wait until the until the emulator says that it is ready before starting the web app using the following command:
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
8. A `localhost` or `127.0.0` link will appear in your terminal, navigatee to this link in a web browser to view & interact with the web app.
|
||||||
|
|
||||||
To kill the npm process do `CTRL + C` in your terminal.
|
#### Shutdown
|
||||||
To kill the firebase emulators run `fg` to bring the process to the foreground, then do `CTRL + C`
|
1. To kill the `npm` process (the webapp itself) you can simply send an interrupt signal by hitting `CTRL + C` in terminal in which it is running.
|
||||||
|
2. To kill the Firebase emulator process, you can again just simply send an interrupt signal by hitting `CTRL + C` in the terminal in which it is running **in the foreground**. Note that if you have forked the process to the background in a terminal, you will have to run the command `fg` to bring it to the foreground before hitting `CTRL + C` to kill the process.
|
||||||
### Manual Firebase Deployment
|
|
||||||
`npm run build && firebase deploy`
|
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
### Vue.js Unit Tests
|
### Vue.js Unit Tests
|
||||||
`npm run test:unit`
|
There are a series of Vue.js unit tests which are automatically ran with Github Actions when a pull request is made or when a branch is merged into `main`. Optionally, they can be ran locally via the following command:
|
||||||
|
```bash
|
||||||
|
npm run test:unit
|
||||||
|
```
|
||||||
|
|
||||||
## Firebase Integration Tests
|
### Firebase Integration Tests
|
||||||
`cd functions && npm run test`
|
There are also a series of Firebase integration tests which are automatically ran with Github Actions when a pull request is made or when a branch is merged into `main`. Optionally, they can be ran locally via the following command in the `traintacker/functions/` directory:
|
||||||
|
```bash
|
||||||
|
cd functions && npm run test
|
||||||
|
```
|
||||||
|
|
||||||
|
## Manual Firebase Deployment
|
||||||
|
The webapp is automatically deployed to Firebase via Github Actions automatically when a branch is merged into `main`, provided that it successfully passed the Vue.js unit & Firebase integration tests. It can also be manually deployed with the following command ran in the `traintracker/` directory, **but this is not to be done without explicit approval of each of the project owners**. You will need the appropriate Firebase authentication tokens to do this.
|
||||||
|
```shell
|
||||||
|
npm run build && firebase deploy
|
||||||
|
```
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
Deployed Site: [irishrailtracker.web.app](https://irishrailtracker.web.app/)
|
Deployed Site: [irishrailtracker.web.app](https://irishrailtracker.web.app/)
|
||||||
|
Reference in New Issue
Block a user