Add landing page, referral system, usage quotas, search API management, and yearly pricing

- Separate workspace landing from login for better UX
- Referral system rewards both parties with Pro days
- Quota enforcement prevents abuse without breaking endpoints
- 7-day free trial with auto-downgrade on expiry
- Admin-managed search provider config (SearXNG, Bing)
- 15% discount on annual subscriptions
- MCP search server wrapping opencode search
- Fix discovery module field name mismatch causing 422
This commit is contained in:
TradeMate Dev
2026-05-26 11:40:13 +08:00
parent 52dba37f22
commit bed5c7abef
39 changed files with 1988 additions and 152 deletions
+19
View File
@@ -0,0 +1,19 @@
from fastapi import APIRouter, Depends, HTTPException, Query
from sqlalchemy.ext.asyncio import AsyncSession
from app.database import get_db
from app.api.v1.deps import get_current_user_id
from app.services.search import SearchService
router = APIRouter()
@router.get("/query")
async def search(
q: str = Query(..., min_length=1, max_length=500),
limit: int = Query(10, ge=1, le=50),
user_id: str = Depends(get_current_user_id),
db: AsyncSession = Depends(get_db),
):
svc = SearchService(db)
results = await svc.search(q, limit)
return {"query": q, "results": results}