This is a website for hosting documentation of Crystal Shards.
CrystalDoc relies on a PostgreSQL database to hold all the information about the repositories. To create a local development version using docker:
$ docker run --name crystal_doc -p 5432:5432 -e POSTGRES_USER=crystal_doc_server -e POSTGRES_PASSWORD=password -e POSTGRES_DB=crystal_doc -d postgres
$ shards run -- micrate up
Edit the config.yml
$ cp example-config.yml config.yml
$ nano config.yml # Add API keys / database URL
The server can then be run with:
$ shards run -- server # or 'searcher', 'builder', etc.
CrystalDoc.info comprises of four components that work together to provide its functionality:
Each component can be modified separately and scaled up or down as necessary. For instance, if there is a sudden increase of doc jobs, the number of builders can be manually increased to offset this, allowing for faster doc generation.
CrystalDoc.info uses a PostgreSQL database to store information about each of the repositories and their versions.
A database can be setup after initialization using the provided config/postgres_setup.sql
script.
The URL to the database is then set via the POSTGRES_DB
environment variable, including options for the connection pools.
See here for more information on the
connection pool settings.
After the database is setup, each of the 3 services can be setup and run in their own processes, for example, using systemd daemons.
It is recommended to build with --release
and -D=preview_mt
to provide the most performance. You can set the CRYSTAL_WORKERS
environment variable to set the number of builders and searchers to run at the same time (defaults to 4).
$ shards build crystaldoc_server --release -D=preview_mt
$ ./bin/crystaldoc_server
# repeat for crystaldoc_builder and crystaldoc_searcher
Each of the services outputs are logged to their respective log file in the logs/
folder.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)