Skip to content

Sanad Law Service REST API with Java Spring Boot, Spring Security, Spring JPA, PostgreSQL, Socket.io, JWT, FCM, and Firebase Cloud Storage (alx grad project).

Notifications You must be signed in to change notification settings

muhammadzkralla/sanad-law-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sanad Law Service ( The API )

Introduction

Sanad is a law service application powered with AI models. Our goal is to facilitate the whole process of finding a suitable lawyer, going to the court, finishing legal papers, asking for legal advice, and more.

Technologies used

This project is built with :

• Spring-MVC
• PostgreSQL
• Spring JPA
• Socket.io
• Firebase Cloud Messaging
• Spring Security for JWT and stateless authentication and middleware filters
• Firebase Storage for cloud storage
• @Async and CompletableFuture for asynchronous processing

Database design

You can also view it from this Database Design Link

drawSQL-image-export-2024-09-23

Installation

To start using the API :

• You should make sure you have PostgreSQL installed and running, after that, you need to open a psql shell terminal and type :

CREATE DATABASE sanad;
GRANT ALL PRIVILEGES ON DATABASE sanad TO postgres;

• You should clone the repository :

https://github.com/Sanad-Project/sanad-law-backend.git

• Email service is disabled for testing environment and the verification OTP is always 111111. If you want to enable it, go to MailSenderServiceImpl class and remove the if condition, and inside AuthenticationServiceImpl class, modify the generateRandomOtp function.

• Rename the env file in the resources package to application.yml and update it with your database credentials and environment information. Make sure to add or update any commented part as per your environment

• Refer to this Article to know how to integrate your own Firebase Cloud Storage to the project.
Once you have downloaded the JSON file:
1- add it under the resources package.
2- Replace the CREDENTIALS_FILE_PATH variable in the StorageServiceImpl class with the path of your JSON file.

That's it, now you are good to go! Run the project in Intellij or you can run this command in the root directory if you have maven installed on your machine:

mvn spring-boot:run

Unit testing

You can run the unit tests by running the following command on you machine if you have maven installed:

mvn test

Endpoints and examples

You can see the finished endpoints and examples for the requests and their corresponding responses from this Postman Collection link

About

Sanad Law Service REST API with Java Spring Boot, Spring Security, Spring JPA, PostgreSQL, Socket.io, JWT, FCM, and Firebase Cloud Storage (alx grad project).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages