Coder Social home page Coder Social logo

pticostaricags / fairplaycombined Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 4.0 4.08 MB

The combined FairPlay stack using .NET Aspire. Customizable software for entrepreneurs, made by entrepreneurs.

Home Page: https://fairplaytube.pticostarica.com/

License: GNU General Public License v3.0

C# 56.38% HTML 34.45% CSS 3.95% TSQL 4.86% JavaScript 0.24% Shell 0.07% Batchfile 0.01% Bicep 0.04%
aspire blazor csharp dotnet azure gemini googlegemini openai openai-api videoindexer

fairplaycombined's People

Contributors

allcontributors[bot] avatar efonsecab avatar pticostarica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fairplaycombined's Issues

Add AzureContentModeratorService to the services project

Add AzureContentModeratorService to the services project. Add the services inside the Common folder.
Add the NuGet package for Microsoft.Azure.CognitiveServices.ContentModerator
Include moderation of images method into the AzureContentModeratorService, make the method receive a Stream

Create a new ContentModeratorModel, in the Models project, inside a new folder named AzureContentModerator
The model should only has two boolean properties

  • IsAdult
  • IsRacy
public class AzureContentModeratorService(ContentModeratorClient contentModeratorClient)
{
    public async Task<ContentModeratorModel> AnalyzeImageAsync(Stream imageStream, 
        CancellationToken cancellationToken)
    {
    }
}

Unable to run FairPlayTube.MAUI when targeting "Windows Machine"

Describe the bug
When trying to Debug "FairPlayTube.MAUI" set to "Windows Machine", the following error message is displayed:

Image

The problem should not show up, given that the "Deploy" flags is actually setup:

Image

**NOTE: **Apparently, this happens only when project resides in a long path, copying the solution folder to the root system path worked to compile, however, this is not a real solution, and instead just a workaround. There is also the workaround of modifying the project properties to set the output path, however, this needs to be done with caution and make sure multiple applications do not use the same output directory.

<BaseOutputPath>C:\Temp\FairPlayTube.MAUI</BaseOutputPath>

To Reproduce
Steps to reproduce the behavior:

  1. Get the "dev-maui-shared" branch: https://github.com/pticostaricags/FairPlayCombined/tree/dev-maui-shared

  2. Open the "FairPlayCombinedMauiSln" solution.

  3. Set the Startup project to "FairPlayTube.MAUI"

  4. Set the framework to use Windows:
    Image

  5. Build the project

  6. Try to run the project
    Expected behavior
    The application successfully starts

Desktop (please complete the following information):

  • OS: Windows 11

Deploy alpha version of the platform

Make sure #104 and #106 is completed, once that is done, proceed to publish the alpha version of the platform.
Once everything is deployed and working, proceed to configure the custom domains.

Add FairPlayCombined.AutomatedTests.Generators

Create the new project "FairPlayCombined.AutomatedTests.Generators".
Create a new generator which will automatically generate the tests for the CRUD actions in the services.
Take the existent generator as a base in order to learn how to inspect the types and know how to implement the test.

Implement sending of emails using SendGrid

Currently, the application has implemented a Dev-only feature for sending emails using MailDev, however, for production scenarios, we need to use a production-ready service, we have chosen SendGrid.

Make sure to keep the code using MailDev when in Development Environment.

Remove hardcoded

Currently the platform has some hardcoded prompts, which we need to make configurable to be able to change them and enhance them at any time.

  • Move the hardcoded prompts to the "Prompt" table.
  • Adapt the code to read the prompts from the database.
  • Add ability to edit prompts from admin portal

Infinite redirect when using Global Interactive Rendering mode

In order to be able to fully re-use the main app pages into the MAUI app, we need to set the app use use Global Interactive Server Render Mode, however, when doing that, if you navigate to the login page, you will get an infinite redirect to the same page.

Find the root cause of the issue and fix it.

Add Auditing columns to tables missing them

  • Make sure all tables have the Auditing columns. Tables prefixed with AspNet can be ignored.
    Auditing columns are:

