Media Sharing Spring is a Java-based project built with Spring Boot that enables sharing of media content (pictures and videos) via a REST API.
- Clone the repository:
https://github.com/Kruzk02/Media-Sharing-Spring.git. - Navigate to the project directory:
cd Media-Sharing-Spring. - Start the services using Docker Compose:
docker compose up -d - Access the API at http://localhost:8080.
Once the application is running, you can use tools like Postman or curl to interact with the API endpoints. Here's an example:
- Create a new user:
Send a POST request to
/api/users/registerwith the following JSON payload:{ "username": "myname", "email": "[email protected]" "password": "password123", } - Authenticate the user:
Send a POST request to /api/users/login with the following JSON payload to receive a JWT token:
{ "username": "myname", "password": "password123" } - Use the generated JWT token to access protected endpoints.
- Redis configuration: Configure redis connection properties in
KafkaConfig.java. - Kafka configuration: Configure kafka connection properties in
RedisConnectionConfig.java. - Security configuration: Customize security settings in
SecurityConfig.java.
Copy the .example.env to .env and fill in the required values:
cp .example.env .env