Move 9 init/seed scripts into scripts/seed/ and 7 validation scripts (+ validators/ subfolder) into scripts/validate/ to reduce clutter in the root scripts/ directory. Update all references across Makefile, CI/CD configs, pre-commit hooks, docs (~40 files), and Python imports. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6.0 KiB
6.0 KiB
Platform Homepage - Quick Start Guide
Quick reference for setting up and customizing the platform homepage and content pages.
🚀 Quick Setup
Step 1: Create Platform Pages
Run the seeder script to create all default platform pages:
python scripts/seed/create_platform_pages.py
This creates:
- ✅ Platform Homepage (modern template)
- ✅ About Us
- ✅ FAQ
- ✅ Contact Us
- ✅ Terms of Service
- ✅ Privacy Policy
Step 2: Verify Pages
Visit your platform homepage:
http://localhost:8000/
Visit content pages:
http://localhost:8000/about
http://localhost:8000/faq
http://localhost:8000/contact
http://localhost:8000/terms
http://localhost:8000/privacy
Step 3: Customize (Optional)
Change homepage template:
UPDATE content_pages
SET template = 'minimal' -- or 'default', 'modern'
WHERE slug = 'platform_homepage' AND store_id IS NULL;
Update homepage content:
UPDATE content_pages
SET content = '<p>Your custom homepage content...</p>'
WHERE slug = 'platform_homepage';
📄 Available Templates
Homepage Templates
| Template | Style | Best For |
|---|---|---|
default |
Professional, feature-rich | Comprehensive showcase |
minimal |
Clean, simple | Minimalist branding |
modern |
Animated, gradient-heavy | Tech-forward platforms |
Content Page Template
All content pages use platform/content-page.html:
- Breadcrumb navigation
- Responsive design
- Enhanced prose styling
- Dark mode support
🎯 Common Tasks
Add New Content Page
from app.core.database import SessionLocal
from app.services.content_page_service import content_page_service
db = SessionLocal()
page = content_page_service.create_page(
db,
slug="careers",
title="Careers",
content="<h1>Join Our Team</h1><p>...</p>",
store_id=None, # Platform page
is_published=True,
show_in_header=True,
show_in_footer=True,
display_order=4
)
db.close()
Update Page Content
content_page_service.update_page(
db,
page_id=page.id,
title="New Title",
content="<h1>Updated Content</h1>",
meta_description="New description"
)
Change Navigation Visibility
# Show in header menu
content_page_service.update_page(
db,
page_id=page.id,
show_in_header=True,
display_order=2
)
# Remove from footer
content_page_service.update_page(
db,
page_id=page.id,
show_in_footer=False
)
🔍 Verification
Check Database
-- List all platform pages
SELECT id, slug, title, template, is_published, show_in_header, show_in_footer
FROM content_pages
WHERE store_id IS NULL
ORDER BY display_order;
Test Navigation
- Visit homepage:
http://localhost:8000/ - Check header menu (should show: About, FAQ, Contact)
- Scroll to footer (should show all pages)
- Click links to verify they work
Test Dark Mode
- Click moon icon in header
- Verify all pages render correctly in dark mode
- Toggle back to light mode
📝 Page Content Examples
Homepage Content
<p class="lead">
Welcome to our multi-store marketplace platform.
Connect with thousands of stores and discover amazing products.
</p>
<p>
Join our growing community of successful online businesses today.
</p>
About Us Content
<h2>Our Mission</h2>
<p>We're democratizing e-commerce...</p>
<h2>Our Values</h2>
<ul>
<li><strong>Innovation:</strong> Constantly improving</li>
<li><strong>Transparency:</strong> No hidden fees</li>
</ul>
FAQ Content
<h2>Getting Started</h2>
<h3>How do I create an account?</h3>
<p>Contact our sales team...</p>
<h3>What are your pricing plans?</h3>
<p>We offer flexible pricing...</p>
🎨 Customization Tips
Custom Homepage Template
-
Create new template:
app/templates/platform/homepage-custom.html -
Extend base template:
{% extends "platform/base.html" %} {% block content %} <!-- Your custom layout --> {% endblock %} -
Update database:
UPDATE content_pages SET template = 'custom' WHERE slug = 'platform_homepage';
Customize Navigation Order
UPDATE content_pages
SET display_order = 1
WHERE slug = 'about';
UPDATE content_pages
SET display_order = 2
WHERE slug = 'faq';
UPDATE content_pages
SET display_order = 3
WHERE slug = 'contact';
Result in header: About | FAQ | Contact
🐛 Troubleshooting
Homepage shows 404
Fix: Run seeder script
python scripts/seed/create_platform_pages.py
Navigation menu is empty
Fix: Update navigation flags
UPDATE content_pages
SET show_in_header = true, show_in_footer = true
WHERE slug IN ('about', 'faq', 'contact')
AND store_id IS NULL;
Content not updating
Fix: Clear any caching and restart server
# If using uvicorn with reload
# Changes should auto-reload
# If manual restart needed
pkill -f uvicorn
uvicorn main:app --reload
📚 Full Documentation
For complete details, see:
✅ Checklist
After setup, verify:
- Homepage loads at
http://localhost:8000/ - All content pages are accessible
- Header navigation shows correct pages
- Footer navigation shows all pages
- Dark mode works
- Mobile responsive design works
- SEO meta tags are present
- Links in navigation work correctly
🎉 You're Done!
Your platform homepage and content pages are now set up and ready to customize!
Next Steps:
- Customize homepage content via admin panel at
/admin/platform-homepage - Manage all content pages at
/admin/content-pages - Add your own branding and colors
- Create additional content pages as needed
- Set up analytics tracking