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.
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
You can also view it from this Database Design Link
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
You can run the unit tests by running the following command on you machine if you have maven installed:
mvn test
You can see the finished endpoints and examples for the requests and their corresponding responses from this Postman Collection link