Installation

# Add this to your shard.yml
dependencies:
  shards-info:
    github: mamantoha/shards-info
    version: ~> 9.1.0

Then run:

shards install

shard.yml

Crystal
1.20.2
License
MIT
Author
Anton Maminov <anton.maminov@gmail.com>
Targets
  • cli from src/cli.cr
  • web from src/web.cr
  • worker from src/worker.cr

Dependencies

Runtime Dependencies

  • i18n*github: crystal-i18n/i18n
  • kilt*github: jeromegn/kilt
  • noir*github: crystal-garage/noir, branch: develop
  • cache>= 1.0.0github: crystal-cache/cache
  • cmark*github: amauryt/cr-cmark-gfm, branch: master
  • crest*github: mamantoha/crest
  • emoji*github: veelenga/emoji.cr, branch: master
  • ipapi*github: geocrystal/ipapi-crystal
  • kemal>= 1.7.0github: kemalcr/kemal
  • raven~> 1.9.1github: Sija/raven.cr
  • redis*github: jgaskins/redis
  • slang*github: jeromegn/slang, branch: master
  • dotenv*github: gdotdesign/cr-dotenv, branch: master
  • lustra>= 0.18.2github: crystal-garage/lustra, branch: main
  • defense*github: defense-cr/defense, branch: master
  • autolink*github: crystal-community/autolink.cr
  • mosquito~> 2.0github: mosquito-cr/mosquito, branch: master
  • countdown*github: mamantoha/countdown-crystal
  • delegator*github: Schniz/delegator.cr
  • retriable*github: Sija/retriable.cr
  • time_zone*github: mamantoha/time_zone
  • flag_emoji*github: mamantoha/flag_emoji
  • kemal-kilt*github: crystal-garage/kemal-kilt
  • multi_auth*github: msa7/multi_auth, branch: master
  • shards_spec*github: mamantoha/shards_spec
  • humanize_time*github: mamantoha/humanize_time
  • kemal-session*github: kemalcr/kemal-session
  • time_duration*github: mamantoha/time_duration
  • device_detector*github: crystal-garage/device_detector, branch: develop
  • time_by_example*github: mamantoha/time_by_example
  • redis_cache_store>= 1.0.0github: crystal-cache/redis_cache_store
  • cadmium_transliterator*github: cadmiumcr/transliterator
  • kemal-session-redis-engine*github: crystal-garage/kemal-session-redis-engine, branch: main

Development Dependencies

  • ameba*github: crystal-ameba/ameba, branch: masterdev
  • spec-kemal*github: kemalcr/spec-kemaldev

README

<img src="https://raw.githubusercontent.com/mamantoha/shards-info/master/public/images/logo-horizontal_dark.png" alt="shards.info" width="360" />

[![Built with Crystal](https://img.shields.io/badge/built%20with-Crystal-000000.svg?logo=appveyor)](https://crystal-lang.org/)
[![Crystal CI](https://github.com/mamantoha/shards-info/actions/workflows/crystal.yml/badge.svg)](https://github.com/mamantoha/shards-info/actions/workflows/crystal.yml)
[![Oxc](https://github.com/mamantoha/shards-info/actions/workflows/oxc.yml/badge.svg)](https://github.com/mamantoha/shards-info/actions/workflows/oxc.yml)

View of all repositories on Github and Gitlab that have Crystal code in them.

[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://vshymanskyy.github.io/StandWithUkraine)

## Installation

- [Install](https://crystal-lang.org/docs/installation/) Crystal
- Clone this repository
- Install dependencies `shards install`
- Rename `.env.example` to `.env`, and set variables.
- Run Web server as `crystal src/web.cr`

## Development

```console
psql -c 'CREATE DATABASE shards_info_development;' -U postgres
crystal src/cli.cr migrate
```

### Database Operations (Makefile)

We use a Makefile to automate database schema dumps and restoration. Available commands:

#### Dump database schema and migrations

```
make db-dump
```

This dumps both the schema and migration metadata (__lustra_metadatas table) into `src/db/structure.sql`.

#### Dump schema only

```
make db-dump-schema
```

#### Dump migrations metadata only

```
make db-dump-migrations
```

#### Restore from dump

```
make db-restore
```

#### Using a different database

```
make db-dump DB_NAME=your_database_name
make db-restore DB_NAME=your_database_name
```

#### View all available commands

```
make help
```

### Frontend

Install depencencies:

```console
npm install
```

After modifications run `npm run build`, `npm run oxlint`, and `npm run oxfmt`.

## Specs

Prepare a database:

```console
crystal spec/initdb.cr
```

Run specs:

```console
KEMAL_ENV=test crystal spec
```

## Special thanks

- [Crystal language](https://crystal-lang.org/)
- [Lustra](https://github.com/crystal-garage/lustra) - Advanced ORM between PostgreSQL and Crystal
- [Kemal](https://github.com/kemalcr/kemal) - Web microframework for Crystal
- [Mosquito](https://github.com/robacarp/mosquito) - A generic background task runner for Crystal applications
- [raven.cr](https://github.com/Sija/raven.cr) - Crystal client for [Sentry](https://sentry.io)
- [cr-cmark-gfm](https://github.com/amauryt/cr-cmark-gfm) - Crystal C bindings for [cmark-gfm](https://github.com/github/cmark-gfm)
- [noir](https://github.com/MakeNowJust/noir) - Syntax Highlight Library for Crystal
- Logo [icon](https://game-icons.net/1x1/lorc/floating-crystal.html) taken from [Game Icons pack](https://game-icons.net/) under CC BY 3.0 license.

## Contributing

1. Fork it (<https://github.com/mamantoha/shards-info/fork>)
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request

## Contributors

- [mamantoha](https://github.com/mamantoha) Anton Maminov - creator, maintainer