diff --git a/README.md b/README.md index 94a3239..a83f81f 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ - Java 21 - Maven 3 +- Node (nvm) +- Yarn +- Mailpit +- Mariadb / MySql First install Java 21 with a package manager and then export the correct the `JAVA_HOME`. For example, on macOS: @@ -18,16 +22,28 @@ and then export the correct the `JAVA_HOME`. For example, on macOS: export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-21.jdk/Contents/Home/ ``` +### [Building and running](#building-and-running) + +### Database and Maipit + +The `docker-compose.yaml` file in this project is meant for local development and contains a MariaDB and Mailpit instance + +```shell +docker compose up -d +``` + Then create the MySQL database: ```sql DROP DATABASE IF EXISTS access; CREATE DATABASE access CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; -CREATE USER 'access'@'localhost' IDENTIFIED BY 'secret'; -GRANT ALL privileges ON `access`.* TO 'access'@'localhost'; +CREATE USER 'access'@'%' IDENTIFIED BY 'secret'; +GRANT ALL privileges ON `access`.* TO 'access'@'%'; ``` -### [Building and running](#building-and-running) +Note: in case of an error about COLLATE, omit `COLLATE utf8mb4_0900_ai_ci` from script above + +### Access Server The access server uses Spring Boot and Maven. To run locally, type: @@ -36,11 +52,14 @@ cd server mvn spring-boot:run ``` +### Access Client + The access client uses ReactJS. To run locally, type: ```bash cd client nvm use +yarn install yarn dev ``` @@ -84,4 +103,4 @@ yarn outdated ### [Designs](#design) -https://www.figma.com/design/81StIVqfOKfwhWVjx7Ew81/SURF-Access?node-id=1916-18441&t=gmckiSapuONmLn5u-4 \ No newline at end of file +https://www.figma.com/design/81StIVqfOKfwhWVjx7Ew81/SURF-Access?node-id=1916-18441&t=gmckiSapuONmLn5u-4 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..464aa69 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +services: + mariadb: + image: mariadb:10.11 + environment: + MYSQL_ROOT_PASSWORD: secret + volumes: + - mariadb_data:/var/lib/mysql + ports: + - "3306:3306" + restart: unless-stopped + mailpit: + image: axllent/mailpit:v1.27 + ports: + - "8025:8025" + - "1025:1025" + environment: + MP_UI_AUTH: "user:password" + MP_MAX_MESSAGES: 5000 + restart: unless-stopped + +volumes: + mariadb_data: