• This repository has been archived on 28/Sep/2021
  • Stars
    star
    170
  • Rank 215,538 (Top 5 %)
  • Language Vue
  • Created over 6 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🕸 Source Code of the old AdonisJS website

AdonisJs.com

Source code for the official website

This repo contains two sub-projects frontend and docs and as the name suggests, they hold the source code for the respective areas.

  • The frontend is the Gridsome website
  • The docs are the Markdown files compiled using dimer.

Quick Start

Before we get into the philosophy of how everything works together, let's get you up and running. Assuming you have cloned the repo, run the following instructions.

  • cd <clone-path>
  • Run chmod +x setup.sh and then execute ./setup.sh file to setup the project.
  • Run ./develop.sh to start the development server.

Why Gridsome?

If you are familiar with Gridsome or even Gatsby, then you would know that many people choose either of them for their GraphQL API. However, we didn't choose it for GraphQL at all.

The main reason for using Gridsome is that it can take the Vue.js source code and convert them into static HTML pages. While doing so, it let us create dynamic pages programmatically. For example:

  1. We have 10 markdown files converted to JSON (in a seperate application)
  2. We want to use those JSON files with a vue template and render them on the browser.
  3. During development we want the vue templates to re-compile a doc is changed.
  4. For production, we want vue templates to be converted to standard HTML pages. So that we don't need the markdown API service anymore.

And guess what, Gridsome does all this in the most simplest possible way.

Build process

In order to understand the build process, you will have to start from the markdown compilation flow.

Markdown Compilation Flow

We make use of dimer to convert Markdown to an API server. So, if you run this application with command ./develop.sh and then visit http://localhost:5000, you will see a playground to explore the API.

Converting markdown to JSON instead of HTML has lots of benefits.

  1. The HTML structure is not proprietary and you have complete freedom to structure the HTML the way you want. Today we are using Gridsome, tomorrow we can easily switch to something else and the markdown build process doesn't have to change for that.
  2. We get native search support. In standard static websites, people first convert Markdown to HTML and then scrape the HTML to create JSON documents for adding search.

Gridsome Consuming the Dimer API

At this point we are clear that, dimer handles all the markdown files, converts them to JSON and any client can consume it via the HTTP server.

Now, the Job of Gridsome is to make use of the HTTP API and create pages from it. Luckily Gridsome has first class support for that.

Inside frontend/gridsome.server.js file, we make use of axios to make an API call to the dimer server and then use the Gridsome API to create the static pages from it.

Rebuilds during Development

Since, we are relying on a different process to gives us the content for creating the pages. There is no way for the Gridsome to know when the content has been changed. Luckily, Dimer allows creating Websocket connections in the development mode and we can subscribe to Websocket events inside frontend/gridsome.server.js file and trigger a re-build. This is how it works.

  1. Make a websocket connection with the Dimer server inside frontend/gridsome.server.js.
  2. Everytime an event is received, make use of the Gridsome removePageByPath and createPage API to re-build that specific page.

And voila! We have instant feedback during development.

Gridsome Structure

The Gridsome codebase is a standard Vuejs or Gridsome website stored inside the frontend directory.

  • We keep all the resuable components inside the src/components directory.
  • All static pages (not built programmatically) inside the src/pages directory.
  • Templates for dynamic pages inside the src/templates directory.
  • A standard Layout for the complete website is in src/layouts directory.

Dimer Structure

The docs directory holds the Markdown files along with the dimer.json file. The dimer.json is the config file for dimer to define structure for the docs.

Dimer has concept of zones and versions.

  • A zone means a boundary between different types of documentation. For example: A zone for guides and a zone for api docs and so on.
  • Within each zone, you can have one or more versions for the documentation. Do not confuse versions with version control, it means a new set of markdown files for a specific version of the framework.
  • The versions for each zone can evolve independently.

More Repositories

1

core

AdonisJS is a TypeScript-first web framework for building web apps and API servers. It comes with support for testing, modern tooling, an ecosystem of official packages, and more.
TypeScript
15,023
star
2

