From 4044a19c4c941d4603c9e207d62a882c43edae8d Mon Sep 17 00:00:00 2001
From: Hemanthr1 <142207513+Hemanthr1@users.noreply.github.com>
Date: Fri, 16 Aug 2024 17:52:13 +0530
Subject: [PATCH] Updated backend README.md
---
backend/README.md | 98 +++++++++++++++++++++++++++++++++++++++++------
1 file changed, 87 insertions(+), 11 deletions(-)
diff --git a/backend/README.md b/backend/README.md
index 7a84392..330bc53 100644
--- a/backend/README.md
+++ b/backend/README.md
@@ -7,13 +7,14 @@ Welcome to the Quash Backend repository, part of the [Quash](https://quashbugs.c
-| **Reporting** 🗒️ | **Resolution** ✅ | **Collaboration** 🤝🏻 |
-| :--------: | :---------: | :---------: |
+| **Reporting** 🗒️ | **Resolution** ✅ | **Collaboration** 🤝🏻 |
+| :---------------------------------------------: | :-----------------------------------------------: | :-------------------------------------------------: |
| Raise comprehensive tickets with minimal effort | Know exactly where the bug is - and how to fix it | Manage all your testing workflows in a single place |
---
## Table of Contents
+
- [Project Architecture](#project-architecture)
- [Installation](#installation)
- [Configuration](#configuration)
@@ -34,50 +35,73 @@ The project is structured into the following layers:
## DB Schema
+
## Report Generation Flow
+
This guide will provide you steps to setup and configure the Backend for Quash.
Quash Backend is built using the following technologies:
+
+## Technologies Used
+
+[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-6DB33F?logo=springboot&logoColor=white)](https://spring.io/projects/spring-boot)
+[![MongoDB](https://img.shields.io/badge/MongoDB-47A248?logo=mongodb&logoColor=white)](https://www.mongodb.com/)
+[![JWT](https://img.shields.io/badge/JWT-black?logo=JSON%20web%20tokens&logoColor=white)](https://jwt.io/)
+[![Maven](https://img.shields.io/badge/Maven-C71A36?logo=apachemaven&logoColor=white)](https://maven.apache.org/)
+
- [Spring Boot](https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html#getting-started.installing)
- [MongoDB](https://www.mongodb.com/docs/manual/installation/)
- Maven
- JWT Authentication
# Installation
+
+If you want to quickly run backend with docker, refer to the step for [Running with Docker](#running-with-docker)
+
+Move to your workspace
+
```bash
-# Move to your workspace
cd your-workspace
+```
+
+Clone the parent repository
-# Clone the parent repository
+```bash
git clone https://github.com/Oscorp-HQ/quash-max.git
+```
+
+Move to the backend directory
-# Move to the backend directory
+```bash
cd quash-max/backend
+```
-# Run this maven command
+Run this maven command
+
+```bash
mvn clean install
```
## Configuration
-
## Application.properties
+
> Navigate to the resources directory and open the `application.properties` file. Here you will add your database connection strings, access tokens, secret keys for different integrations and services.
->
+**MongoDB Connection String for Database**
-**MongoDB Connection String for Database**
```java
spring.data.mongodb.uri=mongodb_connection_string
```
JWT configurations -
+
```java
jwt.secret='your_secret'
jwt.expirationMs='expiration_time'
@@ -85,27 +109,34 @@ token.signing.key='jwt_singing_key'
```
**Set a Jasypt Password Encryption Key**
+
```java
jasypt.encryption.password='encryption_password'
```
Add your Frontend URL
+
```java
spring.frontend.url='your_frontend_url'
```
Add your Spring Base URL
+
```java
spring.url='your_spring_url'
```
+
Set Access and Refresh Token expiry time
+
```java
# Access Token expiry - 6 days
token.accessToken.expiration=518400000
# Refresh Token expiry - 8 days
token.refreshToken.expiration=691200000
```
+
Some extra properties
+
```java
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=15MB
@@ -116,6 +147,7 @@ spring.main.lazy-initialization=true
**Mail Service**
Setup a mail service and get required credentials
+
```java
spring.mail.host='email_host'
spring.mail.username='email_username'
@@ -129,14 +161,18 @@ from.email.address='your_email@example.com'
```
### Optionally you can use Google OAuth for signin and signup.
+
**Google OAuth**
+
```java
spring.security.oauth2.client.registration.google.client-id='google_client_id'
spring.security.oauth2.client.registration.google.client-secret='google_client_secret'
```
## Optional Integrations
+
Below are some integrations where you can export your tickets to. Configure the integration of your choice by adding the required credentials mentioned.
+
- [Jira](#jira-integration)
- [Google Sheets](#google-sheets-integration)
- [Slack](#slack-integration)
@@ -153,20 +189,20 @@ spring.atlassian.jira.auth_endpoint=https://auth.atlassian.com/oauth/token
spring.atlassian.jira.accessible_resource_endpoint=https://api.atlassian.com/oauth/token/accessible-resources
```
-
Slack integration
Add your [Slack](https://api.slack.com/apps) account credentials
+
```java
spring.slack.clientId='slack_client_id'
spring.slack.clientSecret='slack_client_secret'
spring.slack.quash.redirectUri='slack_redirect_uri'
```
-
Linear integration
Add your Linear account credentials
+
```java
spring.linear.redirect_uri='linear_redirect_uri'
spring.linear.auth_endpoint='auth_endpoint'
@@ -177,17 +213,57 @@ spring.linear.client_secret='linear_client_secret'
Github
Add your Github account credentials
+
```java
spring.github.client_id='github_client_id'
spring.github.client_secret='github_client_secret'
```
## Run Locally
+
Run the `QuashApplication` File
+
```java
mvn spring-boot:run
```
+### Running With Docker:
+
+1. Pull Max's docker image from docker hub.
+
+ ```bash
+ docker pull quashbugs/quash-max-backend:latest
+ ```
+
+2. Create a container without running.
+
+ ```bash
+ docker create --name max-backend -p 8080:8080 quashbugs/quash-max-backend:latest
+ ```
+
+3. Extract the `application.properties` file to configure environment variables.
+
+ ```bash
+ docker cp max-backend:/app/backend/application.properties ./
+ ```
+
+4. Edit the `application.properties` file on your local machine and after that, mount it back to the container.
+
+ ```bash
+ docker cp ./application.properties max-backend:/app/backend/application.properties
+ ```
+
+5. Run the container.
+
+ ```bash
+ docker start max-backend
+ ```
+
+## Accessible Endpoint
+
+http://{YOUR-IP}:8080/swagger-ui/index.html
+
+
## Repository Structure
This backend repository is part of the larger Quash project, located in the parent repository at https://github.com/Oscorp-HQ/quash-max. The parent repository contains multiple components of the Quash project, including this backend.