pticostaricags / fairplaysocial Goto Github PK
View Code? Open in Web Editor NEWMulti-platform social network system
License: GNU General Public License v3.0
Multi-platform social network system
License: GNU General Public License v3.0
Create a new page "MyAuthoredPosts"
The page must make use of the Feed component to show the list of authored posts.
Each post must have a button with a trash icon.
When clicked, it will require confirmation from the user "Are you sure you want to delete this post?"
If user indicates yes, the post will be deleted.
In the client apps enable support for Http/3
Add the OpenGraph MetaTags to
Sample Meta Tags
<title>FairPlaySocial</title>Create a new table named Group, with the following columns
Currently FairPlayTube as a Visitor Tracking system to get statistics on page's usage, we want to integrate it into this system
Social Media platforms currently have big issues in keeping the veracity of posted information.
We want to design a Reputation System, to help reduce that issue.
The initial plan is to allow users to earn Reputation Points when sharing accurate and useful content.
Fake news, bots posts and similar items which negatively affect the platforms experience should greately reduce the Reputation Points.
Currently, the platform offers an initial ReShare functionality, however, it's implementation may not be the best.
At the moment the Post table has a Self-Referencing Foreing Key, and is allowing to do ReShares of ReShares, this may result in performance problems when the platforms reaches millions of users since the ReShare hierarchy could grow exponentially, and since it is a Self-Referencing hierarchy, it may eventually be required to do recursive queries.
The alternative considered approach is to have a table like "PostReshare", which would be a flat table, with a Foreign Key to the Post table, this however, would mean that to retrieve posts and ReShares in the correct order, a more complex select would need to be created to merge the data of both the Post and PostReShare tables.
Please add your thoughts, ideas, and recommendations on the subject.
Sometime, when loading the home screen for a user role, the icons grid is rendered incorrectly, it happens randomly, and don't happen every single time.
Steps to reproduce
Actual Result:
Sometime the icons show up as only one column.
Expected Result
When page maximized, icons grid should look like this
Currently, the platform is not adhering to official standards such as ActivityPub.
There are some concerns about adhering to decentralized technologies.
The software in the FairPlay category has as one of its core values to protect users, FairPlaySocial for instance will eventually block and deleted posts with disrespectful content or language, in case of adhering to decentralized standards, the platform will probably lose the control of which posts to delete, since people could have already shared them in other platforms/networks
Research the advantages and disadvantages of using ActivityPub
Currently, the loading indicator is implemented as an independent component, and is explicitly where it is required to be show, the current implementation however, makes it so that the html is rendering as a child of other components, so in smaller containers the indicator is not displayed over the whole screen, and only on the parent container.
We need to modify this behavior, so that the loading indicator overlay is always displayed over the whole screen, even over the header and footer.
We need to research the best way to do this without using javascript.
Requires #5 to be implemented
In the file "Authentication.razor", add steps holders for the different authentication steps which are not part of the Azure AB B2C flow
Requires #42 to be implemented
Create a new table named GroupMember, with the following columns
When clicking over the post's author, the author's information modal should be displayed
Create the table "GroupModerator" with the following columns
Blazor in .NET 7 introduce a loading indicator approach when first loading the app.
It is located in the index.html and works using the css classes in the app.css file.
Introduce that technique in the Blazor Webassembly app for this project.
The "RemoteAuthenticatorView" in the "Authentication.razor" file has placeholders for the different Authentication Steps.
We want to design a good looking UI for these steps.
Implement the system basis for localization, use the approach implemented in FairPlayTube
Add support Speech Recognition for the whole system.
In the Blazor Web Assembly App, use the Web Speech API
https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API#speech_recognition
In the MAuI App the solution use a MAUI native feature is available,
otherwise verify if the Web Speech API would work.
The functionality needs to be implemented in the form of an agnostic Service interface, with custom classes implementing the platform specific functionality, similar to how IGeoLocationServic is currently implemented.
The following classes may work for this
Useful videos
Requires #4 to be implemented
Add the PostVisibilityId to the Post entity and table.
The value must be required non nullable, a Foreing Key to PostVisibility.PostVisibilityId
Create the table Poll, with the following columns
Create a new table PollOption with the following columns
In the Post table, add the following column
Create the table PollResponse with the following columns
Regenerate the data access
Create the models: PollModel, CreatePollModel, PollOptionModel, CreatePollOptionModel
To the CreatePostModel, add a new property Poll of type CreatePollModel
In the Create Post Page, add a new option to create a poll, along with 4 options (possible answers)
Modify the PostComponent so that if renders the Poll if there is one available.
When a user click the post option radio button, update the poll response, using an endpoint
public async Task<IActionResult> PollResponseController.CreatePollResponseAsync(CreatePollResponseModel createPollResponseModel, CancellationToken cancellationToken)
You will need to create the respective client service for that endpoint
If there is already a response from the same user to the same poll, the existent response will be deleted by the endpoint before adding the new one.
When viewing posts, it should show the % of answers for each option.
Once the user has chosen an option in the poll, if the user clicks on any of the options, it will show a modal listing the users who chose that option.
For the moment, we will not allow to edit the selected option in polls
Add the base objects for UserProfile:
FairPlaySocial already has a small feature to deny creating posts with Forbidden Urls.
There is a table "ForbiddenUrl" and a class "ForbiddenUrlService".
The urls must be the shortest form of the url, without protocol
Currently, the table is empty, we need to start filling the list with 2 types of urls
In the Post-Deployment script, add the lines to insert the Forbidden Urls.
Once the list is filled, it is required to test users cannot create posts containing any forbidden url.
Note: Research if it is feasible to create a custom validator reading a test file embedded in the assembly, containing the list of forbidden sites, this will help to avoid doing a roundtrip to check for forbidden urls.
Create a new service named "ReportService", with the following methods
Enabling support for adding user geo location when creating posts, on user's requestt
Create a new partial class named "GroupService"
Set the attribute
Register the service in the Dependency Injection container for the Web API
Requires #6 to be implemented
In the server project add a new class named "MyFollowController"
[Route("api/[controller]")]
[ApiController]
[Authorize(Roles = Constants.Roles.User)]
public class MyFollowController : ControllerBase
{
private readonly IMapper mapper;
private readonly ICurrentUserProvider currentUserProvider;
private readonly ApplicationUserFollowService applicationUserFollowService;
public MyFollowController(IMapper mapper, ICurrentUserProvider currentUserProvider,
ApplicationUserFollowService applicationUserFollowService)
{
this.mapper = mapper;
this.currentUserProvider = currentUserProvider;
this.applicationUserFollowService = applicationUserFollowService;
}
}
The class must implement two endpoints
[HttpPost("[action]")]
public async Task FollowUserAsync(long userToFollowApplicationUserId, CancellationToken cancellationToken)
{
}
[HttpPost("[action]")]
public async Task UnFollowUserAsync(long userToUnFollowApplicationUserId, CancellationToken cancellationToken)
{
}
** Note: Use the applicationUserFollowService service injected in the class to insert and delete the respective database record
The system uses Azure AD B2C Flows for login.
Azure AD B2C allows to pass a parameter for localization
We want to be able to send that parameter based on the value of the blazor culture cookie.
.NET 7 allows sending additional parameters for the login process, using InteractiveRequestOptions along with NavigationManager.NavigateToLogin.
We need to verify if that will work for our need.
Note: There is a change this is not currently supported
Research about the available Load Testing tools out there along with the Pros and Cons of each one.
Some tool names recommended by the community are
Currently, the system is only allowing to delete posts if these don't have any replies.
Enabling deleting posts with replies brings additional considerations.
Deleting posts with comments requires recursive functionality and respecting foreign keys.
We need to find a way to do this through Entity Framework, using something like Recursive Projections that translate into SQL.
Note: Enabling cascade delete is not an option
Research the options not requiring creating manual queries, nor SQL SERVER behavior.
After all options have been evaluated, if none is good enough we will end up creating a stored procedure, and mapping it, the stored procedure will internally have a recursive CTE to do the delete of the post's' replies hierarchy.
In the Index Page, in the Shared UI project, add the respective resource keys for the Menu Items text.
Follow the naming convention currently used , locate the code in the code behind of the Index Page
#region Resource Keys
After the resource keys have been added, modify the "OnInitializedAsync" method so that it sets the text using the Localizer
Currently, when creating new posts, these can be created sending the same value for Tag1, Tag2, and Tag3.
Create a Custom Validator that will forbid doing this so that the value cannot be duplicate among these proeprties.
Currently, when retrieving posts, the image bytes are being converted to base64 strings, we want to avoid this, and instead, return a Url that will retrieve the bytes on demand
Requires #48
Make sure to create the require models
In the database project, create a new table named "ApplicationUserFollow", with the following columns
Add the auditing columns used in the ErrorLog table
Recreate the Data Access (Use EF Core Power Tools Reverse Engineerig), remember to create the class ApplicationUserFollow.partial and make it implement the IOriginatorInfo interface
Create the table "PostReach" with the following columns
Requires task #3 to be implemented
In the project "FairPlaySocial.Services", add a new partial class named "ApplicationUserFollowService"
[ServiceOfEntity:nameof(ApplicationUserFollow), primeryKeyType:typeof(long)]
public partial class ApplicationUserFollowService
{
}
Requires #49
[HttpPost("[action]")]
public async Task<GroupModel?> CreateMyGroupAsync(CreateGroupModel createGroupModel, CancellationToken cancellationToken)
When displaying posts, a numeric value is being shown to indicate how long ago the post was created, currently, the value is not working correctly, it is using TimeSpan.Hours instead of TimeSpan.TotalHours and TimeSpan.Minutes instead of TimeSpan.TotalMinutes.
Also we want to avoid showing huge numbers, apply the following rule
Create a table named "PostVisibility" with the following columns
Modify the Post Deployment script to insert the default data
Id - Name - Description
1 - Public - Visible to everyone
2 - Subscribers - Visible to subscribers only
Recreate the Data Access
[Required]
public CreatePhotoModel? Photo { get; set; }
Requires #7 to be implemented
In the ClientServices project, add a new class named "MyFollowClientService"
public class MyFollowClientService
{
private readonly HttpClientService httpClientService;
public MyFollowClientService(HttpClientService httpClientService)
{
this.httpClientService=httpClientService;
}
public async Task FollowUserAsync(long userToFollowApplicationUserId, CancellationToken cancellationToken)
{
}
public async Task UnFollowUserAsync(long userToUnFollowApplicationUserId, CancellationToken cancellationToken)
{
}
}
Note: Implement the respective calls to the server endpoints, check the other client services classes to grasp an idea of the pattern.
Most social networks, when sharing post with URLs, generate a preview of the linked URL, we want to achieve that to generate a preview when sharing a url.
Research the use of the library Blazor.AngleSharp, as well as the LICENSE
The following article shows some examples
https://www.jerriepelser.com/blog/extracting-open-graph-protocol-data/
Note: Simply using HttpClient.GetAsync cannot fully achieve what we want, especially with SPAs systems, which modify the html after the initial response, we need to use some kind of navigator that would even execute javascript, this however brings security concerns.
Before doing this change, research if .NET 7 "JSImport/JSExport" is feasible to be used for this task.
https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/import-export-interop?view=aspnetcore-7.0
Currently, the component "Feed", is not scrolling to the top when a new post is received, however, we want to scroll to top in the event of a new notification.
If it is possible to avoid javascript, that would be preferable, if not, the functionality must be implemented using Isolated Javascript within a file named "Feed.razor.js"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.