[SourceApplication] NVARCHAR(250) NOT NULL,
[OriginatorIpaddress] NVARCHAR(100) NOT NULL,
[RowCreationDateTime] DATETIMEOFFSET NOT NULL,
[RowCreationUser] NVARCHAR(256) NOT NULL

  • Regenerate the Data Access
  • Make sure to create the respective partial class implementing the "IOriginatorInfo" interface for all the tables that require it
  • Modify scripts and applications accordingly to reflect these changes.

Issue automatically translating some texts

When using the "LocalizationGenerator" service sometimes you'll get an error when translating, apparently due to invalid characters or incorrect encoding.
Find a solution for this issue.

Image

Add code to detect jailbreak attack

Research the functionality in the following link, currently in preview.
https://learn.microsoft.com/en-us/azure/ai-services/content-safety/quickstart-jailbreak#prerequisites

When using Generative AI services, it is vital to validate users input, since they could cause prompts not to work as designed.
Azure Content Safety offers a functionality to prevent that.

  • Extend AzureContentSafetyService with a new method:
    DetectJailbreakAttackAsync
  • Enable support for "Detect jailbreak attack" with Azure Content Service.

Add the GetPaginated method to the source generator

Improve "ServiceOfTGenerator" in order to include a new method accepting a custom project as a parameter.

Check the method "GetPaginatedPostWithCustomProjectionAsync" for a basis on how to do it.
Follow the same naming convention used in the generator

Add Playwright Tests

We want to include Playwright in the Automated Tests projects.
Currently, .NET Aspire is not supporting Playwright tests, however, it is apparently in the works, keep track of this item in .NET Aspire repository, once is completed, this task should, in theory, be able to be implemented.

dotnet/aspire#958

Identify other places where we could use Source Generators

The platform currently uses C# Incremental Source Generators, to automatically generate most of the CRUD code in the Services project.
Identity places that could be replaced o enhanced using Source Generators.

Possible candidates

  • Automatically creating the CRUD Models in the "FairPlayCombined.Models" project.
  • Automatically creating the API client proxy invoking Kiota from a Source Generators. This needs research.

Add support for authenticated endpoints

Enable support for authenticated endpoints.
Create a new dummy endpoint using minimal apis, Get HTTP verb
app.MapGet("/api/authTest", () => { return "Auth Worked"!; }).RequireAuthorization();

You will need to activate the Identity endpoints, so the login endpoint can be accessed through api clients, to generate a Bearer token.

Enable SwaggerUI
Enable authentication through the Swagger UI.

Make sure the endpoint is accessible when sending the bearer token

Create FairPlayTube SharedUI

Create a new Razor Class Library project "FairPlayTube.SharedUI".
Convert both "FairPlayTube" and "FairPlayTube.MAUI" to use the new shared UI project.

Note: As usual with SharedUI projects, some functionalities should be converted to be accessed through interfaces, especially in the case of data retrieval, since the MAUI app should retrieve data through Kiota APIs, while the web application can directly access the Service classes.

Add functionality to Analyze profile photos

In the world of dating apps, it is important to have great pictures.
We want to add a functionality that helps use analyze their photos using AI, to maximize their dating opportunities.

  • Create a new "AnalyzeDatingProfilePhoto" constant in "FairPlayCombined.Common.Constants.PromptsNames"
  • In the Admin Portal, add a new configurable prompt using this constant. Add it in PromptsEditor.razor
  • In the User Profile in FairPlayDating, add a new button next to the profile image, "Analyze Image".
  • Once the button is clicked, perform the analysis process using the prompt previously created, and show a FluentDialog with the analysis results.

Integrate Azure SignalR into FairPlayTube

FairPlayTube currently makes use of the default SignalR.
We want to enable support for AzureSignalR.

  1. Create a new branch named "development-azuresignalr" based on the "development" branch.
  2. Modify the AppHost so that it reads the Azure SignalsR ConnectionString and pass it to the FairPlayTube project.
  3. Convert FairPlayTube to use the Azure SignalR service.

Loading Indicator is not working as expected when "Play" button is clicked

