This project involves a server for a social network application, featuring functionalities for managing user posts, including complex operations such as co-authorship. Users can create posts and set other users as co-authors. When a post is created with a co-author, the post is also created for the co-author with added text. The condition for setting a co-author is that the users must follow each other.
Additional Query: Calculate the total number of likes for posts where the user is set as a co-author. (The text will include "coauthor: username".)
This server is designed for a social network application and uses Docker for data management. The database is configured in application.properties
with create-drop
, meaning data will be deleted after each restart. Authorization is implemented but only at the server-client level; it is not secure, which is sufficient for the application's intended functionality.
- API Documentation: Swagger UI
- API Repository: Social Network Server
- Client Repository: Social Network Client
- JVM
- Gradle
- Docker
-
Start Docker containers:
docker-compose up -d
-
Load images into Docker for the insert script (for images):
docker cp ./src/main/resources/images/img1 social_network_server-postgres-1:/docker-entrypoint-initdb.d/ docker cp ./src/main/resources/images/img2 social_network_server-postgres-1:/docker-entrypoint-initdb.d/ docker cp ./src/main/resources/images/img3 social_network_server-postgres-1:/docker-entrypoint-initdb.d/ docker cp ./src/main/resources/images/img4 social_network_server-postgres-1:/docker-entrypoint-initdb.d/ docker cp ./src/main/resources/images/img5 social_network_server-postgres-1:/docker-entrypoint-initdb.d/
-
Run the application:
./gradlew bootRun
- Start the client application:
./gradlew bootRun
- Server: http://localhost:8090/
- Client: http://localhost:9080/