This repository is a Java application developed using the powerful Spring Framework, designed to serve as a backend for my frontend repository QA-React
The technologies used in this project are:
- Java
- Spring Framework with the following dependencies
- Spring data jpa
- Spring data rest
- Postgresql Driver
- Lombok
- Spring devtools
- Spring web
- Postgresql
Before you begin to work with this repo in your local machine, ensure you have met the following requirements:
- Java Development Kit (JDK) 11 or later
- Maven 3.6.3 or later
- Docker (optional, for containerization)
To run this app in development mode open the terminal and write the following:
git clone https://github.com/Zakaria9375/QA-springboot-backend
cd QA-springboot-backend
./mvnw clean package
./mvnw spring-boot:run
java -jar target/qa-0.0.1-SNAPSHOT.jar
The API is available at https://inevitable-odelle-zaportfolio-3128ae44.koyeb.app/
API-endpoints
GET
/questions
GET
/questions/search/findByTitleContaining?title=${searchTerm}
GET
/answers/search/findAllByQuestionId?questionId=${questionId}
PUT
/answers/:id
The request body needs to be in JSON format and include the following properties:
- content: required
- userId: optional
- questionId: required
- createdAt: required
{
"content": "This is an edited answer",
"user": "/users/2",
"question": "/questions/5",
"createdAt": "Data of creaion"
}
POST
/answers
The request body needs to be in JSON format and include the following properties:
- content: required
- userId: optional
- questionId: required
{
"content": "This is a new answer",
"user": "/users/2",
"question": "/questions/5"
}
DELETE
/answers/:id
GET
/users/:id
You can also run this application using the Docker image available on Docker Hub.
Docker Hub Repository: zakaria9375/qa
To pull and run the Docker image, use the following command:
docker pull zakaria9375/qa3:latest
docker run -d -p 8050:8050 zakaria9375/qa3:latest
Postgresql database has been used in this application. Here is the flowchart that illustrates the database tables:
What went well ?
This app has successfully managed to perform CRUD operation on the Postgresql database and creating the necessary api endpoints for a successful communication with the frontend.
What could be improved ?
Securing the api endpoints. (ToDo)
In every project I develop, I focus on improving code quality and incorporating new techniques into my development process. I strive to learn from my mistakes by addressing them directly and applying those lessons to future projects. My goal is to continuously refine and enhance my standard approach to project development.
- Portfolio - Zakaria Ali
- Frontend Mentor Profile - @Zakaria9375
- Project by - Frontend Mentor team
Want to contribute? Great! Here’s how you can help:
- Fork the repo and create your branch from
main
. - Make your changes and test.
- Issue that "pull" request!