Currently, when you press the "Play" button, the grid re-executes the data retrieving logic, which in turns hides the loading indicator once it has finished.
We need to find a way to avoid the grid to retrieve the data again when the click button is pressed, since there are no changes been made.
Page:
https://github.com/pticostaricags/FairPlayCombined/blob/main/src/FairPlayCombinedSln/FairPlayTube/Components/Pages/Home.razor

Research the feasibility of a plugin-based app

Research the feasibility of creating a FairPlay website, which works through plugins.
The website would look for all the plugins configured and automatically create even the links and pages.
This requires to design a plugin system, which by itself have additional considerations, such as security and costs.

The plugins must have at least the following basic properties

  • Title
  • Description
  • Category
  • Author

Add a new section to the wiki "How To Deploy FairPlayCombined"

In the documentation, add all of the required steps on how to deploy the platform using AZD.
Additionally, show to configure the required permissions for apps consuming Azure Video Indexer through ARM, meaning setting up the Contributor role for the created Microsoft Entra (Previously Azure Active Directory) Apps

Add Vouching system for new users

As part of the efforts to protect users, one of the feature we will add is a Vouching system, here is how it will work.
Users will not be able to create a new account unless they have been vouched by someone who already has an account, then, a system administrator will review the vouching details and decide if the person should be allowed to join.
If new users break the platform rules, EVERYONE in the vouching chain/hierarchy, will have the account banned, this makes it so that users only vouch for persons with good intentions.

  • Move the "ApplicationUserVouch" table to the "dbo" folder, make it sure to change the script schema to "dbo" to, it currently is under "FairPlayDating"
  • Under the "dbo" folder, create the table "UserInvitation" with the following columns:
    • UserInvitationId
    • InvitingApplicationUserId
    • InvitedUserEmail
    • VouchingReason
    • RowCreationDateTime
    • RowCreationUser
    • SourceApplication
    • OriginatorIPAddress

Include a unique index for "InvitedUserEmail"

In the Admin Portal:

  • Create a new prompt constant for "AnalyzeVouchingReason".
  • Add the new prompt in the PrompEditor page

In the FairPlayDating web app

  • Add a new item "Invite User" to the main menu.
  • Create the respective models and services using the patterns for the AutoGenerated services code: Check of the usage of ServiceOfTAttribute.
  • Include an EditForm with fields for "InvitedUserEmail" and "VouchingReason", both must be required. Reason must be a minimum of 100 characters, and maximum of 1000 characters.
  • Use OpenAIService and PormptGeneratorService approach to evaluate if the provided reason makes sense, or if the users is just writing invalid / phrases that make no sense or cannot be understood.
  • If the provided reason makes sense and email is valid, then create the UserInvitation, and send an email to the users, with a new unique code.

Add a "Coversation Practice" functionality.

As part of FairPlayDating, we want to help users find their potential match, not everyone knows how to establish conversations.
In the Matches page, include a new button to help users practice a possible conversation with each potential match.
One the button is clicked; a modal dialogue will be displayed to start the conversation. Make it similar to how ChatGPT works and include recommendations for Conversation Starters.
This will use the information on their profiles as a base.
Add a disclaimer indicating that the conversation is just practice and that it does not represent how the other person would interact.

Design high-quality AI Prompts

Some of the functionality in the FairPlay platforms make use of AI tools, these AI tools usually require you to pass them a prompt.
Currently we have some basic prompts based text, which it would be ideal to improve.

  • CreateYouTubeThumbnail
  • CreateVideoPassiveIncomeStrategy
  • CreateVideoLinkedInArticle
  • CreateVideoDailyPosts
  • CreateDigitalMarketingIdeas
  • CreateVideoInfographic
  • CreateNewVideoRecommendationIdea
  • AnalyzeDatingProfilePhoto
  • CreateDatingProfileAboutMe
  • AnalyzePotentialMatch

Remove IHttpContextAccessor from services

IHttpContextAccessor has traditionally being the recommended way to get context information, however, things are somewhat different when using Interactive Rendering in Blazor Web Applications, see the link to learn more.

Check https://learn.microsoft.com/en-us/aspnet/core/fundamentals/http-context?view=aspnetcore-9.0#ihttpcontextaccessorhttpcontext-in-razor-components-blazor

