SurfSense/surfsense_backend/alembic/versions
Claude 2a2a909ef4
Implement dynamic site appearance configuration system
This commit implements a comprehensive database-driven site configuration
system that allows administrators to control the visibility and behavior
of homepage elements, navigation links, footer sections, and route
availability without code changes.

Backend Changes:
- Added SiteConfiguration model with singleton pattern (id=1)
- Created migration 38_add_site_configuration_table.py
- Implemented site_configuration_routes.py with public + admin endpoints
- Added Pydantic schemas for validation (Base, Update, Read, Public)
- Registered routes in main app

Frontend Changes:
- Created SiteConfigContext.tsx for global state management
- Updated app/layout.tsx to wrap app in SiteConfigProvider
- Implemented RouteGuard component for disabled routes
- Updated navbar with conditional rendering (pricing, docs, github, signin)
- Updated hero-section with conditional buttons (get started, talk to us)
- Updated footer with conditional sections and custom copyright
- Applied route guards to pricing, contact, terms, privacy pages

Admin Panel:
- Created /dashboard/site-settings page with full UI
- Visual toggle switches for all configuration options
- Real-time updates via API with toast notifications
- Organized by section (Header, Homepage, Footer, Routes, Text)
- Dark mode support and responsive design

Configuration Options:
Header: show_pricing_link, show_docs_link, show_github_link, show_sign_in
Homepage: show_get_started_button, show_talk_to_us_button
Footer: show_pages_section, show_legal_section, show_register_section
Routes: disable_pricing/docs/contact/terms/privacy_route
Custom: custom_copyright text (max 200 chars)

Security:
- Superuser-only admin endpoints with JWT validation
- Public read-only endpoint for frontend consumption
- Input validation via Pydantic schemas
- Singleton pattern with database constraints
- Client-side route guards for disabled routes

Documentation:
- Added comprehensive section to claude.md
- Includes API docs, migration guide, testing checklist
- Example code snippets and configuration tables
- Security considerations and future enhancements

All configuration defaults to minimal/privacy-focused state (most
features disabled by default). Administrators can enable features
as needed via the admin panel.

Files Changed: 16 files (6 backend, 10 frontend, 1 documentation)
2025-11-18 10:58:31 +00:00
..
1_add_github_connector_enum.py Fixed formatting and linting post Jira connector PR 2025-07-25 10:52:34 -07:00
2_add_linear_connector_enum.py Fixed formatting and linting post Jira connector PR 2025-07-25 10:52:34 -07:00
3_add_linear_connector_to_documenttype_.py Fixed formatting and linting post Jira connector PR 2025-07-25 10:52:34 -07:00
4_add_linkup_api_enum.py fix linkup enum migration file 2025-08-13 21:18:33 +02:00
5_remove_title_char_limit.py fix: ruff linting for alembic version files 2025-07-24 15:21:54 -07:00
6_change_podcast_content_to_transcript.py Fixed formatting and linting post Jira connector PR 2025-07-25 10:52:34 -07:00
7_remove_is_generated_column.py Fixed formatting and linting post Jira connector PR 2025-07-25 10:52:34 -07:00
8_add_content_hash_to_documents.py Fixed formatting and linting post Jira connector PR 2025-07-25 10:52:34 -07:00
9_add_discord_connector_enum_and_documenttype.py Fixed formatting and linting post Jira connector PR 2025-07-25 10:52:34 -07:00
10_update_chattype_enum_to_qna_report_structure.py fix: ruff linting for alembic version files 2025-07-24 15:21:54 -07:00
11_add_llm_config_table_and_relationships.py Fixed formatting and linting post Jira connector PR 2025-07-25 10:52:34 -07:00
12_add_logs_table.py Fixed formatting and linting post Jira connector PR 2025-07-25 10:52:34 -07:00
13_add_jira_connector_enums.py Fixed formatting and linting post Jira connector PR 2025-07-25 10:52:34 -07:00
14_add_confluence_connector_enums.py Add migration file 2025-07-26 14:46:23 +02:00
15_add_clickup_connector_enums.py fix ruff isues 2025-08-01 00:27:50 +02:00
16_fix_connector_unique_constraint.py fix(backend): modified unique constraint on search_source_connectors table 2025-08-02 11:47:49 -07:00
17_add_google_calendar_connector_enums.py add requested changes 2025-08-07 21:18:25 +02:00
18_add_google_gmail_connector_enums.py generate migration file 2025-08-15 09:11:14 +02:00
19_add_airtable_connector_enums.py Add airtable connector auth flow routes 2025-08-26 13:56:31 +02:00
20_add_openrouter_to_litellmprovider_enum.py Added OpenRouter to provider list 2025-09-16 18:26:58 -07:00
21_add_luma_connector_enums.py Added Luma connector 2025-09-28 14:59:10 -07:00
22_add_cometapi_to_litellmprovider_enum.py feat: Added CometAPI to LLM providers list 2025-10-04 15:13:03 +08:00
23_associate_connectors_with_search_spaces.py feat: added missed migration 2025-10-12 20:15:27 -07:00
24_fix_null_chat_types.py feat: added missed migration 2025-10-12 20:15:27 -07:00
25_migrate_llm_configs_to_search_spaces.py feat: added periodic tasks in backend db and frontend hooks 2025-10-22 16:14:25 -07:00
26_add_language_column_to_llm_configs.py feat: added missed migration 2025-10-12 20:15:27 -07:00
27_add_searxng_connector_enum.py refactor: updated SearxNG connector migration and fixed validation for SearxNG host URL 2025-10-13 13:57:58 -07:00
28_add_chinese_litellmprovider_enum.py chore: removed chinese comments to pass ruff checks and updated migration nos 2025-10-13 20:07:32 -07:00
29_add_unique_identifier_hash_to_documents.py feat: add unique identifier hash for documents to prevent duplicates across various connectors 2025-10-14 21:11:19 -07:00
30_add_baidu_search_connector_enum.py feat: bumped version to v0.0.8 2025-10-16 22:44:12 -07:00
31_add_elasticsearch_connector_enums.py feat: update Elasticsearch integration and logging 2025-10-17 02:21:56 +05:30
32_add_periodic_indexing_fields.py feat: added periodic tasks in backend db and frontend hooks 2025-10-22 16:14:25 -07:00
33_add_page_limits_to_user.py feat: added file limit tracking for a user 2025-10-30 14:58:08 -07:00
34_add_podcast_staleness_detection.py fix podcast generation 2025-11-11 04:02:04 +02:00
35_update_litellmprovider_enum_comprehensive.py feat(llm): expand LLM provider options and improve model selection UI 2025-11-13 02:41:30 -08:00
36_remove_fk_constraints_for_global_llm_configs.py feat: added global llm configurations 2025-11-14 21:53:46 -08:00
37_add_social_media_links_table.py Implement dynamic social media link management system 2025-11-17 20:44:17 +00:00
38_add_site_configuration_table.py Implement dynamic site appearance configuration system 2025-11-18 10:58:31 +00:00
e55302644c51_add_github_connector_to_documenttype_.py Fixed formatting and linting post Jira connector PR 2025-07-25 10:52:34 -07:00