v6-docs icon indicating copy to clipboard operation
v6-docs copied to clipboard

New structure proposal

Open RomainLanz opened this issue 1 year ago β€’ 23 comments

Hey there! πŸ‘‹πŸ»

As discussed internally with the core team, I want to revamp how the documentation is structured.

I mainly took example on an internal proposal I made for AdonisJS 3 documentation, current AdonisJS 4 and 5 documentation and Laravel documentation.

The end goal is to have something simple for newcomers to go through, and even for recurring users without loosing any content. I believe we split a bit too much some information across many pages, so I merged a few sections together (like we had in AdonisJS 5 documentation)

A complete structure can be found at the end of this message.

On a side note, this structure has been made during a live stream in front of ~100 people. They also gave feedback and thought to build this new structure.

This proposal will go through each section, point by point, explaining its content and its goal.

Legend:

  • (From: *) - If the name has been changed, this will contain the old name OR it help to distinguish the content if we have the same name multiple time
  • (+ *) - We are merging content
  • (New) - New content we have to write
  • (~New) - New content we have to gather from other pages
  • (PR) - New content with a PR
  • (Previously: *) - Proposal for a rename
  • (?) - Not sure if needed here

Preface
β”œβ”€β”€ Introduction (From: Getting Started - Introduction)
β”œβ”€β”€ FAQ
β”œβ”€β”€ Governance
β”œβ”€β”€ Release Notes
└── Contribution Guide

This section is ordered in a logical way.

The goal of this section is to provide all "meta" information about the framework. Its philosophy, faq, governance status, etc.


Getting Started
β”œβ”€β”€ Installation (From: Getting Started - Installation)
β”œβ”€β”€ Configuration
β”œβ”€β”€ Environment Variables
β”œβ”€β”€ Folder Structure
└── Deployment (From: AdonisJS 4 - Deployment)

This section is ordered in a logical way.

The goal of this section is to have a Zero to Production information for a minimum setup. I believe all sub-sections are needed to have a minimum understanding of all the defaults boilerplate.


AdonisJS Concepts
β”œβ”€β”€ Application
β”œβ”€β”€ Application Lifecycle
β”œβ”€β”€ Config Providers
β”œβ”€β”€ RC Files
β”œβ”€β”€ Service Container
└── Scaffolding

This section is ordered by alphabetical order.

The goal of this section is to explain concepts linked to AdonisJS and how we structured our and the application code.


Architecture Concepts
β”œβ”€β”€ Async Local Storage
β”œβ”€β”€ Dependency Injection (Previously: IoC Container )
β”œβ”€β”€ HMR (PR)
β”œβ”€β”€ Http Context
β”œβ”€β”€ Request Lifecycle (From: HTTP - Introduction)
└── Service Providers

This section is ordered by alphabetical order.

The goal of this section is to explain common architectural concepts we may found in other frameworks.


Basics
β”œβ”€β”€ Routing (+ URL Building)
β”œβ”€β”€ Controllers
β”œβ”€β”€ Middleware
β”œβ”€β”€ Requests (+ BodyParser middleware)
β”œβ”€β”€ Response
β”œβ”€β”€ Validation
β”œβ”€β”€ File Upload
β”œβ”€β”€ Session
β”œβ”€β”€ Cookies
β”œβ”€β”€ Exception Handling
└── Static Assets (Assets bundling + Static server)

This section is ordered in a logical way.

The goal of this section is to contain anything relative for building simple project. Nearly all of those features are needed for a standard SSR application.


Database
β”œβ”€β”€ Introduction (~New - From: SQL and ORMs)
β”œβ”€β”€ Lucid ORM (~New - From: SQL and ORMs)
└── Redis

This section is ordered in a logical way.

The goal of this section is to contain anything related to database you may want to use with AdonisJS. In the feature, we may add Kysely or Prisma there for example.


Authentication
β”œβ”€β”€ Introduction (From: Authentication - Introduction)
β”œβ”€β”€ User Providers (+ Verifying user credentials)
β”œβ”€β”€ Auth Guards (+ all the guards doc)
└── Social Authentication

This section is ordered in a logical way.

Another proposal for this section would be to keep all the auth guard separated:

β”œβ”€β”€ Session Guard
β”œβ”€β”€ Access Token Guard
β”œβ”€β”€ Basic Auth Guard
β”œβ”€β”€ Custom Auth Guard

