Skip to content

[UX] New documentation hierarchy suggestion #884

@bpolaszek

Description

@bpolaszek

Hey there,

API-Platform is an ecosystem full of features and tools, but its documentation is growing fast, and it begins to lack of an appropriate structure to keep things tidy and clear.

I have identified several drawbacks on the current documentation that could lead astray newcomers:

  • The Api Component sublevels are far too many, and don't share the same level of importance (i.e NelmioApiDocBundle being sibling of Operations, for instance)

  • Starting by the Distribution makes look like Api-Platform can't work without a proper Docker setup and all the things (mercure, h2 push, varnish, let's encrypt, postgresql, ...), which isn't true.
    With the advent of Flex, everything is done in Symfony to make applications from simple to advanced: you only composer req the components you need.
    Beside, if we can assume the user has a minimal knowledge of Symfony (it is used under the hood along with Doctrine, share the same concepts, components and structure), Api-Platform can work without Docker, so we shouldn't add Docker into the learning curve if it's not mandatory.
    As a consequence, I think the distribution should not be the very starting point, but exposed as a great tool to get a full-featured environment.
    The starting point could be a simple composer req api && bin/console server:start, to focus on the API itself instead of its environment.
    In the meantime, example commands should not be prefixed by docker-compose exec.

  • Similarly, some components (schema generator, client generator, ...) are useful tools but may not deserve a top-level position in the documentation hierarchy (generators being useful doesn't mean they are necessary). It make them look like they're completely part of Api-Platform and you can't work without them, which is wrong. At least it makes you focus on the stack instead of the core.
    They could be grouped in a sub level and/or expanded in a separate documentation.

  • Some topics cover easy setup as well as advanced coding and configuration. While this might be a good idea at first glance, most of the time it leads to extremely scrollable pages and things the user doesn't want to read at this moment. It also makes the information hard to find when you're looking for something. Hacks and tricks should be moved away in a specific section, in my opinion (and linked from the main topics they're related to).

  • The documentation sections hierarchy should target newcomers at first, and go to experienced users at the end.

  • An F.A.Q. or How do I? section is really missing. Having such a section could also lead some developers to share their own recipes and help the community.


Read -> Install -> Configure -> Play -> Code -> Test -> Deploy -> Tune -> Hack

After thinking about this, I suggest the following key topics to drive the user from basics to advanced:

API-Platform

  1. Introduction

    State of the art, philosophy, features

  2. Installation

    On an existing project / new project / docker distribution

  3. Usage and configuration

    Schema generator, entity map, serialization, events, ...

  4. Pagination, filters and sorting

    You can start to play with your data

  5. Security

    JWT, FOSUserBundle, ACLs

  6. Exposing your API

    Versioning, deprecations, sunset, error messages, ...

  7. Consuming your API

    OpenAPI/Swagger export, GraphQL support, Client generators

  8. The Admin Component

    Big topic that should be kept handled apart

  9. Testing

    Fixtures, writing functional tests

  10. Deployment

    Kubernetes, Heroku, Platform.sh, ...

  11. Caching & performance optimization

    Cache invalidation, custom headers, Doctrine tips, PHP-PM, Blackfire

  12. Advanced Usage

    Custom operations/controllers, DTOs, custom filters, data providers/persisters, CQRS, ...

  13. How do I?

    Enable MongoDB, ElasticSearch, NelmioApiDocBundle, Mercure, file uploads, ...

  14. Troubleshooting

    Docker issues, Nginx issues, JMS serializer issues, links to SF Slack / Stackoverflow

A more detailed reorganization is available on this gist.

What do you think?

Sorry for the long post! 😅

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions