Skip to content

Gazler/hexdocs-search

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hexdocs Frontend

Hexdocs Frontend is using Lustre, a single-page application running in client, interacting with the backend through asynchronous HTTP requests.

Running a Lustre application can easily be achieved using Gleam and the Lustre Dev Tools. Lustre Dev Tools is a companion package to Lustre, in charge of compiling, bundling, and running the application in browser.

Configuration

The application uses environment variables to configure API endpoints. Before running the dev server or building, you must generate the configuration file:

cd config && gleam run -m config

This generates src/hexdocs/config.gleam with default URLs. To customize URLs for local development:

cd config && \
SEARCH_URL=http://localhost:9200 \
HEXDOCS_URL=http://localhost:4000 \
HEXPM_URL=http://localhost:4001 \
gleam run -m config

Launching the dev server

With Gleam installed on your path, you can directly start the development server using Lustre Dev Tools.

gleam run -m lustre/dev start

The application will be running at http://localhost:1234.

Building the application

Building the application can be done with the Lustre Dev Tools too.

gleam run -m lustre/dev build

Quick reminder of the structure

  • All source files reside in src folder.
  • There's no index.html in the sources, as the file is automatically generated by Lustre Dev Tools with the configuration written in gleam.toml.
  • hexdocs.css is the entrypoint for CSS for the application. Tailwind is setup in that file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Gleam 91.9%
  • JavaScript 2.8%
  • HTML 2.7%
  • CSS 2.6%