raleigh
raleigh
Status
Table of Contents
Requirements
You'll need the following on your system:
crystalversion>=1.6.0shardsversion>=0.17.1nodeversion>=16.14.2npmversion>=8.5.0
The tool that raleigh uses to watch files for changes is called reflex and it's a zero dependency Go tool that weighs ~3MB. You can learn more about reflex in it's official repository.
The project uses the reflex binary which is shipped in the ./bin directory. If you want to fetch reflex from source and build it yourself, make sure you use reflex version 0.3.1 and place the binary in ./bin directory.
Workflow
To get started, install the dependencies that are defined in shards.yml and ./src/package.json.
- Install server dependencies
shards install
- Install client dependencies
npm i
You're now ready to work on the project. All the commands available reside in the Makefile. You'll find a list of some of the commands that you'll use regularly in the next sections.
Development
make watch/clientto watch and trigger a live reload on changes tojs|jsx|scssfiles.make watch/serverto watch and trigger a live reload on changes tocr|ecrfiles.make watch/allto run the previous two commands in parallel. You'll use this.
Environment Variables:
During watch/server, the environment variables that reside in
./config/dev.envwill be injected to the environment. Add the variables that your app needs to this file. Note that this file is not checked into VCS. You can use./config/dev.env.exampleas a guide.
Test and Lint
make run/teststo run Crystal spec.make lint/serverto lintcrfiles.make lint/clientto lintjs|jsxfiles.
Format
make fmt/clientto format client files usingeslint.make fmt/serverto format server files usingcrystal tool
Production
make build/allto buildjs|jsx|scssfiles andcrfiles in production mode. The output will be moved todistdirectory at the root of the project.
You can then run PRODUCTION=true ./raleigh to start the application in production mode.
Environment Variables:
Unlike watch mode, in production mode you're responsible of providing the environment variables that the app needs.
Clean-up
make cleanto remove compiled files and generated directories.
Documentation
make docs/generateto generate Crystal docs.make docs/serveto server Crystal docs locally withpython3
Playground
make playground/serveto serve Crystal playground.
Using raleigh as a project template
If you'd like to use raleigh as a boilerplate for your next server-side application, you can clone the repo at the tag v0.1.1, change all instances of raleigh and Raleigh to the desired name and get to work. There's also a release for this tag on GitHub releases which includes a tarball of the source code.
If you'd like to browse the repo at this point, visit the relevant tree.
License
raleigh is released under AGPL-3.0.
raleigh
- 0
- 0
- 1
- 0
- 1
- almost 3 years ago
- December 12, 2022
GNU Affero General Public License v3.0
Wed, 05 Nov 2025 04:48:53 GMT