Update docs

This commit is contained in:
Adrien Pavie
2023-06-14 15:21:31 +00:00
committed by Jean Andreani
parent 1e509c48c2
commit c5f9a6da06
13 changed files with 199 additions and 86 deletions

29
docs/01_Start.md Normal file
View File

@@ -0,0 +1,29 @@
# GeoVisio Website hands-on guide
![GeoVisio logo](https://gitlab.com/geovisio/api/-/raw/develop/images/logo_full.png)
Welcome to GeoVisio __Website__ documentation ! It will help you through all phases of setup, run and develop on GeoVisio Website.
__Note that__ this only covers the Website / front-end component, if you're looking for docs on another component, you may go to [this page](https://gitlab.com/geovisio) instead.
Also, if at some point you're lost or need help, you can contact us through [issues](https://gitlab.com/geovisio/website/-/issues) or by [email](mailto:panieravide@riseup.net).
## Architecture
The website relies on the following technologies and components:
- Frontend website made in [Vue 3](https://vuejs.org/guide/introduction.html)
- Project use [Vite](https://vitejs.dev/guide/) who offer a fast development server and an optimized compilation for production (like webpack)
- The style is made with CSS/SASS and the [bootstrap library](https://getbootstrap.com/)
- [Typescript](https://www.typescriptlang.org/) used to type
- [Jest](https://jestjs.io/fr/) used for unit testing
## All the docs
You might want to dive into docs :
- [Install and setup](./02_Setup.md)
- [Change the settings](./03_Settings.md)
- [Work on the code](./09_Develop.md)

46
docs/02_Setup.md Normal file
View File

@@ -0,0 +1,46 @@
# Setup
## System requirements
**You need to have [Nodejs installed](https://nodejs.org/en/download)**
Node version : >=18.13.0
**You need to have [Npm installed](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)**
You can use npm or [yarn](https://yarnpkg.com/) as package manager
## Install
The website can be installed locally by retrieving this repository and installing dependencies:
```sh
# Retrieve source code
git clone https://gitlab.com/geovisio/website.git
cd website/
# Install dependencies
npm install
```
## Build for production
Before building, you need to define a bit of settings. At least, you have to create a `.env` file and edit its content.
```sh
cp env.example .env
```
More details about settings [can be found in docs here](./03_Settings.md).
Then, building for production can be done with these commands:
```sh
npm run build
PORT=3000 npm run start
```
The website is now available at [localhost:3000](http://localhost:3000).
## Next steps
You can check out [the available settings for your instance](./03_Settings.md).

43
docs/03_Settings.md Normal file
View File

@@ -0,0 +1,43 @@
# Settings
Many things can be customized in your GeoVisio Website.
## Basic settings
Low-level settings can be changed through the `.env` file. An example is given in `env.example` file.
Available parameters are:
- `VITE_API_URL`: the URL to the GeoVisio API (example: `https://geovisio.fr`)
- Settings for the work environment:
- `NPM_CONFIG_PRODUCTION`: is it production environment (`true`, `false`)
- `YARN_PRODUCTION`: same as below, but if you use Yarn instead of NPM
- `VITE_ENV`: `dev`
More settings are available [in official Vite documentation](https://vitejs.dev/guide/env-and-mode.html#env-files)
Note that you can also change the _Vite_ server configuration in the `vite.config.ts` file. See [Vite Configuration Reference](https://vitejs.dev/config/) if you need.
## Wording customization
GeoVisio website can be customized to have wording reflecting your brand, licence and other elements.
All the wordings of the website are on this [locale file](./src/locales/fr.json). In there, you might want to change:
- The website title (properties `title` and `meta.title`)
- The description (property `meta.description`)
- The used API URL (property `pages.upload.terminal_text`)
- Links to help pages:
- `upload.description`
- `upload.footer_description_terminal`
## Visuals
The following images can be changed to make the website more personal:
- Logo: [`src/assets/images/logo.jpeg`](../src/assets/images/logo.jpeg)
- Favicon: [`static/favicon.ico`](../static/favicon.ico)
## Next steps
You may be interested [in developing on the website](./09_Develop.md).

43
docs/09_Develop.md Normal file
View File

@@ -0,0 +1,43 @@
# Work on the code
## Available commands
Note that all the commands and packages used are available in the `package.json` file.
### Compile and Hot-Reload for Development
Launch your dev server :
```sh
npm run dev
```
or
```sh
yarn dev
```
### Run Unit Tests with [Vitest](https://vitest.dev/)
```sh
npm run test:unit
```
or
```sh
yarn test:unit
```
### Lint with [ESLint](https://eslint.org/)
```sh
npm run lint
```
or
```sh
yarn lint
```