Update docs and support

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-11 17:03:18 +02:00
parent fdd3720639
commit fa03c48db3
5 changed files with 74 additions and 38 deletions

View File

@@ -6,19 +6,20 @@ make
```
## Manual
### Server
* Install dependencies:
* Elixir (and Erlang) by following the instructions at [https://elixir-lang.github.io/install.html](https://elixir-lang.github.io/install.html)
* Fetch backend Elixir dependencies with `mix deps.get`.
* [PostgreSQL]() with PostGIS
* Install NodeJS (we guarantee support for the latest LTS and later) ![](https://img.shields.io/badge/node-%3E%3D%2010.0+-brightgreen.svg)
* Start services:
* Start postgres
* Setup services:
* Make sure the postgis extension is installed on your system.
* Create a postgres user with database creation capabilities, using the
following: `createuser -d -P mobilizon` and set `mobilizon` as the password.
* Install packages
* Fetch backend Elixir dependencies with `mix deps.get`.
* Go into the `cd js` directory, `yarn install` and then back `cd ../`
* Setup
* Create your database with `mix ecto.create`.
* Create the postgis extension on the database with a postgres user that has
superuser capabilities: `psql mobilizon_dev`
@@ -26,23 +27,11 @@ make
``` create extension if not exists postgis; ```
* Run migrations: `mix ecto.migrate`.
* Start Phoenix endpoint with `mix phx.server`.
* Start Phoenix endpoint with `mix phx.server`. The client development server will also automatically be launched and will reload on file change.
Now you can visit [`localhost:4000`](http://localhost:4000) in your browser
and see the website (server *and* client) in action.
### Client
If you plan to specifically change the client side (front-end), do the following
once the server is running:
* Install NodeJS (we guarantee support for the latest LTS and later) ![](https://img.shields.io/badge/node-%3E%3D%2010.0+-brightgreen.svg)
* Change directory to `js/` and do:
* Install JavaScript package dependencies: `yarn install`.
* Run the development server in watch mode: `yarn run dev`. This will open a
browser at [`localhost:8080`](http://localhost:8080) that gets
automatically reloaded on change.
## Docker
You need to install the latest supported [Docker](https://docs.docker.com/install/#supported-platforms) and [Docker-Compose](https://docs.docker.com/compose/install/) before using the Docker way of installing Mobilizon.
@@ -50,4 +39,4 @@ Just run :
```bash
make start
```
to start a database container, an API container and the front-end dev container running on localhost.
to build and launch a database container and an API container running on localhost.

View File

@@ -12,11 +12,17 @@ These two commands must not return an error code, since they are required to pas
## Front-end
We use `tslint` with the `tslint-config-airbnb` preset.
Errors should be reported when running in dev mode `yarn run dev` or when building a production bundle `yarn run build`.
### Linting
We use `tslint` and `eslint` with the `airbnb` preset.
Errors should be reported when the development server is running or when building a production bundle `yarn run build`.
Please run the following command before pushing code `yarn run lint`.
This command must not return an error code, since it's required to pass inside CI.
We also try to follow the [official Vue.js style guide](https://vuejs.org/v2/style-guide/).
### Styleguide
We present the components used on Mobilizon's front-end here: https://framasoft.frama.io/mobilizon/frontend/. The documentation is builded through [Vue Styleguidist](https://vue-styleguidist.github.io/)

View File

@@ -33,4 +33,22 @@ mix test test/mobilizon/actors/actors_test.exs:85
## Front-end
Waiting for [https://framagit.org/framasoft/mobilizon/merge_requests/42](https://framagit.org/framasoft/mobilizon/merge_requests/42) to be ready.
### Unit tests
Not done yet.
### End-to-end tests
We use [Cypress](https://cypress.io) for End-to-end testing.
When inside the `js` directory, you can do either
```bash
npx cypress run
```
to run the tests, or
```bash
npx cypress open
```
to open the interactive GUI.
Cypress provided [a subscription](https://www.cypress.io/oss-plan) to their recording dashboard since Mobilizon is an Open-Source project. Thanks!