statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
32 stars 1 forks source link

Improve the UX of moving "stuff" to the database #1246

Open rtrudel opened 3 weeks ago

rtrudel commented 3 weeks ago

Context

When installing the eloquent package, users are presented with repository choices without clear explanations of their purposes. This is particularly challenging for users migrating from other CMS platforms (like Craft CMS, WordPress) where terminology and concepts may differ.

Current Issues

  1. Repository selection during eloquent package installation lacks context
  2. No clear distinction between content and structural elements
  3. Insufficient guidance on environment-specific configurations
  4. Missing cross-CMS terminology reference
  5. Unclear content synchronization behaviors between flat-files and database

Proposed Improvements

1. Repository Documentation

2. Content vs Structure Classification

3. Content Synchronization Behaviors

4. Environment Management

5. Migration Guide

6. Configuration Examples

Include practical examples for common setups:

Expected Benefits

Implementation Suggestions

  1. Add a new section in the main documentation
  2. Include visual diagrams for complex concepts
  3. Provide practical examples with common use cases
  4. Add a glossary of terms with CMS-specific mappings
  5. Include decision trees for content priority scenarios
  6. Add warning boxes for potentially destructive operations (if applicable)
rtrudel commented 3 weeks ago

If I may suggest: Adding a CLI command that would provide certain presets to simplify storage strategy management and make it easy to switch between different configurations.

The data:schema command could help manage storage strategies for both content and structure:

# Predefined storage strategy presets
php please data:schema --preset=flat-file          # Everything in files
php please data:schema --preset=database-only      # Everything in database
php please data:schema --preset=hybrid-standard    # Content in DB, structure in files

# Custom storage strategy configuration
php please data:schema --content=db --structure=file

# Granular repository configuration
php please data:schema --collections=file --entries=db --forms=db --taxonomies=file

This would:

  1. Simplify the migration process
  2. Make it safer to experiment with different storage configurations
  3. Provide clear visibility into current storage strategy
  4. Allow for granular control over repository storage
  5. Include safeguards against data loss

The command could also provide helpful feedback about the implications of each change and ensure data integrity during transitions.

duncanmcclean commented 3 weeks ago

Good idea!

I think we can probably adjust the install:eloquent-driver command (which is the CLI wizard you see) to ask what you want to move:

^ those options would also be available when creating new sites

We can also improve the existing documentation around the Eloquent Driver to mention content vs config repos to clarify what actually gets moved.

rtrudel commented 3 weeks ago

I believe indeed that what I call structure is named config here, but we're talking about the same thing :)

rtrudel commented 3 weeks ago

Since Statamic's default mode is flat-file, it could also be interesting to have a simple way to manage .gitignore files if we wanted, for example, to keep everything without a database, while still ensuring that content remains independent between environments. This could also be kind of preset "flat-config" or something.

duncanmcclean commented 3 weeks ago

Since Statamic's default mode is flat-file, it could also be interesting to have a simple way to manage .gitignore files if we wanted, for example, to keep everything without a database, while still ensuring that content remains independent between environments. This could also be kind of preset "flat-config" or something.

That's probably a little opinionated for us to do in Core. As far as I know, most folks using flat file share the same content between sites.

However, you're more than welcome to do that in your own projects or create a starter kit that does that (although, that would be a very small kit 😄).

rtrudel commented 3 weeks ago

That's probably a little opinionated for us to do in Core. As far as I know, most folks using flat file share the same content between sites.

I understand the concern, and probably I just do not "get it", but I'm curious how a site would work when being modified by several developers working locally (so push/pull their changes without conflicts), while the site is in production and users or writers are modifying its content (ex: new articles, e-commerce orders, user comments and reviews, etc.). Why would we sync locally all the website content when only config matters on local environment? As I said, I'm just unsure to understand this bit, maybe the answer is very simple and I'm overcomplicating things...

ryanmitchell commented 3 weeks ago

That's probably a little opinionated for us to do in Core. As far as I know, most folks using flat file share the same content between sites.

I understand the concern, and probably I just do not "get it", but I'm curious how a site would work when being modified by several developers working locally (so push/pull their changes without conflicts), while the site is in production and users or writers are modifying its content (ex: new articles, e-commerce orders, user comments and reviews, etc.). Why would we sync locally all the website content when only config matters on local environment? As I said, I'm just unsure to understand this bit, maybe the answer is very simple and I'm overcomplicating things...

We often pull content down so we are working from the latest client content, especially when developing new functionality. You get around conflicts by using a branch other than main/master.