The goal of this section is to contain anything related to authentication.


Security
β”œβ”€β”€ Introduction (New)
β”œβ”€β”€ Authorization
β”œβ”€β”€ Encryption
β”œβ”€β”€ Hashing
β”œβ”€β”€ Signed URLs (?)
β”œβ”€β”€ Web Security (+ CORS + Securing SSR apps)
└── Rate Limiting

This section is ordered in a logical way.

The goal of this section is to contain anything related to securing an application.


Views & Templates
β”œβ”€β”€ Introduction (~New - From:  HTTP - Views and Templates)
β”œβ”€β”€ EdgeJS (~New - From:  HTTP - Views and Templates)
└── InertiaJS (From: Experimental - InertiaJS)

This section is ordered in a logical way.

The goal of this section is to contain anything related to views and templates. We may add TSX or KitaJS in the future in this section.


Testing
β”œβ”€β”€ Introduction
β”œβ”€β”€ Http Tests
β”œβ”€β”€ Browser Tests
β”œβ”€β”€ Console Tests
β”œβ”€β”€ Database
└── Mocks & Fakes

This section is ordered in a logical way.

The goal of this section is to contain anything related to testing. No real change from what we have right now.


Digging Deeper
β”œβ”€β”€ Ace Commands (+merge all doc)
β”œβ”€β”€ Caching (New)
β”œβ”€β”€ Emitter
β”œβ”€β”€ I18n
β”œβ”€β”€ Locks
β”œβ”€β”€ Logger
β”œβ”€β”€ Mail (+merge all doc)
β”œβ”€β”€ Transmit (PR)
└── Extending the framework

This section is ordered by alphabetical order except the last point.

The goal of this section is to contain anything that is less used than the Basic section to make an application. The goal is keep one page per feature.

Also, Ace Commands will probably move to its own website.


API References
└── NO CHANGE

No change for this section.


Internals
β”œβ”€β”€ Tooling Config
└── TypeScript Build

This section is ordered by alphabetical order.

The goal of this section is to contain anything not directly related to people's application. Internal process.


Experimentals
└── NO CHANGE

No change for this section.


FINAL SIDEBAR

Preface
β”œβ”€β”€ Introduction
β”œβ”€β”€ FAQ
β”œβ”€β”€ Governance
β”œβ”€β”€ Release Notes
└── Contribution Guide

Getting Started
β”œβ”€β”€ Installation
β”œβ”€β”€ Configuration
β”œβ”€β”€ Environment Variables
β”œβ”€β”€ Folder Structure
└── Deployment

AdonisJS Concepts
β”œβ”€β”€ Application
β”œβ”€β”€ Application Lifecycle
β”œβ”€β”€ Config Providers
β”œβ”€β”€ RC Files
β”œβ”€β”€ Service Container
└── Scaffolding

Architecture Concepts
β”œβ”€β”€ Async Local Storage
β”œβ”€β”€ Dependency Injection
β”œβ”€β”€ HMR
β”œβ”€β”€ Http Context
β”œβ”€β”€ Request Lifecycle
└── Service Providers

Basics
β”œβ”€β”€ Routing
β”œβ”€β”€ Controllers
β”œβ”€β”€ Middleware
β”œβ”€β”€ Requests
β”œβ”€β”€ Response
β”œβ”€β”€ Validation
β”œβ”€β”€ File Upload
β”œβ”€β”€ Session
β”œβ”€β”€ Cookies
β”œβ”€β”€ Exception Handling
└── Static Assets

Database
β”œβ”€β”€ Introduction
β”œβ”€β”€ Lucid ORM
└── Redis

Authentication
β”œβ”€β”€ Introduction
β”œβ”€β”€ User Providers
β”œβ”€β”€ Auth Guards
└── Social Authentication

Security
β”œβ”€β”€ Introduction
β”œβ”€β”€ Authorization
β”œβ”€β”€ Encryption
β”œβ”€β”€ Hashing
β”œβ”€β”€ Signed URLs
β”œβ”€β”€ Web Security
└── Rate Limiting

Views & Templates
β”œβ”€β”€ Introduction
β”œβ”€β”€ EdgeJS
└── InertiaJS

Testing
β”œβ”€β”€ Introduction
β”œβ”€β”€ Http Tests
β”œβ”€β”€ Browser Tests
β”œβ”€β”€ Console Tests
β”œβ”€β”€ Database
└── Mocks & Fakes