lucid

AdonisJS SQL ORM. Supports PostgreSQL, MySQL, MSSQL, Redshift, SQLite and many more
TypeScript
937
star
3

adonis-app

Application structure for new adonis app, think of it as scaffolding a new project
JavaScript
372
star
4

ace

Node.js framework for creating command line applications
TypeScript
339
star
5

legacy-docs

📄 The official documentation of AdonisJs
186
star
6

auth

Official Authentication package for AdonisJS
TypeScript
179
star
7

persona

Opinionated user management service for AdonisJs
JavaScript
172
star
8

adonis-fullstack-app

AdonisJS 4 - The fullstack application boilerplate for AdonisJS
JavaScript
161
star
9

ally

AdonisJS Social Authentication Provider
TypeScript
147
star
10

adonis-cli

Legacy Adonis CLI module to generate new application
JavaScript
132
star
11

adonis-api-app

AdonisJS 4 - Boilerplate for API server with pre-configured JWT
JavaScript
131
star
12

validator

Schema based validator for AdonisJS
TypeScript
112
star
13

fold

IoC container with all required goodies to write flexible node applications
TypeScript
111
star
14

lucid-slugify

Generate unique slugs using your Lucid models
TypeScript
97
star
15

mail

AdonisJS Email Provider
TypeScript
94
star
16

http-server

AdonisJS HTTP Server along with its Router
TypeScript
93
star
17

repl

Framework Agnostic REPL For Node.js. Used by AdonisJS
TypeScript
92
star
18

v5-docs

📚 Source code and documentation for the official docs website.
TypeScript
87
star
19

adonis-rally

Adonis rally is a forum engine written using AdonisJs.
JavaScript
87
star
20

attachment-lite

Turn any field on your Lucid models to an attachment data type
TypeScript
71
star
21

adonis-websocket

Official websocket provider for AdonisJs
JavaScript
61
star
22

redis

Package for working with Redis in AdonisJS
TypeScript
59
star
23

vow

Test Runner For AdonisJs
JavaScript
55
star
24

adonis-websocket-client

Websocket client for AdonisJs framework.
JavaScript
51
star
25

rfcs

💬 Sharing big changes with community to add them to the AdonisJs eco-system
51
star
26

discussion

Discussing about new features and sharing random thoughts: ⚠️ Not every request will be accepted
50
star
27

drive

Filesystem provider built on top of node-flydrive
TypeScript
49
star
28

bouncer

Authorization Package for AdonisJS
TypeScript
47
star
29

shield

A middleware for AdonisJS to keep web applications secure from common web attacks
TypeScript
46
star
30

i18n

Internationalization module for AdonisJs. Supports file and database drivers
TypeScript
43
star
31

adonis-websocket-protocol

A document describing the protocol for Adonis websocket server
37
star
32

vite

⚡Vite plugin for AdonisJS
TypeScript
35
star
33

application

AdonisJS application class to read app related data
TypeScript
34
star
34

route-model-binding

Add route model binding to your AdonisJS applications
TypeScript
33
star
35

adonis-documentation

The documentation website source code hosted on http://adonisjs.com
CSS
32
star
36

session

Package for dealing with HTTP sessions in AdonisJS apps
TypeScript
32
star
37

bodyparser

BodyParser Middleware For AdonisJS
TypeScript
31
star
38

assembler

A development toolkit used by AdonisJS to perform tasks like starting the dev server in watch mode, running tests in watch mode, and applying codemods to modify source files
TypeScript
31
star
39

sink

Development Toolbox for AdonisJS providers
TypeScript
30
star
40

limiter

The official rate limiter package for AdonisJS
TypeScript
30
star
41

require-ts

In memory typescript compiler with disk caching
TypeScript
28
star
42

env

Framework agnostic environment variables parser and validator
TypeScript
27
star
43

transmit

A Server-Sent-Event module for AdonisJS
TypeScript
27
star
44

adonis-slim-app

