Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

pnicto/CSF213-Mini-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSF213 Mini Project

NOTE: Archived as evalutation is over

Mid semester evaluation

Making UML diagrams for backend and frontend.

End semester evaluation

Working site

Running the backend

Have Java 17, postgresql installed. Create a database named silkroad in psql.

  1. Clone the git repo
  2. In src/main/resources/ create a folder named certs. Now cd into the certs folder and run the following commands.
    openssl genrsa -out keypair.pem 2048
    openssl rsa -in keypair.pem -pubout -out public.pem
    openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in keypair.pem -out private.pem
  3. In src/main/resources/ rename application.properties.example to application.properties, Open application.properties and fill out the blank fields.
  4. In the root directory, run ./mvnw spring-boot:run or you can use the spring boot dashboard extension in VSCode to run.

Running the frontend

Have yarn(preferable) or npm installed.

  1. Clone the git repo.
  2. cd into the frontend folder.
  3. Run yarn to install the dependencies.
  4. Run yarn dev to start it.

Steps to make UML diagrams with plantuml

  1. Have VSCode.
  2. Install this extension VSCode plantuml.
  3. Install plantuml. Follow either the local render or server render method.Instructions. I use the server render method specifically the third one with picoweb.
  4. Add these settings in VScode settings json file. Can be accessed with Ctrl + Shift + P

Command Palette

  "plantuml.diagramsRoot": "docs/src",
  "plantuml.exportOutDir": "docs/",
  "plantuml.exportOutDir": "docs/diagrams/out",
  "plantuml.server": "http://192.168.1.100:8080",
  "plantuml.render": "PlantUMLServer"
  1. Open Backend.wsd in ./docs/diagrams/src/ directory.
  2. Open the preview of the file by using Alt + D
  3. Refer this to make the UML diagrams.

Working with the backend

We are using Java 17 so install it.

  1. Clone the git repo.

  2. Checkout to a new branch named with the feature you want to work on. Use the command center( Ctrl + Shift + P and search for Git:Checkout to ...) in VSCode.

  3. Download postgresql.

    Linux

    • Follow this link for instructions.
    • TLDR of the link after installing using your respective package managers. While creating user create with the same name as your linux username.
    sudo -iu postgres
    sudo systemctl enable --now postgresql.service
    createuser --interactive
    createdb dataBaseNameSameAsTheAboveUserName
    psql

    Windows

    • Watch this video. I am not sure about windows, contact Pranav for troubleshooting.
  4. After having your postgresql setup done. Install Extension Pack for Java and Spring Boot Extension Pack extensions on VSCode.

  5. Go to the psql shell by typing psql or psql -U postgres and create a new using

     CREATE DATABASE silkroad;
  6. In src/main/resources create a file named application.properties and add the following lines.

     spring.datasource.url=jdbc:postgresql://localhost:5432/silkroad
     spring.datasource.username=
     spring.datasource.password=
     spring.jpa.hibernate.ddl-auto=create-drop
     spring.jpa.show-sql=true
     spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
     spring.jpa.properties.hibernate.format_sql=true
     server.error.include-message=always
    

    Add the username and password.

Working with frontend

  1. cd into the frontend folder and run yarn.
  2. Create a .env file similar to .env.example.
  3. yarn dev will run the project.

Hopefully one day I'll come back to this make few more changes.