Digging Deeper
β”œβ”€β”€ Ace Commands
β”œβ”€β”€ Caching
β”œβ”€β”€ Emitter
β”œβ”€β”€ I18n
β”œβ”€β”€ Locks
β”œβ”€β”€ Logger
β”œβ”€β”€ Mail
β”œβ”€β”€ Transmit
└── Extending the framework

API References
└── NO CHANGE

Internals
β”œβ”€β”€ Tooling Config
└── TypeScript Build

Experimentals
└── NO CHANGE

RomainLanz avatar Apr 18 '24 21:04 RomainLanz

What a great improvement! I'm pleased to see this proposal!

For the HMR page, I'd rather see it in the internal tooling section more than in the architecture concept since it's just a flag with the serve command and this does not impact how the dev will use Adonis.

Barbapapazes avatar Apr 19 '24 05:04 Barbapapazes

For the HMR page, I'd rather see it in the internal tooling section more than in the architecture concept since it's just a flag with the serve command and this does not impact how the dev will use Adonis.

I place it here because it is a concept linked to Node.js (not AdonisJS). However, it could also go inside the Internal section since it is not something someone has to know.

RomainLanz avatar Apr 19 '24 05:04 RomainLanz

Extending the framework could be a separate section since this could cover extentions for a module like the HTTP request, Vine, a new social auth AND having a page dedicated to how dev can create externals and sharables modules.

Customization is one of the strength of the framework and it should really be highlighted in the nav!

Barbapapazes avatar Apr 19 '24 06:04 Barbapapazes

SGTM, I suggest to separate Auth Guards in to sub-pages

Authentication
β”œβ”€β”€ Auth Guards # generic information about auth guards, how to apply, and name them.
    β”œβ”€β”€ Session Guard
    β”œβ”€β”€ Access Token Guard
    β”œβ”€β”€ Basic Auth Guard
    β”œβ”€β”€ Custom Auth Guard

tpoisseau avatar Apr 19 '24 07:04 tpoisseau

SGTM, I suggest to separate Auth Guards in to sub-pages

Authentication
β”œβ”€β”€ Auth Guards # generic information about auth guards, how to apply, and name them.
    β”œβ”€β”€ Session Guard
    β”œβ”€β”€ Access Token Guard
    β”œβ”€β”€ Basic Auth Guard
    β”œβ”€β”€ Custom Auth Guard

Do you mean the second proposal or to have a third level in the sidebar? Because you mixed the two in your message.

First Proposal: merge all guard documentation under the same page Auth Guards

Authentication
β”œβ”€β”€ Introduction
β”œβ”€β”€ User Providers
β”œβ”€β”€ Auth Guards
└── Social Authentication

Second Proposal: keep the guard documentation separated on their own page

Authentication
β”œβ”€β”€ Introduction
β”œβ”€β”€ User Providers
β”œβ”€β”€ Session Guard
β”œβ”€β”€ Access Token Guard
β”œβ”€β”€ Basic Auth Guard
β”œβ”€β”€ Custom Auth Guard
└── Social Authentication

The goal was to replicate a schema I showed during meetup/talk.

StrasbourgJS Adonis 6

RomainLanz avatar Apr 19 '24 10:04 RomainLanz

+1 for me, I think is a great change! I think one thing we are missing as a community is more example projects.

britzdylan avatar Apr 19 '24 10:04 britzdylan

+1 for me, I think is a great change! I think one thing we are missing as a community is more example projects.

This is planned as part of our "Bootcamp" project.

RomainLanz avatar Apr 19 '24 10:04 RomainLanz

Nice one! The only thing I would change: Preface -> General. Feels like the word β€œGeneral” gives a little bit more freedom to put inside it something more general about the framework. And I would not shy off from adding β€œDonations” section into it.

bitkidd avatar Apr 19 '24 10:04 bitkidd

nit: in

Preface
β”œβ”€β”€ Introduction (From: Getting Started - Introduction)
β”œβ”€β”€ FAQ
β”œβ”€β”€ Governance
β”œβ”€β”€ Release Notes
└── Contribution Guide

I would put FAQ and Release Notes closer (imho something not in the release note should be in the FAQ and vice versa) while Contribution Guide should follow the Governance (gouvernance could impact the contrib policy imho)

Proposal

