This repository contains the implementation for a social network application, inspired by popular platforms like Facebook, Instagram, and Twitter. The application provides various functionalities for users, including registration, posting, commenting, group creation, and more.
- Server: Java Spring Boot backend. Server Repository
- Web Client: Angular frontend.
- Mobile Client: Android application. Mobile App Repository
Below are the steps to get the project up and running on your local environment.
- Java 11 or higher
- Maven
- MySQL
- Elasticsearch
- MinIO
- Node.js
- Docker
- IntelliJ IDEA
- Visual Studio Code
Clone the repository to your local machine:
git clone https://github.com/anna02272/Social-Network
Open IntelliJ IDEA and import the cloned repository.
Ensure all necessary Maven dependencies are downloaded.
- Ensure MySQL is installed and running.
- Create a database named
socialNetwork
. - Update the
application.properties
file with your MySQL credentials.
- Open Visual Studio Code.
- Navigate to the frontend directory in the cloned repository.
- Start the Angular app with npm:
npm install
npm start
Once the services are up and running, you can access the platform via the provided endpoints:
- Frontend: Open a web browser and go to https://localhost:4200/
git checkout ues
- Ensure Elasticsearch is installed and running.
- Ensure MinIO is installed and running.
- Update the
application.properties
file with your Elasticsearch and MinIO configurations.
sudo docker exec -it ddmdemo-elasticsearch /bin/bash
elasticsearch-plugin install analysis-icu
# Restart Elasticsearch
docker-compose build
docker-compose up
- User Registration: Users can register, with a system administrator already predefined in the system.
- Login and Logout: Users can log in and out of the system. Access to other functionalities requires logging in.
- Handling Posts: Users can create posts with or without images.
- Comment Update: Users can reply to comments, and multiple replies are possible.
- User Reactions: Users can respond to posts and comments with likes, dislikes, and hearts.
- Sorting Comments: Comments can be sorted based on likes, dislikes, hearts, and publication date.
- Sorting Posts: Posts can be sorted by publication date in ascending or descending order.
- Handling Groups: Users can create and administer groups. Group administrators can suspend groups.
- Reporting: Users can report inappropriate content or users. Administrators can review and take actions.
- Overview of Home Page: Registered users see random public posts and posts from their friends or random groups.
- Change Password: Users can change their password by entering the current password twice and providing a new one.
- Change Profile Data: Users can set their display name, profile description, and profile picture. The user's group memberships are also displayed.
- User Search: Users can search for new friends based on first and last names. Friend requests can be sent and approved or rejected.
- Blocking and Unblocking Users: Group administrators can block and unblock users within their group.
- Group Join Requests: Group administrators can approve or reject incoming requests to join the group.
- Removing Group Administrators: System administrators can remove group administrators, reverting them to regular users.
- Group Suspension: System administrators can suspend groups, providing a reason for suspension. The app automatically removes group administrators from suspended groups.
- User authentication using username and password.
- Authorization using the token mechanism.
- Log messages about important events during application execution.
This section describes the additional functionalities implemented in the UES branch. The UES branch can be found here.
- Indexing of groups and posts in Elasticsearch, and saving documents in the MinIO database.
- Search groups by name
- Search groups by description
- Search groups by description from the attached PDF file
- Search groups by the range of the number of posts (from - to), where the lower and/or upper limit of the range can be set
- Search groups by the average number of likes of posts in the group in the range (from - to), where the lower and/or upper limit of the range can be set
- Combine previous search parameters (BooleanQuery, enable AND and OR operator between fields)
- Preprocess the query to be case-insensitive, supporting both Cyrillic and Latin alphabets
- Provide support in form fields for PhraseQuery and FuzzyQuery input
- Search by group rules
- Display results showing the name of the group, the number of posts, the average number of likes, and a dynamic summary (Highlighter)
- Search posts by title
- Search posts by text
- Search posts by text from the attached PDF file
- Search posts by text in comments
- Search posts by the number of likes (from - to, including likes on the post itself and in comments), where the lower and/or upper range limit can be set
- Combine previous search parameters (BooleanQuery, enable AND and OR operator between fields)
- Preprocess the query to be case-insensitive, supporting both Cyrillic and Latin alphabets
- Provide support in form fields for PhraseQuery and FuzzyQuery input
- Search posts that have a number of comments in the range (from-to), with a lower and/or upper range limit
- Display results showing the title of the post, the text of the post, and a dynamic summary (Highlighter)
- Spring framework
- Spring Boot
- MySQL
- Angular framework
- Elasticsearch
- MinIO
The application consists of a web browser, a Spring container (Spring Boot), and a relational database (SUBP), also Elasticsearch and MinIO. The backend communicates with the frontend via a RESTful service.
The data model includes entities:
- The User entity represents registered user of the application and is intended to store data used for authentication and authorization.
- An unregistered user can only register to the application.
- A user can also be a system administrator or a group administrator.
- A group administrator maintains a specific group, while a system administrator manages it application and has the ability to remove groups.
- Posts are described by the Post entity and they are text, but can also contain images.
- The Comment entity represents a comment in a given application.
- The Reaction entity represents a reaction to certain posts or comments.
- If the content violates community or application rules, a related Report entity is created to a post, comment or user.
- The Group entity represents a group that contains posts and comments are owned by users and maintained by the group administrator.