Skip to content

tinit03/fullstack_backend

Repository files navigation

ShopIT

ShopIT is an application designed for gathering sellers and buyers into a common marketplace. Use ShopIT to explore what other people around Norway are selling, or find buyers for your niche merchandise. This repository serves as the server for the application.

🚀 Getting started

Requirements

To run the server, you need the following installed:

  • Java 21
  • Maven
  • Docker

⚙ Setup

The following setup is mandatory for running the server.

To run the project you need to have an application-secret.yml file to store all the secret keys, credentials and config properties. Some of the properties are API-keys used to f.ex use cloud image services or retrieve postal information and thereby must be kept secret for security reasons.

However, the ZIP file containing the project files should already contain this file.

🚗 Running the server

  1. Clone the repository
git clone [email protected]:tinit03/fullstack_backend.git

If you don't have SSH keys use:

git clone https://github.com/tinit03/fullstack_backend.git
  1. Navigate to the project root folder
cd fullstack_backend
  1. Build the server image (OBS: Make sure docker is running). This step will take some time.
docker build -t <image-name>:latest .
  1. Run the server (OBS: Make sure docker is running).
docker run -rm <image-name>:latest -p 8080:8080

Example:

docker build -t myapp:latest .
docker run -rm myapp:latest -p 8080:8080

The server is now running on port 8080.

Exiting the application

To exit the application, use CTRL+C.

🧪 Test data

The database is populated with three pre-configured users in LoadData.java . You can log in with the following credentials:

User 1

User 2

User 3

📋 Running tests

You can run unit and integration tests with:

mvn verify

This will generate a target folder with test coverage data. You can now find the report by navigating the folder structure: target -> site -> jacoco -> index.html.

This will open a page similar to this: img.png

To only run unit tests run:

mvn test

Accessing the database

To log into the database, paste this URL into your browser

localhost:8080/h2-console

Change the JDBC URL field to

jdbc:h2:mem:testdb

Credentials:

- Username: sa
- Password:  
(no password)

🗎 Documentation

REST endpoints

The REST endpoints are documented using Swagger UI. The documentation is generated at runtime and can be found here while the application is running.

Source code

The entire backend source code has been documented with Javadoc.

Group members

ShopIT was developed by a team of three students:

  • Tini Tran
  • Vilde Min Vikan
  • Harry Xu

About

IDATT2105 backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages