✨ Independent high-performance backend implementation of OpenBioCard ✨
- Project Overview
- Features
- Functional Differences
- Quick Start
- Environment Configuration
- Deployment Guide
- Project Structure
- Tech Stack
- License
OpenBioCard Server is an independent backend solution for the OpenBioCard ecosystem.
Unlike the original implementation based on Cloudflare Workers, this project is built on C# ASP.NET Core, designed specifically for traditional servers, VPS, or containerized deployments (Docker/Kubernetes).
It provides RESTful APIs compatible with the OpenBioCard frontend, allowing you to fully control your data on your own infrastructure using SQLite or PostgreSQL.
- 🚀 High Performance - Built on ASP.NET Core with Response Compression (Brotli/Gzip) and Multi-level Caching (Memory/Redis) support.
- 💾 Flexible Storage - Supports SQLite, PostgreSQL, and MySQL, easily switchable based on requirements.
- 🛡️ Security Protection - Built-in login rate limiting (10 requests per minute) to prevent brute-force attacks.
- 🐳 Containerization - Comprehensive Docker support for easy deployment.
- 📄 OpenAPI Support - Native integration with Swagger/OpenAPI for convenient API debugging.
- 🛠️ Cross-platform - Supports Linux, Windows, macOS, and all platforms supported by .NET.
Regarding architectural differences and compatibility configuration:
This project is rebuilt on relational databases, with a fundamentally different underlying data model compared to the upstream project. If used with the upstream project's frontend, please ensure the API endpoint is configured to
/classicto enable the compatibility layer.
The compatibility layer will continue to support the frontend of the upstream project.
- .NET SDK: 10.0 or higher
- Database: PostgreSQL or MySQL (optional, SQLite is used by default in development)
-
Clone the repository
-
Check configuration The project uses
appsettings.Development.jsonby default.$ cd OpenBioCardServer $ vim appsettings.Development.json// appsettings.Development.json "DatabaseSettings": { "Type": "SQLite", "ConnectionString": "Data Source=development.db" }
-
Run the application
dotnet run
The server will start at
http://localhost:5046(or configured port).You need to set the OpenBioCard backend URL to
http://localhost:5046/classic(or your custom port). -
Access Swagger UI Visit
http://localhost:5046/swaggerto view API documentation and perform debugging.
-
Clone the repository
https://github.com/OpenBioCard/OpenBioCard.git -
Install dependencies
$ pnpm install
-
Change the frontend API endpoint (or directly modify the hardcoded parts in the source code)
$ vim apps/frontend/.env.local
VITE_API_BASE_URL=http://localhost:5046/classic
-
Start the application
$ cd apps/frontend $ pnpm dev
Configuration is managed via appsettings.json or environment variables.
For environment variables, use double underscores __ to separate sections (e.g., CacheSettings__Enabled).
Note: Since
Policiesis an array, environment variables use index notation (e.g.,RateLimitSettings__Policies__0__PolicyNamefor the first policy,__1__for the second).
This is the easiest way to deploy the server along with a PostgreSQL database.
- Publish the app:
dotnet publish -c Release -o ./publish
- Upload files to your server directory.
- Set environment variables to configure the production database connection.
- Run:
dotnet OpenBioCardServer.dll
OpenBioCardServer/
├── Controllers/ # API controllers
├── Data/ # EF Core context and migrations
├── Middlewares/ # Middleware (e.g., rate limiting)
├── Models/ # Database entity models
├── Services/ # Business logic (Auth, User, Admin)
├── Utilities/ # Utility classes
├── Program.cs # Application entry point and DI configuration
├── appsettings.json # Configuration file
└── Dockerfile # Container build file
- Framework: .NET 10 / ASP.NET Core
- ORM: Entity Framework Core
- Database: PostgreSQL / MySQL / SQLite
- Documentation: Microsoft.AspNetCore.OpenApi
This project is licensed under the MIT License.
