mirror of
https://github.com/usatiuk/y.git
synced 2025-10-28 10:37:47 +01:00
add readme
This commit is contained in:
21
README.md
21
README.md
@@ -1,5 +1,3 @@
|
|||||||
Tady bude moje semestralka!
|
|
||||||
|
|
||||||
# Y
|
# Y
|
||||||
|
|
||||||
Due to X's popularity rapidly falling after the rebranding, the upper management had decided that only complete rewrite could help, and to be budget-efficient had decided to outsource it to junior student developers in the Czech Republic...
|
Due to X's popularity rapidly falling after the rebranding, the upper management had decided that only complete rewrite could help, and to be budget-efficient had decided to outsource it to junior student developers in the Czech Republic...
|
||||||
@@ -8,18 +6,21 @@ Due to X's popularity rapidly falling after the rebranding, the upper management
|
|||||||
|
|
||||||
As it was evident with Twitter's 280 character limit, "less is more" is in our DNA, and if we extend it to the features that need to be in the next generation of social networking it is obvious - the less features the better!
|
As it was evident with Twitter's 280 character limit, "less is more" is in our DNA, and if we extend it to the features that need to be in the next generation of social networking it is obvious - the less features the better!
|
||||||
|
|
||||||
As such, our new platform will support only these operations:
|
As such, our new platform only supports these operations:
|
||||||
|
|
||||||
* Posting tweets
|
* Creating an account, editing and deleting it
|
||||||
|
* Posting posts, deleting and editing them
|
||||||
|
* Creating chats with other users, editing them and deleting them
|
||||||
|
* In these chats, creating editing and deleting messages also.
|
||||||
* Following other users and seeing all posts of who you're following in a chronological order
|
* Following other users and seeing all posts of who you're following in a chronological order
|
||||||
* Seeing who other users follow/are followed by
|
|
||||||
* DMing other users
|
|
||||||
|
|
||||||
Also, to prevent misuse of our platform, it is required to implement some admin tools, but, thankfully, our corporate overlord has suggested that for now a simple one: a big red button that deletes all users who have "Elon is bad" in posts they posted or messages they've sent is enough.
|
Also, to prevent misuse of our platform, it is required to implement some admin tools, but, thankfully, our corporate overlord has suggested that for now a simple one: a big red button that deletes all users who have some text (e.g. "Elon is bad") in the messages or posts they posted is enough, available to all admins through the web interface (tab "Haters"), the user created without any other admins is set to be an admin (e.g. the first user), who can also then admin and unadmin users (if they want to, even themselves).
|
||||||
|
|
||||||
Our users are also usually of a very curious kind, so there will be implemented a client-side feature that allows to calculate and show statistics about their posts and messages: when they post/message the most in a nice histogram, which words they use the most and so on... To support that, the server will support a query returning for the user's post history/conversation words that were used there and the number of their occurrences, and also a query that returns all the times of sending for all the messages in a selected conversation.
|
|
||||||
|
|
||||||
## Boring implementation details
|
## Boring implementation details
|
||||||
|
|
||||||
Approx. data model (subject to change):
|
### How to start it
|
||||||
|
|
||||||
|
It should be enough to just run `docker compose -f docker-compose.example.yml up` in the root, and the app should be soon available at [http://localhost:8080](http://localhost:8080)
|
||||||
|
|
||||||
|
Also, here's the entity relationship diagram:
|
||||||

|

|
||||||
BIN
db.png
BIN
db.png
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 90 KiB |
@@ -4,6 +4,7 @@ import com.usatiuk.tjv.y.server.dto.PersonCreateTo;
|
|||||||
import com.usatiuk.tjv.y.server.dto.converters.PersonMapper;
|
import com.usatiuk.tjv.y.server.dto.converters.PersonMapper;
|
||||||
import com.usatiuk.tjv.y.server.entity.Person;
|
import com.usatiuk.tjv.y.server.entity.Person;
|
||||||
import com.usatiuk.tjv.y.server.repository.PersonRepository;
|
import com.usatiuk.tjv.y.server.repository.PersonRepository;
|
||||||
|
import jakarta.persistence.EntityNotFoundException;
|
||||||
import org.junit.jupiter.api.*;
|
import org.junit.jupiter.api.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
@@ -78,6 +79,18 @@ public class PersonServiceImplIntegrationTest {
|
|||||||
Assertions.assertIterableEquals(List.of(personMapper.makeDto(person2)), personService.getFollowing(auth));
|
Assertions.assertIterableEquals(List.of(personMapper.makeDto(person2)), personService.getFollowing(auth));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@WithUserDetails(value = "person1", setupBefore = TestExecutionEvent.TEST_EXECUTION)
|
||||||
|
void shouldAddFollowingThrows() {
|
||||||
|
var auth = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
|
||||||
|
Assertions.assertEquals(0, personService.getFollowing(auth).size());
|
||||||
|
Assertions.assertThrows(EntityNotFoundException.class, () -> {
|
||||||
|
personService.addFollower(auth, "asdfasdf");
|
||||||
|
});
|
||||||
|
Assertions.assertEquals(0, personService.getFollowing(auth).size());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@WithUserDetails(value = "person2", setupBefore = TestExecutionEvent.TEST_EXECUTION)
|
@WithUserDetails(value = "person2", setupBefore = TestExecutionEvent.TEST_EXECUTION)
|
||||||
void shouldRemoveFollowing() {
|
void shouldRemoveFollowing() {
|
||||||
|
|||||||
Reference in New Issue
Block a user