Preface
β”œβ”€β”€ Introduction (From: Getting Started - Introduction)
β”œβ”€β”€ FAQ
β”œβ”€β”€ Release Notes
β”œβ”€β”€ Contribution Guide
└── Governance

Mizux avatar Apr 19 '24 12:04 Mizux

This is really cool πŸ‘ 1+ for me

Foysal50x avatar Apr 19 '24 12:04 Foysal50x

@RomainLanz

Do you mean the second proposal or to have a third level in the sidebar? Because you mixed the two in your message.

I mean have a third level in the sidebar

tpoisseau avatar Apr 19 '24 12:04 tpoisseau

@RomainLanz

Do you mean the second proposal or to have a third level in the sidebar? Because you mixed the two in your message.

I mean have a third level in the sidebar

In my opinion, that will clutter the sidebar too much and it is not currently doable in our documentation software.

RomainLanz avatar Apr 19 '24 12:04 RomainLanz

What do you think about make an "Auth Guards" or "Authentication Guards" section ?

Authentication
β”œβ”€β”€ Introduction
β”œβ”€β”€ User Providers
└── Social Authentication

Auth Guards
β”œβ”€β”€ Introduction
β”œβ”€β”€ Session Guard
β”œβ”€β”€ Access Token Guard
β”œβ”€β”€ Basic Auth Guard
└── Custom Auth Guard

tpoisseau avatar Apr 19 '24 12:04 tpoisseau

If we do that, we are splitting the content again, which I want to avoid. What are your goals with this change?

RomainLanz avatar Apr 19 '24 12:04 RomainLanz

better readability and discoverability, avoiding put too much content in a single page.

tpoisseau avatar Apr 19 '24 12:04 tpoisseau

