PySpringChat-Backend

The backend for PySpringChat, created with Spring Boot.

Technologies used

Java 17

Backend - Spring Boot

Database - PostgreSQL

Testing - JUnit 5, Mockito

Other - Project Lombok, Springdoc, Jackson

Getting Started

The PySpringChat backend is a Spring Boot application built using Maven.

Firstly, you will need to set up PostgreSQL, which can be downloaded from here. https://www.postgresql.org/download/

You also need the Java 17 SDK. https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html

Running the API

You can run the application directly with

mvnw spring-boot:run

Or by packaging it and running it as a jar.

mvnw package
java -jar pyspringchat-0.0.1.jar

Endpoints

The documentation for the endpoints can be seen on https://casperr04.github.io/PySpringChat-Backend/index.html.

To create an user, you will have to create one using /v1/auth/register

{
  "username": "user",
  "password": "pass
}

You will receive a bearer token, that you can attach to each subsequent request to authenticate the current user.

The token will expire in a day by default, but that can be changed in the application.properties.

Configuration

You can configure the expiration date of the bearer tokens in the application.properties.

bearer_token_expiration_length=[SECONDS]

Running Tests

To run tests, run the following command

mvnw test

Issues and feedback

This is my first Spring Boot project of this size, it is guranteed that there will be issues.

Feel free to point those out in the githubs issue tracker, or contribute with a pull request.

License

MIT