Crystal Mine
Version, currently main branch1 version
- main branchlatestJun 16, 2021
github.com/szabgab/crystal-mine.cr
Experimenting with Crystal
4 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
Crystal Mine:
github: szabgab/crystal-mine.cr
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
- no constraint declared
- License
- MIT
- Author
- Gabor Szabo
Dependencies
Runtime Dependencies
- kemal*github: kemalcr/kemal
- shards*github: crystal-lang/shards
- octokit*github: watzon/octokit.cr
- sqlite3*github: crystal-lang/crystal-sqlite3
- spec-kemal*github: kemalcr/spec-kemal
Development Dependencies
README
Crystal Mine
Source code of the Crystal Mine
Setup Development environment
- Create a Personal Access token with a name that you can easily recognize, e.g. "Crystal Mine Development Token" using the following rights:
repo
x public_repo
user
x read:user
x user:email
- Save your GitHub username and the token it in a file called
config.txtlike this:
USERNAME:TOKEN
Docker compose for development
- Install Docker
- Install Docker compose (e.g.
pip install docker-compose) - Copy
docker-compose.override.yml.exampletodocker-compose.override.ymland change it according to your taste. - Build:
docker-compose build - Start
docker-compose up - Collect some data:
docker exec -it crystal-minecr_cron_1 crystal src/mine.cr --repos spec/repos.txt - Visit http://localhost:6002
Run tests
docker exec -it crystal-minecr_cron_1 crystal spec
Run test files separately
docker exec -it crystal-minecr_cron_1 crystal spec/web_test_spec.cr
docker exec -it crystal-minecr_cron_1 crystal spec/db_test_spec.cr
Data Collecion:
A single URL
docker exec -it crystal-minecr_cron_1 crystal src/mine.cr --url https://github.com/szabgab/crystal-mine.cr
Or create a file with a list of repo URLs and then call
docker exec -it crystal-minecr_cron_1 crystal src/mine.cr --repos spec/repos.txt
docker exec -it crystal-minecr_cron_1 crystal src/mine.cr --repos spec/many_repos.txt
Web application
crystal run src/webapp.cr
Build sentry:
crystal build --release lib/sentry/src/sentry_cli.cr -o ./bin/sentry
Run with sentry
./bin/sentry -b "crystal build src/webapp.cr -o bin/webapp" -r bin/webapp
CSS
Generate CSS file (public/bulma.css) from SCSS file (sass/mystles.scss):
docker run --rm -it -v$(pwd):/opt --workdir=/opt node:14.15 npm install && npm run css-build
Add fields to collect and display
- Add to database schema (in db)
- Add to store_in_db (in db)
- Run
crystal/update.crthat will update the *.sql and *.json files in spec/ - Add columns to
FIELDSand toparse_row - Add columns to the display template
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Jun 16, 2021
- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/szabgab/crystal-mine.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1