Project structure

The creation of a project with GOX generates a directories structure organized by responsibility.

Each directory has a specific purpose within the application.

text
hello/

├── app/
├── pages/
├── public/
├── tests/
│
└── gox.json

The folders client/, components/ and websocket/ are optional and are not initially created. createproject to see the minimum complete structure and when the optional areas are created.

In general terms:

  • app/ Set up the server.
  • pages/ defines HTTP routes.
  • components/ contains reusable components.
  • client/ contains components executed in the browser.
  • websocket/ defines communication in real time.
  • public/ It stores static files.
  • tests/ contains the project tests.

app/

The directory app/ contains the overall server configuration.

Here are aspects such as:

  • HTTP configuration
  • Static files
  • Sessions
  • Rate limiting
  • Home and server closure
  • WebSockets Settings
  • GOX Cluster

More information:


pages/

The directory pages/ contains the pages of the application.

Each file represents an HTTP route.

More information:


components/

The directory components/ contains reusable GOX components.

The components allow to organize reusable interfaces and keep the pages focused on the logic of each route.

More information:


client/

The directory client/ contains the Client Components.

These components run in the browser and can use frameworks such as React, Preact, Vue, Solid, Svelte or any other GOX compatible in the future.

More information:


websocket/

The directory websocket/ contains the behavior of the sockets, groups and channels of the application.

More information:


public/

Contains the static files of the application.

Ejemplos:

  • Images
  • CSS
  • JavaScript
  • Sources
  • downloadable files

More information:


tests/

The directory tests/ contains the application tests.

GOX incorporates tools to test pages, actions, components and other project elements.

More information:


gox.json

It contains the dependencies installed by the GOX CLI.

This file is automatically administered and should not be edited manually.

More information:

Next step

Continue with the documentation of the GOX language, where you will learn the extensions that GOX incorporates about the Go language.

The GOX language