...
- The Server side code:
- Repository: User-API
- Python django app, using django rest framework. There is only one special thing about it is that we add ukrdc_session and jtrace_session to request object. Both of them commit/rollback after request is finished. UKRDC3 and JTRACE settings are defined in the settings module and appropriate environment file (staging.py for staging, development.py for dev, etc.)
- The Client side code:
- Repository: User-Client
- Angular app. Having several modules - viewer, errorbrowser... , Workitems module is in the main app, but should be split into separate module.
TODO: Expand on how the both code bases work.
Deployment for Production/Testing
Deploying the complete UKRDC UI web app requires both the user-client code and the user-api code
Gliffy | ||||||||
---|---|---|---|---|---|---|---|---|
|
The user-api code is run on a GUNICORN server on localhost which uses a NGINX server as a Reverse Proxy, whilst the user-client code is compiled and served directly by the NGINX server.
To deploy user-client code call the Build.sh file from where your:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
. Build.sh |
This creates a directory in the dist folder called app which contains the compiled front end code.
There should be a /var/www folder where the app folder needs to be copied to after renaming or deleting the existing folder(if any).
Make sure that in the Index.html file the `<base>` tag looks like this in the `<head>` element:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<base href="/app/"> |
The application will fail to load in the browser if it does not reference the folder the rest of the compiled code is in, and you may get error messages in the console e.g. A permission error as the location cannot.