Skip to content

CMS (Content Management System)

Frontend Cloud includes a powerful Content Management System (CMS) that allows you to create and manage structured data for your application. Using the CMS, you can define collections (database tables) and store documents (data records) that power dynamic content in your app.

Collections define the structure of data you want to store in your application. You can use Frontend AI to create collections by describing what you need:

  • Profiles: User profile information and settings
  • Places: Locations, venues, or geographic data
  • Events: Scheduled activities, appointments, or occurrences
  • Products: Catalog items for e-commerce
  • Posts: Blog articles, news items, or content
  • Reviews: Customer feedback and ratings

Simply ask the Frontend AI to create a collection with the fields you need, and it will set up the structure automatically.

Collection names are automatically formatted to follow best practices:

  • Pluralized: “Profile” becomes “profiles”
  • Lowercased: “Product” becomes “product”
  • No Spaces: “Product Review” becomes “productreviews”

This automatic formatting ensures consistency and follows database naming conventions without requiring manual configuration.

Collections support a variety of field types to match your data needs:

  • String: Short text fields (names, titles, URLs)
  • Text: Long-form content (descriptions, articles, comments)
  • Int: Integer numbers (quantities, ages, ratings)
  • Float: Decimal numbers (prices, percentages, measurements)
  • Image: Image uploads and references
  • Boolean: True/false values (active status, feature flags)

Each field can be configured with validation rules and default values to ensure data integrity.

Every collection has granular permissions that control who can access and modify data. Permissions can be set for four operations:

  • Create: Who can add new documents to the collection
  • Read: Who can view documents in the collection
  • Write: Who can update existing documents
  • Delete: Who can remove documents from the collection

Permissions can be assigned to three user types:

  • Anonymous: Public, non-logged-in users
  • Authenticated: Any logged-in user
  • Owner: The specific user who created the document

Product Reviews Collection:

  • Create: Authenticated (only logged-in users can write reviews)
  • Read: Anonymous (everyone can read reviews)
  • Write: Owner (only the review author can edit their review)
  • Delete: Owner (only the review author can delete their review)

This configuration allows public access to reviews while preventing unauthorized modifications.

User Profiles Collection:

  • Create: Authenticated (users create their own profiles)
  • Read: Authenticated (only logged-in users can view profiles)
  • Write: Owner (users can only edit their own profile)
  • Delete: Owner (users can delete their own profile)

This setup keeps user profiles private and ensures users only modify their own data.

Public Blog Posts Collection:

  • Create: Authenticated (logged-in users can create posts)
  • Read: Anonymous (everyone can read blog posts)
  • Write: Owner (only the post author can edit)
  • Delete: Owner (only the post author can delete)

This allows public content consumption while restricting content management to creators.

You can edit and modify collections in the Frontend CMS panel:

  • Add or remove fields from existing collections
  • Change field types and validation rules
  • Update permission settings
  • View collection statistics and usage
  • Export collection data

The CMS panel provides a visual interface for managing your data structure without writing code.

Documents are individual records within a collection, similar to rows in a database table. Each document stores specific data that matches the collection’s structure.

Documents can be created in two ways:

  1. Frontend Dashboard: Manually create documents through the CMS interface
  2. Your Application: Programmatically create documents via API endpoints

For example, user-generated content (reviews, posts, comments) would be created by your app, while admin content (featured items, site settings) might be created in the dashboard.

Documents have a published status that controls their visibility:

  • Published Documents: Available and visible to your frontend application
  • Unpublished Documents: Hidden from the frontend, only visible in the CMS dashboard

Important: Only published documents will be exposed to the frontend. This allows you to:

  • Draft content before making it live
  • Review and edit documents without affecting your live site
  • Schedule content by publishing when ready
  • Hide outdated or archived content without deleting it

When querying documents through the API, only published documents are returned to your application, ensuring that draft or private content remains hidden from users.

Your application can interact with the CMS using REST API endpoints at /api/v1/cms:

  • POST: Create new documents
  • GET: Retrieve documents
  • PUT: Update existing documents
  • DELETE: Remove documents
// Create a new document
POST /api/v1/cms/reviews
{
"productId": "123",
"rating": 5,
"comment": "Great product!",
"active": true
}
// Get documents from a collection
GET /api/v1/cms/reviews
// Update a document
PUT /api/v1/cms/reviews/doc_abc123
{
"rating": 4,
"comment": "Updated review"
}
// Delete a document
DELETE /api/v1/cms/reviews/doc_abc123

The CMS API supports powerful querying capabilities:

Search across text fields in your collection:

GET /api/v1/cms/reviews?query=excellent+product

Filter documents by field values:

GET /api/v1/cms/reviews?active=true&rating=5

Control the number of results and which page to retrieve:

GET /api/v1/cms/reviews?page=1&perPage=20
GET /api/v1/cms/reviews?query=great&active=true&page=1&perPage=20

This query searches for “great” in active reviews, returning the first 20 results.

Instead of manually writing API calls, you can direct Frontend AI to manage collections and documents:

  • “Create a new collection for product reviews with rating and comment fields”
  • “Fetch all active blog posts from the CMS”
  • “Update the user profile document for the current user”
  • “Delete the review with ID abc123”
  • “Search for events in the next 30 days”

The AI will generate the appropriate API calls and handle the integration automatically.

When working with the CMS:

  • Plan your collections: Think through your data structure before creating collections
  • Use appropriate permissions: Protect sensitive data with proper permission settings
  • Leverage field types: Choose the right field type for each piece of data
  • Implement validation: Use field validation to ensure data quality
  • Test permissions: Verify that your permission settings work as intended
  • Use pagination: Don’t load all documents at once for large collections
  • Index for search: Consider which fields need to be searchable
  • Monitor usage: Keep track of collection sizes and query performance

Frontend Cloud CMS provides a flexible, powerful way to manage your application’s data without the complexity of setting up and maintaining a separate database infrastructure.