A social bookmarking built with ASP.NET Core MVC, Entity Framework Core, PostgreSQL with Anthropic tag and category suggestions.
- Accounts, roles, profiles, and social voting/commenting
- Bookmarks with categories, tags, advanced search, and public/private visibility
- AI-assisted tag/category suggestions via Anthropic Claude 4.5 Haiku
- Seed data with ready-to-use accounts for quick demos
- Docker Compose with PostgreSQL and Caddy reverse proxy
- .NET 9.0 SDK
- Docker & Docker Compose
- PostgreSQL database
- Anthropic API key (for AI suggestions)
Configure your PostgreSQL connection string in appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Port=5434;Database=markly;Username=markly_user;Password=markly_password"
}
}Caddy is configured to read the bcrypt hash from the MARKLY_BASICAUTH_HASH environment variable (the project Caddyfile uses {$MARKLY_BASICAUTH_HASH}).
Generate a bcrypt hash for the password (example uses ImiPlaceASPdotnet):
python3 -c 'import bcrypt; print(bcrypt.hashpw(b"ImiPlaceASPdotnet", bcrypt.gensalt()).decode())'Set the environment variable before starting Caddy:
export MARKLY_BASICAUTH_HASH="$2b$12$..."The application uses Claude 4.5 Haiku for AI-powered tag and category suggestions. To enable this feature:
-
Get an API key from Anthropic Console
-
Configure the API key using one of these methods:
Option A: User Secrets (Recommended for development)
dotnet user-secrets init dotnet user-secrets set "Anthropic:ApiKey" "your-api-key-here"
Option B: Environment Variable
export Anthropic__ApiKey="your-api-key-here"
Option C: appsettings.json (Not recommended for production)
{ "Anthropic": { "ApiKey": "your-api-key-here", "Model": "claude-haiku-4-5", "MaxTokens": 256 } } -
Rate Limiting Configuration (optional):
{ "RateLimiting": { "MaxRequestsPerWindow": 10, "WindowSeconds": 60 } }This limits each user to 10 AI suggestion requests per minute.
Tip: You can use Docker to run just the PostgreSQL database while developing locally:
docker compose up -d postgresThis avoids needing to install PostgreSQL locally. The connection string in appsettings.Development.json is already configured to work with this setup.
-
Apply database migrations:
dotnet ef database update
-
Run the application:
dotnet run
-
Access the application at
https://localhost:5001orhttp://localhost:5000
The database is automatically seeded with sample data and test accounts:
| Password | Role | Name | |
|---|---|---|---|
admin@markly.com |
Admin123! |
Admin | Alex Morgan |
sarah@example.com |
Sarah123! |
User | Sarah Chen |
mike@example.com |
Mike1234! |
User | Michael Johnson |
These accounts come with sample bookmarks, categories, tags, comments, and votes. The seed data only runs on an empty database.
-
Configure environment variables in
docker-compose.yml:environment: Anthropic__ApiKey: ${ANTHROPIC_API_KEY}
You can provide the
ANTHROPIC_API_KEYin two common ways:-
Option A: Export a system environment variable (useful for CI or local shells)
export ANTHROPIC_API_KEY="your_actual_api_key" docker compose up -d
-
Option B: Create a
.envfile next todocker-compose.yml(recommended for local development)ANTHROPIC_API_KEY=your_actual_api_key
-
-
Start all services (PostgreSQL, app, and Caddy reverse proxy):
docker compose up -d
-
Access the application at
http://localhost(port 80) orhttps://localhost(port 443) -
View logs:
docker compose logs -f markly
-
Stop all services:
docker compose down
The Docker setup includes:
- PostgreSQL database (data persisted in a Docker volume)
- Markly app with automatic database migrations on startup
- Caddy reverse proxy with automatic HTTPS
- Navigate to Create or Edit Bookmark page
- Enter a title and optionally a description
- Click the "Suggest with AI" button
- Review the suggested tags and categories
- Click on any suggestion to add it to your bookmark
- New tags/categories will be created automatically if they don't exist
markly/
├── Configuration/ # Settings classes (Anthropic, RateLimiting)
├── Controllers/ # MVC Controllers
├── Data/
│ └── Entities/ # Entity models
├── Helpers/ # Utility classes
├── Migrations/ # EF Core migrations
├── Models/ # Domain models
├── Services/
│ ├── Interfaces/ # Service contracts
│ └── Implementations/ # Service implementations
├── ViewModels/ # View models
├── Views/ # Razor views
└── wwwroot/ # Static files (CSS, JS)
- ASP.NET Core MVC 9.0
- Entity Framework Core
- PostgreSQL
- ASP.NET Identity
- Bootstrap 5
- Anthropic Claude API
This project is for educational purposes.