OnlyBalds is a Blazor application with a dedicated Web API for backend operations. It's designed to provide a seamless user experience for our bald community.
The solution contains three projects:
- Blazor Server: This project handles the server-side rendering of the Blazor application.
- Blazor Client: This project is responsible for the client-side logic and UI of the Blazor application.
- Web API: This project provides the backend for frontend (BFF) implementations, serving as the bridge between the Blazor application and the database.
OnlyBalds uses Entity Framework Core with Npgsql to interface with a PostgreSQL database, ensuring efficient data handling and easy integration.
- Create a migration:
dotnet ef migrations add MigrationName
- Apply the migration:
dotnet ef database update
This approach leverages the repository pattern and multiple DbContexts (e.g., ThreadDataContext
, PostDataContext
, CommentDataContext
) to organize and handle data effectively.
The application includes health check support to monitor service health. Access health information at /HealthChecks
:
- /HealthChecks: Displays the application's current health status.
Build information is automatically generated at each build and accessible at the /build-info.html
endpoint. This page provides key details like:
- Build date and time
- Commit hash
- Build version
OnlyBalds integrates with the Hugging Face Inference API to enhance chat room moderation using AI models:
- Toxic BERT: Identifies potentially toxic messages to maintain a respectful environment.
- Twitter Sentiment: Analyzes sentiment to ensure positive interactions within the chat.
To get started with the OnlyBalds application, follow these steps:
- Clone the repository:
git clone https://github.com/bobbylite/OnlyBalds.git
- Navigate to the project directory:
cd OnlyBalds
- Restore the packages:
dotnet restore
- Run the application:
dotnet run
To run the OnlyBalds application locally, follow these steps:
First, you need to run the Backend for Frontend (BFF) which is the Web API project. This project handles the backend operations and serves as the bridge between the Blazor application and the database.
- Open a terminal or command prompt.
- Navigate to the project directory:
cd OnlyBalds
- Run the BFF backend with the following command:
dotnet run --project OnlyBalds.Api --launch-profile https
To run the OnlyBalds client application:
- Create a launch profile in the properties directory.
- Use VS Code's debug section to run the profile created in the previous steps.
Contributions, issues, and feature requests are welcome! Feel free to check issues page.
This project is MIT licensed.