I think a section like tutorial or recipes will be great for newcomers. The current docs is more of an API reference, and if you want to implement something in your app, you have to watch videos (which are great, but doesn't cover cases where you need a quick look or prefer text content) or dig the docs and connect the puzzle pieces by yourself.

ShahriarKh avatar Apr 19 '24 12:04 ShahriarKh

Something like: https://docs.strapi.io/dev-docs/quick-start https://nextjs.org/learn/dashboard-app

ShahriarKh avatar Apr 19 '24 12:04 ShahriarKh

better readability and discoverability, avoiding put too much content in a single page.

Then you want the second solution. Otherwise, we are cluttering the sidebar too much, and people will be lost with too much section.

Also, having more content on the same page has never been an issue. It allows you to easily search and avoid switching back and forth on multiple pages. You want to learn about "Auth Guard"? Go to the "Auth Guard" section and start to read from here.

For example, this is done in AdonisJS 5 or Laravel for the Mail section, and it was fine.

I think a section like tutorial or recipes will be great for newcomers. The current docs is more of an API reference, and if you want to implement something in your app, you have to watch videos (which are great, but doesn't cover cases where you need a quick look or prefer text content) or dig the docs and connect the puzzle pieces by yourself.

This is not the goal of the documentation and is already planned in the Bootcamp project.

The documentation will not teach you how to build an app from scratch. For that, we plan to write step-by-step tutorials that teach you how to build a specific app using the framework.

RomainLanz avatar Apr 19 '24 12:04 RomainLanz

We got an internal discussion today, here is the latest feedback and final structure we will use.

  • We are going to merge AdonisJS Concepts and Architecture Concepts
  • Rename Request Lifecycle to Http Overview
  • We keep the Bodyparser section outside of Requests
  • We don't merge Assets Bundling and Static File Server
  • We renameAssets Bundling to Vite
  • We move the Internals section to Concepts
  • We move Extending the framework to Concepts
  • We move Repl to Digging Deeper

Final structure:

Preface
β”œβ”€β”€ Introduction
β”œβ”€β”€ FAQ
β”œβ”€β”€ Governance
β”œβ”€β”€ Release Notes
└── Contribution Guide

Getting Started
β”œβ”€β”€ Installation
β”œβ”€β”€ Configuration
β”œβ”€β”€ Environment Variables
β”œβ”€β”€ Folder Structure
└── Deployment

Concepts
β”œβ”€β”€ Async Local Storage
β”œβ”€β”€ Application
β”œβ”€β”€ Application Lifecycle
β”œβ”€β”€ Config Providers
β”œβ”€β”€ Container Services
β”œβ”€β”€ Dependency Injection
β”œβ”€β”€ Extending the framework
β”œβ”€β”€ HMR
β”œβ”€β”€ Http Overview
β”œβ”€β”€ Http Context
β”œβ”€β”€ RC Files
β”œβ”€β”€ Service Providers
β”œβ”€β”€ Scaffolding
β”œβ”€β”€ Tooling Config
└── TypeScript Build

Basics
β”œβ”€β”€ Routing
β”œβ”€β”€ Controllers
β”œβ”€β”€ Middleware
β”œβ”€β”€ Bodyparser
β”œβ”€β”€ Requests
β”œβ”€β”€ Response
β”œβ”€β”€ Validation
β”œβ”€β”€ File Upload
β”œβ”€β”€ Session
β”œβ”€β”€ Cookies
β”œβ”€β”€ Exception Handling
β”œβ”€β”€ Vite
└── Static Assets

Database
β”œβ”€β”€ Introduction
β”œβ”€β”€ Lucid ORM
└── Redis

Authentication
β”œβ”€β”€ Introduction
β”œβ”€β”€ User Credentials
β”œβ”€β”€ Session Guard
β”œβ”€β”€ Access Token Guard
β”œβ”€β”€ Basic Auth Guard
β”œβ”€β”€ Custom Auth Guard
└── Social Authentication

Security
β”œβ”€β”€ Introduction
β”œβ”€β”€ Authorization
β”œβ”€β”€ Encryption
β”œβ”€β”€ Hashing
β”œβ”€β”€ Signed URLs
β”œβ”€β”€ Web Security
└── Rate Limiting

Views & Templates
β”œβ”€β”€ Introduction
β”œβ”€β”€ EdgeJS
└── InertiaJS

Testing
β”œβ”€β”€ Introduction
β”œβ”€β”€ Http Tests
β”œβ”€β”€ Browser Tests
β”œβ”€β”€ Console Tests
β”œβ”€β”€ Database
└── Mocks & Fakes

Digging Deeper
β”œβ”€β”€ Ace Commands
β”œβ”€β”€ Caching
β”œβ”€β”€ Emitter
β”œβ”€β”€ I18n
β”œβ”€β”€ Locks
β”œβ”€β”€ Logger
β”œβ”€β”€ Mail
β”œβ”€β”€ Transmit
└── Repl

Ace Commands
└── NO CHANGE

API References
└── NO CHANGE

Experimentals
└── NO CHANGE

RomainLanz avatar Apr 24 '24 19:04 RomainLanz

Yup, looks good.

A few things to note.

  • User Credentials should be Verifying user credentials because the term "User Credentials" does not convey anything.
  • Release Notes should be Releases because we list the releases only here, and the notes are on Github.
  • TypeScript Build should be TypeScript build process to complete the sentence.
  • In security, we are missing CORS.
  • Again, I prefer "Securing SSR apps" over "Web security". Aligns more with the intent of the doc.
  • There won't be Ace Commands in digging deeper for now. Until we move Ace docs to its own website.

Also, I noticed that you went with "Title case" in all the topic names. However, currently, the documentation follows the "Sentence case". There is nothing wrong with either of those. Even from the English point of view, both are technically correct. But for consistency, we should stick with "Sentence case."

Finally, once we move content around. We should double-check:

  • If any URLs are changing and must define redirects for them.
  • Also, update internal links if the content files are moved to different folders. Right now, the links are resolved from the location of the file.

thetutlage avatar Apr 26 '24 04:04 thetutlage

This is amazing work! Well done, much respect πŸ™ I believe the final version is much clearer than the previous docs.

aarhusgregersen avatar Apr 26 '24 19:04 aarhusgregersen

πŸ‘‹πŸ»

You are invited to give your feedback on the PR: https://github.com/adonisjs/v6-docs/pull/86

You can see the changes there: https://feat-new-structure.v6-docs.pages.dev/guides/preface/introduction

RomainLanz avatar May 01 '24 11:05 RomainLanz

Something like:

https://docs.strapi.io/dev-docs/quick-start

https://nextjs.org/learn/dashboard-app

I agree with this. Something like the laravel bootcamp would be super helpful for new comers to get up and running.

https://bootcamp.laravel.com/

SteveSimms avatar Jun 10 '24 21:06 SteveSimms

Closing since the changes have been applied.

RomainLanz avatar Sep 02 '24 10:09 RomainLanz