Welcome to the backend of Teamsphere, a chat application built with Spring Boot. This application provides the core functionality for one-on-one chats, user authentication, and profile image storage. Future updates will include group chat functionality using web sockets with the STOMP protocol and RabbitMQ.
Features
- User authentication with JWT using Spring Security
- One-on-one chat functionality
- Profile image storage using Cloudflare Images
- MySQL database integration
- Docker Compose for building and deployment
- Hosted on Digital Ocean
- Spring Boot: Application framework
- Spring Security: For authentication and authorization
- JWT (JSON Web Tokens): For securing API endpoints
- MySQL: Database for storing user and chat information
- Cloudflare Images: For storing and serving profile images
- Docker Compose: For containerizing and deploying the application
- Digital Ocean: Hosting provider
Before you begin, ensure you have the following installed on your system:
- Java 21 or higher
- Maven
- Docker and Docker Compose
- MySQL
-
Clone the repository:
git clone https://github.com/Flanderzz/TeamSphere-API.git cd TeamSphere-API/YipYapTimeAPI -
Build the application using Maven:
mvn clean install
- Generate RSA Token in resource folder
Keys smaller than 2048 bits are considered unsecure
openssl genrsa -out keypair.pem {your size here}openssl rsa -in keypair.pem -pubout -out public.pemopenssl pkcs8 -in keypair.pem -topk8 -nocrypt -inform PEM -outform PEM -out private.pem- Update
application-local.ymlwith your own values for the cloudflare section here is a link on how to get started with cloudflare images.
jwt:
public:
key: classpath:public.key
private:
key: classpath:private.key
audience: "your audience here"
cloudflare:
api:
accountID: get-this-from-cloudflare
key: get-this-from-cloudflare
server:
port: 5454
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://local:3306/teamsphere_db
password: my-secret-pw
username: root
jpa:
database: mysql
hibernate:
ddl-auto: update
show-sql: true
rabbitmq:
host: localhost
password: guest
port: 61613
requested-heartbeat: 580
username: guest
servlet:
multipart:
max-file-size: 20MB
max-request-size: 20MBThis is for the main service without the grafanan loki and promtail
version: '3'
services:
mysql:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: my-secret-pw
MYSQL_DATABASE: teamsphere_db
ports:
- "3306:3306"
rabbitmq:
image: rabbitmq:management
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
command: >
bash -c "rabbitmq-plugins enable rabbitmq_stomp && rabbitmq-server"
ports:
- "61613:61613"
- "15672:15672"If you are on mac with M silicone then you need to update the image in the docker file to
FROM arm64v8/eclipse-temurin:21 as build
- API Documentation
- Deployment
We welcome contributions! Please fork the repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.
- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
This project is licensed under the MIT License.