AdonisJS 4 - Smallest possible application for Adonisjs
JavaScript
27
star
45

mrm-preset

This repo is the preset used to AdonisJs team to manage and keep their config in sync.
JavaScript
24
star
46

adonis-http-logger

AdonisJs logger to log http requests
JavaScript
22
star
47

view

Template Engine For AdonisJS
TypeScript
20
star
48

logger

AdonisJS Logger built on top of pino
TypeScript
19
star
49

adonis-commands

Set of core commands for adonis framework
JavaScript
19
star
50

drive-s3

S3 driver for AdonisJS drive
TypeScript
19
star
51

encryption

Data encryption service for AdonisJS
TypeScript
18
star
52

events

Event emitter with asynchronous events.
TypeScript
18
star
53

adonis-ignitor

Library that gives fire to start AdonisJs application
JavaScript
18
star
54

hash

Multi driver hashing module following PHC string format
TypeScript
16
star
55

errors

Information about exceptions thrown by AdonisJs
15
star
56

create-adonisjs

Scaffolding tool to create AdonisJS 6 projects
TypeScript
15
star
57

ioc-transformer

Typescript transformer to transform import statements to IoC container use calls
TypeScript
13
star
58

adonis-addon

This repo contains a small boilerplate to create addons/providers for AdonisJs
13
star
59

pkg-starter-kit

AdonisJS starter kit to create a new package
TypeScript
13
star
60

profiler

Profile to time function calls with context in AdonisJS
TypeScript
12
star
61

vow-browser

Browser client for the adonis vow
JavaScript
12
star
62

web-starter-kit

Starter kit for creating traditional server rendered applications using AdonisJS
TypeScript
11
star
63

config

Config management provider used by AdonisJS framework
TypeScript
11
star
64

v6-docs

Documentation website for AdonisJS v6
TypeScript
11
star
65

adonis-middleware

List of official middleware for adonis framework
JavaScript
10
star
66

adonis-websocket-packet

Library to create and validate AdonisJs websocket packets
JavaScript
10
star
67

adonis-generic-exceptions

A module with all generic exceptions other modules can use
TypeScript
10
star
68

adonis-cors

Cors middleware for Adonisjs
JavaScript
9
star
69

static

Static files server middleware for AdonisJS
TypeScript
8
star
70

transmit-client

A client for the native Server-Sent-Event module of AdonisJS
TypeScript
8
star
71

v5_to_v6_upgrade_guide

Migration Guide to AdonisJS v6
TypeScript
8
star
72

adonis-manager

Base manager class others parts can use to expose driver based API
TypeScript
7
star
73

slim-starter-kit

Smallest possible AdonisJS application with just the framework core and the Japa test runner
TypeScript
7
star
74

drive-gcs

Google cloud storage driver for AdonisJS drive
TypeScript
6
star
75

adonis-loggly

Loggly transporter for AdonisJs Logger
JavaScript
6
star
76

cors

CORS middleware implementation
TypeScript
6
star
77

presets

A collection of presets to configure AdonisJS packages
TypeScript
6
star
78

adonisjs.com

Source code for the AdonisJS website
TypeScript
6
star
79

adonis-middleware-base

Very specific code written to make middleware work with Http and Websocket server.
JavaScript
5
star
80

adonis-msgpack-encoder

Msgpack encoder to Adonis Websocket server
JavaScript
4
star
81

upgrade-kit

CLI tool for migrating from Adonis.js 5 to Adonis.js 6
TypeScript
4
star
82

adonis-binding-resolver

Adonis binding resolver to resolve custom bindings in adonis apps - Check Readme
JavaScript
3
star
83

lucid.adonisjs.com

Documentation for Lucid
TypeScript
3
star
84

api-starter-kit

Starter kit for creating JSON API server using AdonisJS
TypeScript
3
star
85

.github

2
star
86

encore

Webpack Encore integration package for AdonisJS
TypeScript
2
star
87

tooling-config

Eslint, prettier, and typescript configurations for AdonisJS projects
TypeScript
2
star