Skip to content

Developer setup

François Poguet edited this page Feb 26, 2021 · 40 revisions

Requirements

  • NodeJS (at least > v14)
  • MariaDB > v10.4
  • Git
  • Bash (or equivalent) to run the git hooks

Git hooks

We use some githooks to automate some tasks: format & lint code, run tests, update API documentation. Install them in your local repository with ./githooks/setup-hooks.sh. This requires to have the API repository cloned next to the main repository

$ ls -l MAIN_FOLDER
glowing-octo-guacamole/
guacamole-api-docs/
wiki/
[... other files]

Create the database

CREATE USER 'glowing-octo-guacamole'@'localhost' IDENTIFIED BY 'p@ssword';
CREATE DATABASE glowingOctoGuacamoleDev;
GRANT ALL PRIVILEGES ON glowingOctoGuacamoleDev.* TO 'glowing-octo-guacamole'@'localhost';

# Also create the database for tests
CREATE DATABASE gogTest;
GRANT ALL PRIVILEGES ON gogTest.* TO 'glowing-octo-guacamole'@'localhost';

Insert test data in the database with the scripts in ./server/test/required_data/*.sql. Note that the database is emptyied after each test.

Run development server

You can use nodemon to auto-reload the server on changes. For the client, use npm run start to start the Create-React-App script, which is watching the changes by default

Clone this wiki locally