https://github.com/fernanda-kipper/simplified-payment-api
This repository contains a implementation of an simplified payment API using Java Spring
https://github.com/fernanda-kipper/simplified-payment-api
Last synced: 5 months ago
JSON representation
This repository contains a implementation of an simplified payment API using Java Spring
- Host: GitHub
- URL: https://github.com/fernanda-kipper/simplified-payment-api
- Owner: Fernanda-Kipper
- Created: 2023-10-15T16:37:22.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-15T16:45:45.000Z (almost 2 years ago)
- Last Synced: 2023-10-16T16:18:11.812Z (almost 2 years ago)
- Language: Java
- Size: 74.2 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Authentication API


[](./LICENSE)This project is an API built using **Java, Java Spring, H2 as the database.**
The API was developed for my [Youtube Tutorial](https://www.youtube.com/watch?v=QXunBiLq2SM), to demonstrate how to solve the [PicPay Backend Challenge](https://github.com/PicPay/picpay-desafio-backend) using Java Spring.
The Unit tests was developed during another [Youtube Tutorial](https://youtu.be/T6ChO8LQxRE), with the aim to demonstrate how to write unit tests for Java Spring apps using JUnit, Mockito and AssertJ.
## Table of Contents
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [API Endpoints](#api-endpoints)
- [Database](#database)
- [Contributing](#contributing)## Installation
1. Clone the repository:
```bash
git clone https://github.com/Fernanda-Kipper/auth-api.git
```2. Install dependencies with Maven
## Usage
1. Start the application with Maven
2. The API will be accessible at http://localhost:8080## API Endpoints
The API provides the following endpoints:**GET USERS**
```markdown
GET /users - Retrieve a list of all users.
```
```json
[
{
"id": 1,
"firstName": "Pedro",
"lastName": "Silva",
"document": "123456787",
"email": "pedro@example.com",
"password": "senha",
"balance": 20.00,
"userType": "MERCHANT"
},
{
"id": 4,
"firstName": "Luckas",
"lastName": "Silva",
"document": "123456783",
"email": "luckas@example.com",
"password": "senha",
"balance": 0.00,
"userType": "COMMON"
}
]
```**POST USERS**
```markdown
POST /users - Register a new user into the App
```
```json
{
"firstName": "Lucas",
"lastName": "Silva",
"password": "senha",
"document": "123456783",
"email": "lucas@example.com",
"userType": "COMMON",
"balance": 10
}
```**POST TRANSACTIONS**
```markdown
POST /transactions - Register a new Transaction between users (COMMON to COMMON or COMMON to MERCHANT)
``````json
{
"senderId": 4,
"receiverId": 1,
"value": 10
}
```## Database
The project utilizes [H2 Database](https://www.h2database.com/html/tutorial.html) as the database.## Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request to the repository.
When contributing to this project, please follow the existing code style, [commit conventions](https://www.conventionalcommits.org/en/v1.0.0/), and submit your changes in a separate branch.