adonisjs / v6-docs

Documentation website for AdonisJS v6
47 stars 76 forks source link

New structure proposal #80

Closed RomainLanz closed 2 months ago

RomainLanz commented 7 months ago

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:


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
Barbapapazes commented 7 months ago

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.

RomainLanz commented 7 months ago

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.

Barbapapazes commented 7 months ago

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!

tpoisseau commented 7 months ago

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
RomainLanz commented 7 months ago

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
britzdylan commented 7 months ago

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

RomainLanz commented 7 months ago

+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.

bitkidd commented 7 months ago

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.

Mizux commented 7 months ago

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
Foysal50x commented 7 months ago

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

tpoisseau commented 7 months ago

@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

RomainLanz commented 7 months ago

@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.

tpoisseau commented 7 months ago

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
RomainLanz commented 7 months ago

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

tpoisseau commented 7 months ago

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

ShahriarKh commented 7 months ago

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 commented 7 months ago

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

RomainLanz commented 7 months ago

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 commented 6 months ago

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

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
thetutlage commented 6 months ago

Yup, looks good.

A few things to note.

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:

aarhusgregersen commented 6 months ago

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

RomainLanz commented 6 months ago

πŸ‘‹πŸ»

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

SteveSimms commented 5 months ago

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/

RomainLanz commented 2 months ago

Closing since the changes have been applied.