|
|
||
|---|---|---|
| .continue/rules | ||
| .github/workflows | ||
| client | ||
| server | ||
| shared | ||
| .dockerignore | ||
| .gitignore | ||
| .tool-versions | ||
| Dockerfile | ||
| justfile | ||
| README.md | ||
Fullstack Gleam
-
client/: Contains all client-side code written in Gleam that compiles to JavaScript.
src/main.gleam: The entry point for the client application- Other modules contain UI components, state management, and client logic
- Uses the Lustre framework for Elm-like components with reactive state management
-
server/: Contains server-side code written in Gleam that compiles to Erlang.
src/main.gleam: The entry point for the server application- Other modules contain API endpoints, business logic, and database interactions
- Uses Wisp/Mist for routing and API handling
-
shared/: Contains code shared between client and server.
- Typically includes type definitions, utility functions, and constants
- Ensures consistent data structures across both environments
Dependencies
Install asdf, and add the erlang, gleam, and just plugins. Then run the following in the root of this repository:
asdf install
Development
You can build the client code and run the fullstack development environment with the following:
just dev-server
Gleam doesn't officially support Erlang's hot code reloading, so you'll need to stop and restart the server for any changes made in the client/server/shared code.
However, if you're only iterating over client-side code, you can run it standalone with lustre_dev_tools's hot code reloading with the following:
just dev-client
There won't be hot code reloading for your server/shared code. and won't be served by your server project.
Running Tests
just test-all
Check the test folder in server/client/shared to see how to write tests for each one.
Deployment
just deploy
Then follow Lustre's Full Stack Deployments Guide.