Sunu Help Center
A comprehensive help center system for the Sunu health app, providing documentation accessible via web and native iOS app.
π― Overview
This help center mirrors the structure used by UltraLocked, with:
- Web interface at
sunu.health/help(Next.js) - iOS native interface in the Sunu app (SwiftUI)
- RESTful API for fetching articles
- Markdown-based content for easy authoring
π Structure
sunu/ # Next.js web app
βββ lib/
β βββ help-articles.ts # Article management & category config
βββ content/
β βββ help/ # Markdown articles (*.md)
β βββ your-first-five-minutes.md
β βββ creating-secure-account.md
β βββ ...
βββ app/
β βββ help/
β β βββ page.tsx # Main help center page
β β βββ layout.tsx # Shared layout
β β βββ [slug]/
β β βββ page.tsx # Article detail page
β βββ api/
β βββ help/
β βββ route.ts # GET /api/help (all articles)
β βββ [slug]/
β βββ route.ts # GET /api/help/:slug (single article)
Sunu/ # iOS app
βββ Models/
β βββ HelpModels.swift # Data models
βββ Services/
β βββ HelpArticleService.swift # API client
βββ Views/
βββ Help/
βββ HelpView.swift # Main help center
βββ HelpArticleDetailView.swift # Article detail
π Content Organization
Categories (11 total)
- π Getting Started - Onboarding and basics
- π€ Using the AI Health Assistant - Chat and AI features
- π Logging Meals & Nutrition - Food tracking
- π Your Health Dashboard - Home tab features
- π¬ Advanced Health Tests - Blink test, voice biomarkers
- π Viewing History & Trends - Data visualization
- π Using the Check-in Feature - Mood and symptom tracking
- π€ Managing Your Health Profile - Profile and settings
- βοΈ Using the Apple Watch App - Watch companion
- βοΈ Account, Privacy & Subscription - Account management
- β Troubleshooting & FAQ - Common issues
Current Articles (10 written)
- β Your First Five Minutes: A Quick Tour
- β Creating Your Secure Account
- β Connecting to Apple Health: A Step-by-Step Guide
- β Understanding Your Health Disclaimer
- β Starting a Conversation with Your AI Assistant
- β How to Log a Meal (All Methods)
- β Understanding Your Health Scores
- β Taking the Blink Test (MBI Analysis)
- β How We Protect Your Health Data & Privacy
- β FAQ: Why isn't my Apple Health data showing up?
π Getting Started
Prerequisites
# In sunu directory
npm install gray-matter remark remark-html
Run Locally
cd /Users/adeel/projects/sunu
npm run dev
# Visit http://localhost:3000/help
iOS Setup
- Ensure
HelpModels.swiftandHelpArticleService.swiftare in Xcode project - Build and run
- Navigate to Help Center from Profile
βοΈ Creating New Articles
1. Create Markdown File
touch content/help/my-new-article.md
2. Add Frontmatter
---
title: "Your Article Title"
summary: "Brief one-sentence description under 150 characters"
category: "Category Name"
displayOrder: 10
---
3. Write Content
Use markdown formatting. See HELP_ARTICLE_TEMPLATE.md for detailed guidance.
4. Test
- Web:
npm run devβ visit/help/my-new-article - API: curl
http://localhost:3000/api/help/my-new-article - iOS: Build and run app
5. Deploy
Articles are automatically included when the site is built.
π§ Configuration
Update Categories
Edit lib/help-articles.ts:
export const helpCategories = [
{
key: "Category Name",
title: "π― Display Title",
description: "Brief description of this category",
displayOrder: 1,
},
// ... more categories
];
Change URLs
Update these files for production:
- iOS Service (
Sunu/Services/HelpArticleService.swift):
#if DEBUG
self.baseURL = "http://localhost:3000/api/help"
#else
self.baseURL = "https://sunu.health/api/help" // β Update this
#endif
- API Routes (
app/api/help/route.tsandapp/api/help/[slug]/route.ts):
url: `https://sunu.health/help/${article.slug}`, // β Update this
π‘ API Endpoints
GET /api/help
Returns all articles grouped by category.
Response:
{
"categories": [
{
"key": "Getting Started",
"title": "π Getting Started",
"description": "Essential first steps...",
"displayOrder": 1,
"articles": [
{
"slug": "your-first-five-minutes",
"title": "Your First Five Minutes: A Quick Tour",
"summary": "A welcome guide...",
"category": "Getting Started",
"displayOrder": 1,
"url": "https://sunu.health/help/your-first-five-minutes",
"contentHtml": null
}
]
}
],
"totalArticles": 10,
"lastUpdated": "2025-10-06T12:00:00Z",
"links": {
"terms": "https://sunu.health/terms",
"privacy": "https://sunu.health/privacy",
"support": "https://sunu.health/help"
}
}
GET /api/help/:slug
Returns single article with HTML content.
Response:
{
"article": {
"slug": "your-first-five-minutes",
"title": "Your First Five Minutes: A Quick Tour",
"summary": "A welcome guide...",
"category": "Getting Started",
"displayOrder": 1,
"url": "https://sunu.health/help/your-first-five-minutes",
"contentHtml": "<h2>Meet Your Main Tabs</h2><p>Sunu is organized...</p>"
}
}
π¨ Styling
Web Styling
Articles use Tailwind's prose classes with custom styling in app/help/[slug]/page.tsx.
iOS Styling
HTML rendered in WKWebView with custom CSS in HelpArticleDetailView.swift:
- Responsive design
- Dark mode support
- Native font stack
- iOS-appropriate spacing
π Search
Web Search
Client-side search on title and summary (component in app/help/page.tsx)
iOS Search
Full-text search on title and summary (in HelpView.swift)
π Features
Web Features
- β Responsive design
- β Dark mode
- β SEO optimized
- β Static site generation
- β Fast page loads
- β Article search
- β Category browsing
- β Related articles
iOS Features
- β Native SwiftUI
- β Dark mode
- β Pull to refresh
- β Search functionality
- β Share articles
- β HTML rendering
- β 1-hour caching
- β Offline support
π§ͺ Testing
Test Web Interface
npm run dev
# Check these pages:
# - http://localhost:3000/help
# - http://localhost:3000/help/your-first-five-minutes
Test API
# All articles
curl http://localhost:3000/api/help | jq
# Single article
curl http://localhost:3000/api/help/your-first-five-minutes | jq
Test iOS App
- Open Sunu.xcodeproj
- Build and run (βR)
- Navigate to Help Center
- Test search, browsing, article detail
π¦ Deployment
Deploy Web
# Build for production
npm run build
# Deploy to hosting
# (Vercel, Netlify, etc.)
Deploy iOS
- Update production URL in
HelpArticleService.swift - Build for release
- Submit to App Store
π Troubleshooting
Articles not showing on web
- Check file is in
content/help/ - Verify frontmatter is valid YAML
- Check category key matches exactly
- Restart dev server
Articles not loading in iOS
- Check API endpoints are accessible
- Verify base URL is correct
- Check network permissions
- Review Xcode console for errors
Search not working
- Web: Check search text state binding
- iOS: Verify search predicate logic
HTML not rendering properly
- Check markdown syntax
- Review CSS in WKWebView
- Test in both light and dark mode
π Documentation
- Creating Articles: See
HELP_ARTICLE_TEMPLATE.md - Migration Guide: See
HELP_MIGRATION_GUIDE.md - Implementation Details: See
HELP_CENTER_IMPLEMENTATION.md
π€ Contributing
Adding New Articles
- Follow template in
HELP_ARTICLE_TEMPLATE.md - Test locally before committing
- Ensure proper category assignment
- Write clear, concise summaries
- Include relevant screenshots (if applicable)
Improving Existing Articles
- Update markdown file
- Keep frontmatter intact
- Maintain consistent style
- Test changes on web and iOS
Fixing Issues
- Check existing articles for patterns
- Verify changes work in both environments
- Update related documentation
π Content Guidelines
- Tone: Friendly, clear, professional
- Length: 600-1500 words per article
- Structure: Use headers, lists, examples
- Links: Include related articles
- Format: Use markdown best practices
π Security
- All API calls use HTTPS in production
- No sensitive data in articles
- User data privacy respected
- Links validated before publishing
π Support
For questions about:
- Content: Review existing articles or ask team
- Technical: Check documentation files
- Bugs: Create issue with reproduction steps
πΊοΈ Roadmap
- [ ] Add remaining 40+ articles from plan
- [ ] Add article analytics
- [ ] Implement version history
- [ ] Add article feedback system
- [ ] Create admin interface for editing
- [ ] Add video embeds support
- [ ] Implement related articles suggestions
- [ ] Add print-friendly styling
π License
Proprietary - Sunu Health, Inc.
Last Updated: October 2025
Status: β
Core system complete, content in progress