https://github.com/amirshelli/mini-quote
A simple web-application using Spring framework and in-memory database that gives the ability to the users to post quotes and vote them.
https://github.com/amirshelli/mini-quote
h2-database hibernate-jpa java microservices spring spring-boot
Last synced: about 2 months ago
JSON representation
A simple web-application using Spring framework and in-memory database that gives the ability to the users to post quotes and vote them.
- Host: GitHub
- URL: https://github.com/amirshelli/mini-quote
- Owner: AmirShelli
- Created: 2023-02-08T23:03:58.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T07:28:58.000Z (over 3 years ago)
- Last Synced: 2024-10-20T12:11:26.583Z (over 1 year ago)
- Topics: h2-database, hibernate-jpa, java, microservices, spring, spring-boot
- Language: Java
- Homepage:
- Size: 148 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mini-quote
A simple web-application using Spring framework and an in-memory database that enables you to create users, post quotes and vote for them.
## Launch
Use the docker container from [my docker hub repository](https://hub.docker.com/repository/docker/thebluemitsu/kameleoon-trial-test/) to launch mini-quote.
```bash
docker pull thebluemitsu/kameleoon-trial-test:kameleoon-test
docker run -t -p 8000:8000 thebluemitsu/kameleoon-trial-test:latest
```
Or clone the project on your machine and build it using docker compose.
```bash
git clone git@github.com:bluMitsu/mini-quote.git kameleoon
cd kameleoon
docker compose up
```
## Usage
I use [Postman](https://web.postman.co) to test the application, however you can use any other way to send a request to the server.
Here are the available endpoints;
### from UserController
You can use the following JSON structure to create a user.
* #### /register
```json
{
"name": "name",
"email": "name@example.com",
"password": "password"
}
```
### from QuoteController
You can use the following JSON structure to add/update the needed quote accordingly or delete the quote from the database.
* #### /{user_Id}/addQuote
```json
{
"text": "hello, my name is Amir. I'm new to mini-quote."
}
```
* #### /{user_Id}/{quote_Id}/updateQuote
```json
{
"text": "I think I changed my mind."
}
```
* #### /{user_Id}/{quote_Id}/deleteQuote
### from VoteController
These endpoints allow you to up/down vote a quote.
* #### /{user_Id}/{quote_Id}/upVote
* #### /{user_Id}/{quote_Id}/downVote
>Note: each user can up/down vote a quote only once!
### from ViewController
These endpoints allow you to view the quotes with different parameters.
* #### /getAllQuotes
* #### /getRandomQuote
* #### /topTenQuotes
* #### /flopTenQuotes
## Example

>~~Note: docker-compose.yaml file isn't set up properly just yet.~~