Skip to content

Latest commit

 

History

History
69 lines (37 loc) · 1.47 KB

instructions.md

File metadata and controls

69 lines (37 loc) · 1.47 KB

Instructions

  1. Install JDK

sudo apt-get install openjdk-8-jdk

  1. Set $JAVA_HOME in PATH. For example open .bashrc from home folder and add these lines:

export JAVA_HOME=<path to java>

export PATH=$JAVA_HOME/bin:$PATH

  1. Install maven

sudo apt-get install maven

  1. Add this line to .bashrc aswell

export PATH=<maven path>:$PATH

  1. Install postgreSQL

sudo apt-get install postgresql postgresql-client

  1. Launch postgreSQL from terminal

sudo su - postgres -c 'psql'

  1. Run this commad in postgreSQL UI

CREATE DATABASE "Dlearn_db";

  1. Run this commad in postgreSQL UI

ALTER USER postgres WITH PASSWORD 'admin';

  1. Run this command from backend root. Use password admin

psql -U postgres -W -h localhost -d "Dlearn_db" -f database/db.sql

  1. Add some data to the database

\connect Dlearn_db

INSERT INTO "Students" (username, pwd, gender, age) VALUES ('student', '$2a$16$pdcURh3hIwiiCvkiU8zwLOCfNR3h/R2WuCTonoRBRZHry7/4.m5Hm', 'Male', 18);

INSERT INTO "Teachers" (lastname, firstname, username, pwd) VALUES ('Test', 'Teacher', 'teacher', '$2a$16$pdcURh3hIwiiCvkiU8zwLOCfNR3h/R2WuCTonoRBRZHry7/4.m5Hm');

INSERT INTO "Researchers" (username, pwd) VALUES ('researcher', '$2a$16$pdcURh3hIwiiCvkiU8zwLOCfNR3h/R2WuCTonoRBRZHry7/4.m5Hm');

  1. Install maven dependencies

mvn clean install

  1. Create jar file

mvn jar:jar

  1. Run the jar file

java -jar target/dependency/webapp-runner.jar target/*.war

  1. Finally

Have fun! 😄