Git Product home page Git Product logo

legacy.adonisjs.com's Introduction

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.

legacy.adonisjs.com's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

legacy.adonisjs.com's Issues

Mistake in docs HasManyThrough

Hello!
THank you for awesome Lucid new version! It's great!

Seems to be mistake in has many through documentation

https://github.com/adonisjs/adonisjs.com/blob/develop/docs/docs/guides/database/04-relationships/06-has-many-through-relationship.md

export default class Country extends BaseModel {
  @hasManyThrough(() => Post, () => User)
  public posts: HasManyThrough<typeof Post>
}

instead

export default class Country extends BaseModel {
  @hasManyThrough([() => Post, () => User])
  public posts: HasManyThrough<typeof Post>
}

First parameter is array of two elements

export const hasManyThrough: HasManyThroughDecorator = ([relatedModel, throughModel], relation) 

https://github.com/adonisjs/lucid/blob/dc620118690962e9c5cac6c5be0d830f0191027d/src/Orm/Decorators/index.ts#L121

Thank you!

preview.adonisjs.com navigation bug.

It happens sometimes that routing doesn't work.
While the page is loading, try to spam the buttons, this seems to reproduce the bug. (It happens also without spamming sometimes)
Application gets stuck at the current page, unable to redirect.

And when navigation link is clicked console prompts us with TypeError: t.$context.doc.meta is null pointing at https://preview.adonisjs.com/assets/js/page--src--templates--blog-vue.07a3fa08.js:1

Yet, I was able to reproduce the issue once without triggering any errors in the console. Which was strange.

And I want to mention that I've experienced this behavior under the page 'Guides' while selecting sections.
For example clicking on a different section will change the website's path, but not the actual view.

Thank you for reading.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organiszation’s settings page, under Installed GitHub Apps.

No .env.example present

In the README.md it says "After that copy the .env.example file as .env and generate the secret key" but no .env.example exists.

Module 4.0 not cloned

After running git submodule update all the modules up to version 3 are cloned.

The this error message appears:

Cloning into '/home/jorge/Dropbox/www/adonisjs.com/content/4.1'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Add a Direct link to Github repo from Adonisjs.com Homepage

Not a bug neither a Feature. This is just a feedback about adonis homepage.

I saw the design request on opensourcedesign jobs > checked adonis site > found that the Github repo link is hidden 3 layers.

I understand developers would benefit if the github link is available quicker. User has to click on Get Started and at the lower end section there is a small text link.

As compared to other framework sites, where github star button and repo link are readily available without any interaction.

Example : React Js
Look at the explicit Github Link in top right.

image

I had initially created this issue in AdonisJS Framework repo Adonis Framework : Issue 995

Double curly brackets

One of the example causing error due to (maybe) Edge's regex that it assumes Double curly brackets as Mustache braces.

I just opened issue on Edge's repo too.

Recreating steps:

  1. Open Named Route Docs

  2. There is this example:

The same rules apply for the view.

<a href="{{ route('posts.show', { id: 1 }, {query: { foo: 'bar' }}) }}">Show post</a>

// href="/post/1?foo=bar"

  1. Try running it, you'd get error:

InvalidExpressionException E_INVALID_EXPRESSION: Invalid expression < route('posts.show', { id: 1 }, {query: { foo: 'bar' >

  1. Now separate those double curly brackets with one space char:

{query: { foo: 'bar' }} become {query: { foo: 'bar' } }

  1. Re-run, now it works.

Consider fix annoying scroll issue on docs pages

Hi!

I really liked your library, spend a lot of time on your docs, and each time I have to get back I need to fix the scrolling on the sidebar.

I think is kinda annoying that you have to scroll all the way up if I want to select a different link on the sidebar while reading the content

I've add this css to the sidebar

position: sticky;
top: 0;
max-height: 100vh;
overflow: auto;

And results on a better scroll interaction:

adonisjs

It's not a big deal tho, thanks for the great work!

Static files server don't work

Hi, i added "Adonis/Middleware/Static" to serverMiddleware const in start\kernel.js file, but static server files dont work.

I stopped and restart the server but still not working.

Possible Typo in Running Seeders Documentation

I read through the docs for Running seeders here and tried running:

# runs database/seeders/UserSeeder
node ace db:seed --file=UserSeeder

but that failed and then I tried

# runs database/seeders/UserSeeder
node ace db:seed --files=UserSeeder

which worked perfectly fine. I think this might be a minor typo. I'll be happy to create a PR to fix it.

Add sections for deployment

Have simple guide on how to deploy an adonisjs application with db to Heroku or DigitalOcean

Or maybe having a cookbook section with recipes that shows examples on how to integrate with 3-party services and more.

Add i18n on Adonis Page/Documentation

Since this project has been growing a lot at least in Brazilian Community i would like to suggest the addition of i18n support since most of them doesnt know English well.

Btw: i'm willing to help you guys on the ptBR translation if needed.

Premium Sponser tag obscures footer content

Just logging a quick here, when scrolling through the website i found that the premium contributors tag seems to be obscuring content on the page and on scrolling all the way down, it tends to sit over the footer and obscures the creator's name.

Screenshot

screenshot

This could be fixed by adding some sort of a opacity filter to the banner or to shift it to some place else, would love to contribute on this and take up this issue 🥇

Adonis 4.0 Docs

Hi, Is it possible to get 4.0 (dawn) docs on the website?

Site won't run locally

adonis serve --dev has no output. Can't access at localhost:3000 or anything. Following exact commands from the readme, on Ubuntu.

Footer notes correction

You might wanna change Developer by Harminder Virk to Developed by Harminder Virk in the footer.

Incorrect method shown for Route.resource

In the screenshot on the docs page, the controller method to go with the DELETE verb is shown as delete. However, with the latest preview version of AdonisJS (5.0.0-preview-rc-1.5) this method is named destroy and trying to use delete results in errors.

The docs:

My output:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.