2020-08-22 22:23:39 +02:00
|
|
|
|
# Redaktions App
|
|
|
|
|
|
2021-05-29 00:00:10 +02:00
|
|
|
|
The "Redaktions App" or editor's app is the main gateway for editors and candidates to alter the database, e.g. adding
|
|
|
|
|
new questions (editors) and answering them (candidates).
|
2020-08-22 22:23:39 +02:00
|
|
|
|
|
|
|
|
|
## Development
|
|
|
|
|
|
|
|
|
|
The app is written in typescript and react and uses apollo to query the backend and as a local store.
|
|
|
|
|
|
|
|
|
|
### Setup
|
|
|
|
|
|
2021-01-09 12:32:17 +01:00
|
|
|
|
- Install `npm`
|
|
|
|
|
- In this directory run `npm ci` to install all dependencies according to the package.json and package-lock.json.
|
2020-08-22 22:23:39 +02:00
|
|
|
|
|
2020-08-23 15:18:20 +02:00
|
|
|
|
### Develop locally
|
|
|
|
|
|
2021-01-09 12:32:17 +01:00
|
|
|
|
- In the parent directory run
|
2020-08-23 15:18:20 +02:00
|
|
|
|
```shell script
|
|
|
|
|
docker-compose up
|
|
|
|
|
```
|
2021-05-29 00:00:10 +02:00
|
|
|
|
which will start the whole setup including this app in a dockerfile. However, rebuilding and restarting this image can
|
|
|
|
|
be cumbersome and is not necessary in the development setup.
|
2021-01-09 12:32:17 +01:00
|
|
|
|
- Instead run
|
2020-08-23 15:18:20 +02:00
|
|
|
|
```shell script
|
|
|
|
|
npm start
|
|
|
|
|
```
|
|
|
|
|
and access the app at [http://localhost:3000](http://localhost:3000).
|
|
|
|
|
|
|
|
|
|
#### Available Scripts
|
2019-08-31 19:17:03 +02:00
|
|
|
|
|
|
|
|
|
In the project directory, you can run:
|
|
|
|
|
|
2020-08-23 15:18:20 +02:00
|
|
|
|
##### `npm start`
|
2019-08-31 19:17:03 +02:00
|
|
|
|
|
|
|
|
|
Runs the app in the development mode.<br>
|
|
|
|
|
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
|
|
|
|
|
|
|
|
|
The page will reload if you make edits.<br>
|
|
|
|
|
You will also see any lint errors in the console.
|
|
|
|
|
|
2021-05-29 00:00:10 +02:00
|
|
|
|
Running the app without the backend server makes little sense. Start it
|
|
|
|
|
under [http://localhost:5000](http://localhost:5000) as specified in the Readme of the backend server (../backend)
|
2019-09-17 23:48:44 +02:00
|
|
|
|
|
2020-08-23 15:18:20 +02:00
|
|
|
|
##### `npm test`
|
2019-08-31 19:17:03 +02:00
|
|
|
|
|
|
|
|
|
Launches the test runner in the interactive watch mode.<br>
|
2021-05-29 00:00:10 +02:00
|
|
|
|
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more
|
|
|
|
|
information.
|
2019-08-31 19:17:03 +02:00
|
|
|
|
|
2020-08-23 15:18:20 +02:00
|
|
|
|
##### `npm run build`
|
2019-08-31 19:17:03 +02:00
|
|
|
|
|
|
|
|
|
Builds the app for production to the `build` folder.<br>
|
|
|
|
|
It correctly bundles React in production mode and optimizes the build for the best performance.
|
|
|
|
|
|
|
|
|
|
The build is minified and the filenames include the hashes.<br>
|
|
|
|
|
Your app is ready to be deployed!
|
|
|
|
|
|
|
|
|
|
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
|
|
|
|
|
2020-08-23 15:18:20 +02:00
|
|
|
|
##### `npm run eject`
|
2019-08-31 19:17:03 +02:00
|
|
|
|
|
|
|
|
|
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
|
|
|
|
|
|
2021-05-29 00:00:10 +02:00
|
|
|
|
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will
|
|
|
|
|
remove the single build dependency from your project.
|
2019-08-31 19:17:03 +02:00
|
|
|
|
|
2021-05-29 00:00:10 +02:00
|
|
|
|
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right
|
|
|
|
|
into your project so you have full control over them. All of the commands except `eject` will still work, but they will
|
|
|
|
|
point to the copied scripts so you can tweak them. At this point you’re on your own.
|
2019-08-31 19:17:03 +02:00
|
|
|
|
|
2021-05-29 00:00:10 +02:00
|
|
|
|
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you
|
|
|
|
|
shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t
|
|
|
|
|
customize it when you are ready for it.
|