Skip to content

Commit

Permalink
docs: user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
mjaquiery committed Jun 26, 2024
1 parent f508425 commit 093ea71
Show file tree
Hide file tree
Showing 11 changed files with 365 additions and 46 deletions.
2 changes: 1 addition & 1 deletion docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ WORKDIR /etc/
RUN mkdir /source
RUN mkdir /build

RUN pip install sphinx-autobuild sphinx-rtd-theme
RUN pip install sphinx-autobuild sphinx-rtd-theme sphinxcontrib-images

CMD sphinx-autobuild -b html --host 0.0.0.0 --port 80 /source /build
75 changes: 75 additions & 0 deletions docs/source/DeploymentGuide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
######################################################################################
Getting started
######################################################################################

The Galv Frontend is a `React <https://reactjs.org/>`_ application.
It interfaces with an instance of the
`Backend REST API <https://galv-team.github.io/galv-backend>`_.
If you are setting up a new instance of Galv, you will need to set up both the Frontend and the Backend.
You should set up the Backend first, as the Frontend will not work without it.

Once you have the Backend in place, you can set up the Frontend by following the instructions below.

**************************************************************************************
Deploying
**************************************************************************************

Deploying with ``fly.io``
=======================================================================================

The simplest way to deploy Galv is to use `fly.io <https://fly.io/>`_.
Fly.io is a platform that allows you to deploy Docker containers to a global network of servers.

You'll need to sign up for an account and install the fly.io CLI tool.
Next, you can create an app by opening a terminal in the root of the Galv Frontend repository and running:

.. code-block:: shell
flyctl deploy
This will provide a walkthrough to set up the app.
You may need to do additional configuration on the fly.io website
as per the instructions provided by the fly.io CLI tool.

Once the app is created on fly.io, you can edit the ``fly.toml`` file to set
details of the deployment.

Importantly, you will need to provide the ``build.arg`` variable ``VITE_GALV_API_BASE_URL``.
This should be the fully-qualified domain name of the Galv Backend API, e.g. ``https://my-galv-backend.fly.dev``.
This is what Galv will use to make requests to the Backend.

On a related note, the Backend API needs to have the ``FRONTEND_VIRTUAL_HOST``
environment variable set to the fully-qualified domain name of the Frontend,
e.g. ``https://my-galv-frontend.fly.dev``.


Deploying with ``docker``
=======================================================================================

You can deploy Galv on your own server, or on a cloud provider such as AWS, Azure, or Google Cloud
using ``docker``.

Galv's Frontend has a ``Dockerfile`` that can be used to build a Docker image.
This builds the Frontend and serves it using `nginx <https://www.nginx.com/>`_.
Building the image requires the build argument ``VITE_GALV_API_BASE_URL`` to be set to the
fully-qualified domain name of the Galv Backend API, e.g. ``https://my-galv-backend.example.com``.

Build the image with

.. code-block:: shell
docker build -t galv-frontend --build-arg VITE_GALV_API_BASE_URL=https://my-galv-backend.example.com .
You can then run the image with

.. code-block:: shell
docker run -p 80:80 galv-frontend
**************************************************************************************
Setting up the Frontend
**************************************************************************************

Once the Frontend is deployed, it should be connected to the Backend and inherit all
of the configuration you've done there.
You should be able to log in with your user account and start using Galv.
Loading

0 comments on commit 093ea71

Please sign in to comment.