Skip to content

notAvoiid/spring-boot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Spring Boot Project πŸ’»

spring java
Docker Hub Repo

Getting Started β€’ API Endpoints β€’ Contribute

A project that you can manage books and people.

πŸš€ Getting started

To run the application you will need Java 17, Spring and if you want to test Docker you will have got to download it as well.

Prerequisites

To run this application you will need to have in your application:

Cloning

Cloning project with HTTPS

git clone https://github.com/notAvoiid/spring-boot.git

Or if you use SSH

git clone [email protected]:notAvoiid/spring-boot.git

Environment Variables

There's not Environment Variable in this application, but if you want to implement this you will need to enter at the application.yml and change it yourself like this:

spring:
  datasource:
    url: ${DATABASE_URL}
    username: ${DATABASE_USERNAME}
    password: ${DATABASE_PASSWORD}

Starting

After cloning go to the folder downloaded and type:

cd rest-with-spring-boot-and-java

Build the project using Maven:

mvn clean install

If it doesn't work try one of these

mvn clean package
mvn clean package -DskipTests

Run the Spring Boot Application

mvn spring-boot:run

The application will start on port: http://localhost:80 and http://localhost

πŸ“ API Endpoints

Authentication ​

route description
POST auth/signin sign in an user signin
PUT auth/refresh/{username} refresh user token refresh

Books

route description
GET api/book/v1 find all books find
GET api/book/v1/{id} find a book by his ID findone
POST api/book/v1 create a book create
PUT api/book/v1 update a book update
DELETE api/book/v1/{id} delete a book by his id delete

People

route description
GET api/person/v1 find all people find
GET api/person/v1/findPeopleByName/{firstName} find all people by name find-by-name
GET api/person/v1/{id} find a person by his ID findone
POST api/person/v1 create a person create
PUT api/person/v1 update a person update
PATCH api/person/v1/{id} disable a person by his id disable
DELETE api/person/v1/{id} delete a person by his id delete

Files

route description
POST api/file/v1/uploadFile upload a file
POST api/file/v1/uploadMultipleFiles upload multiple files
GET api/file/v1/downloadFile/{filename:.+} download a file

AUTHENTICATION

POST /auth/signin

REQUEST

{
  "username": "[email protected]",
  "password": "123456"
}

RESPONSE

{
  "token": "OwoMRHsaQwyAgVoc3OXmL1JhMVUYXGGBbCTK0GBgiYitwQwjf0gVoBmkbuyy0pSi"
}

PUT /auth/refresh/{username}

RESPONSE

{
  "token": "OwoMRHsaQwyAgVoc3OXmL1JhMVUYXGGBbCTK0GBgiYitwQwjf0gVoBmkbuyy0pSi"
}

BOOKS

GET api/book/v1

RESPONSE

{
  "id": "1",
  "author": "igor",
  "launchDate": "2024",
  "price": "998",
  "title": "My project"
}

GET api/book/v1/1

RESPONSE

{
  "id": "1",
  "author": "igor",
  "launchDate": "2024",
  "price": "998",
  "title": "My project"
}

POST /api/book/v1

REQUEST

{
  "author": "igor",
  "launchDate": "2024",
  "price": "998",
  "title": "My project"
}

RESPONSE

{
  "id": "1",
  "author": "igor",
  "launchDate": "2024",
  "price": "998",
  "title": "My project"
}

PUT /api/book/v1

REQUEST

{
  "id": "1",
  "author": "Igor Nascimento",
  "launchDate": "2024",
  "price": "998",
  "title": "My project"
}

RESPONSE

{
  "id": "1",
  "author": "Igor Nascimento",
  "launchDate": "2024",
  "price": "998",
  "title": "My project"
}

DELETE api/book/v1/1

RESPONSE

{
  "NO CONTENT"
}

PEOPLE

GET api/person/v1

RESPONSE

{
  "id": "1",
  "firstName": "igor",
  "lastName": "nascimento",
  "address": "Street Albert Einstein",
  "gender": "Male",
  "enabled": true
}

GET api/person/v1/findPeopleByName/igor

RESPONSE

{
  "id": "1",
  "firstName": "igor",
  "lastName": "nascimento",
  "address": "Street Albert Einstein",
  "gender": "Male",
  "enabled": true
}

GET api/person/v1/1

RESPONSE

{
  "id": "1",
  "firstName": "igor",
  "lastName": "nascimento",
  "address": "Street Albert Einstein",
  "gender": "Male",
  "enabled": true
}

POST /api/person/v1

REQUEST

{
  "firstName": "igor",
  "lastName": "nascimento",
  "address": "Street Albert Einstein",
  "gender": "Male",
}

RESPONSE

{
  "id": "1",
  "firstName": "igor",
  "lastName": "nascimento",
  "address": "Street Albert Einstein",
  "gender": "Male",
  "enabled": true
}

PUT /api/person/v1

REQUEST

{
  "id": "1",
  "firstName": "igor",
  "lastName": "nascimento",
  "address": "Street Albert Einstein 950",
  "gender": "Male",
  "enabled": true
}

RESPONSE

{
  "id": "1",
  "firstName": "igor",
  "lastName": "nascimento",
  "address": "Street Albert Einstein 950",
  "gender": "Male",
  "enabled": true
}

PATCH /api/person/v1/1

RESPONSE

{
  "NO CONTENT"
}

DELETE api/person/v1/1

RESPONSE

{
  "NO CONTENT"
}

FILES

With the files endpoint you are gonna need to use the postman or insomnia to upload and download the archives.

πŸ“« Contribute

To help me improve the project or to improve your own knowledge.

  1. git clone https://github.com/notAvoiid/food-recipes.git or git clone [email protected]:notAvoiid/food-recipes.git
  2. git checkout -b feature/NAME (it creates your own branche)
  3. Follow commit patterns
  4. Open a Pull Request explaining the problem solved or feature made, if exists, append screenshot of visual modifications and wait for the review!

Documentations that might help

πŸ“ How to create a Pull Request

πŸ’Ύ Commit pattern

About

Full Stack project that creates an API library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published