The backend for PySpringChat, created with Spring Boot.
Java 17
Backend - Spring Boot
Database - PostgreSQL
Testing - JUnit 5, Mockito
Other - Project Lombok, Springdoc, Jackson
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/
...
spring.datasource.url=jdbc:postgresql://localhost:5432/pyspringchat
...
spring.datasource.username=[YOUR USERNAME]
spring.datasource.password=[YOUR PASSWORD]
...
You also need the Java 17 SDK. https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html
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
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.
You can configure the expiration date of the bearer tokens in the application.properties.
bearer_token_expiration_length=[SECONDS]
To run tests, run the following command
mvnw test
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.