Your tasks:

  • Remove IHttpContextAccessor from any classes in the services project.
  • Send the required information as parameters, if there is more than one required parameter, then create an appropriately named Parameters class.
  • In the Blazor caller apps, get the information from the HttpContext
    [CascadingParameter] public HttpContext? HttpContext { get; set; }

Explore Video Generation Tools

FairPlayTube has a feature to create plan new videos, allowing users to input certain information such as title, description, and a video script.

We would like to extend this feature with the ability to create a complete video using AI.
Currently there are tools such as InVideo.AI ( https://invideo.io/ai/ ), which you can feed with a prompt and it will create a video, unfortunately, so far it does not seem to have a publicly available API to make the integration.

We need to research if there are other tools which work as good as InVideo.AI, that also have a publicly available API to be able to completely integrate them into FairPlayTube.

Research integration of Pre-Built AI components

We want to research about the feasibility of adding Pre-built AI components into the system.

Consider ways to include any of the following:

  • Pre-built Open AI GPTs
  • Pre-built Copilots using Microsoft's Copilot Studio
  • Pre-built plugins using Semantic Kernel

For each option, research about the feasibility of connecting the solution to the FairPlayDating data.

Lock all pages by using Roles

Currently, most pages are only locked using the [Authorize] attribute, however, we need to start using roles.
For FairPlayTube pages under the "Creator" folder, modify all the pages to require user's having the "Creator" role, use the existent constant.
For all the pages in the admin portal, make them required the "Admin" role.
For the rest of the pages in the whole platform, make them require the "BasicPlanUser" role. This one does not exist yet.

"Database already exists" error message

The "container" branch has some progress creating an example on how to use containerized database, however, we want each application to ensure the database and data exists on start, EF Core allows this through the EnsureCreateAsync method, however, we have a problem when running multiple applications at the same time, we need to find a way to solve this, so the apps work correctly whether they are the only app running or if there are multiple other apps running simultaneously.
Note: all apps must use the same database.

Image

Display License Agreement, Usage Terms and Disclaimers

When creating a new account, the system must first display the following information:

  • License Agreement
  • Usage Terms
  • Disclaimers

License Agreement:
Will have information about having users accept how the data is going to be used, including data sent to third parties, such as Videos to generate the metadata, and the captions to generate thumbnails, and recommendations.

Usage Terms:
Will have the obligations for the users while using the system, including the warning that breaking the rules will result in an indefinite ban for the user account.

Disclaimers:
Will have all additional information required to disclaim to the users, like the usage of cookies, third-party services ( MUST include their names , etc.)

Once the user has accept all the terms, the register page will be unblocked, and user will be able to create the new account.

Add a new page "MyReceivedLikes"

The page should be similar to the "MyMatches" page, except that it will only show the profiles who have liked the logged in user.

Integrate ArchUnitNET

  • Add the "ArchUnitNET" package to the "FairPlayCombined.AutomatedTests" project.
  • Create a new folder "Dependencies"
  • Inside the "Dependencies" folder, create a new file "DependenciesTests"
  • Add a new Test Method "Test_FairPlayTube_SharedUI_Does_Not_Reference_FairPlayCombined_Services"

As the name indicates, the test must evaluate that the SharedUI project does not directly reference the Services project.

Implement the White Labeling system

Implement the White Labeling System, start with FairPlayDating.

The platform already has some progress on preparation for White Labeling.

Check the following files

  • ThemeConfiguration.cs
  • ThemeConfigurationManager

Add a new Page "VideoList"

The page will show a grid of all videos in the configured Azure Video Indexer Account.
Each row will have a delete button, once clicked, it will proceed to delete the video from Azure Video Indexer, and from the database if it exists, make sure the search is perform using all of fields

  • VideoId
  • AccountId
  • Location

The page will also allow to search by a given search term.
You will need to add a new method in "AzureVideoIndexerService"
Method signature must be
public async Task<bool> DeleteVideoByIdAsync(string videoId, string viAccessToken, CancellationToken cancellationToken)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.