crystal-community
Version, currently master branch1 version
- master branchlatestMay 30, 2026
github.com/sdogruyol/crystal_community
crystalcommunity.org built with Kemal
18 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
crystal-community:
github: sdogruyol/crystal_community
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.19.1- License
- MIT
- Author
- Serdar Dogruyol <dogruyolserdar@gmail.com>
- Targets
micratefrom src/micrate.crcrystal-communityfrom src/app.crgithub-crystal-statsfrom src/scripts/github_crystal_stats.cr
Dependencies
Runtime Dependencies
- db*github: crystal-lang/crystal-db
- pg*github: will/crystal-pg
- faker*github: askn/faker
- kemal>= 1.11.0github: kemalcr/kemal
- dotenv*github: gdotdesign/cr-dotenv
- micrate*github: amberframework/micrate
- spec-kemal*github: kemalcr/spec-kemal, branch: master
- kemal-session>= 1.5.0github: kemalcr/kemal-session
README
# Crystal Community A community platform for Crystal developers to connect and discover each other. Built with the Crystal programming language and inspired by [rubycommunity.org](https://rubycommunity.org).     ## โจ Features - ๐ **GitHub OAuth Authentication** - Sign in with your GitHub account - ๐บ๏ธ **Interactive Community Map** - Visualize developers around the world - ๐ฅ **Developer Directory** - Browse and discover Crystal developers - ๐ **GitHub Profile Integration** - Automatically sync name, bio, location, and avatar from GitHub - ๐จ **Modern UI** - Clean and responsive design ## ๐ง Planned Features - ๐ค **Developer Profiles** - Detailed profile pages for each developer - ๐ **Activity Tracking** - Track projects, posts, comments, and stars - ๐ **Scoring System** - Gamified community engagement - ๐ผ **Open to Work** - Mark your availability for opportunities ## ๐ ๏ธ Tech Stack - **[Crystal](https://crystal-lang.org/)** - Fast, statically typed language - **[Kemal](https://kemalcr.com/)** - Fast, effective web framework - **[PostgreSQL](https://www.postgresql.org/)** - Robust relational database - **[Micrate](https://github.com/amberframework/micrate)** - Database migrations - **[Kemal Session](https://github.com/kemalcr/kemal-session)** - Session management ## ๐ Prerequisites Before you begin, ensure you have the following installed: - [Crystal](https://crystal-lang.org/install/) (>= 1.19.1) - [PostgreSQL](https://www.postgresql.org/download/) (>= 12.0) - [Git](https://git-scm.com/) ## ๐ Installation 1. **Clone the repository** ```bash git clone https://github.com/your-username/crystal-community.git cd crystal-community ``` 2. **Install dependencies** ```bash shards install ``` 3. **Set up the database** ```bash # Create PostgreSQL database createdb crystal_community_development # Run migrations crystal run src/micrate.cr up ``` 4. **Configure environment variables** Create a `.env.development` file in the project root: ```bash DATABASE_URL="postgres://localhost/crystal_community_development" GITHUB_CLIENT_ID="your_github_client_id" GITHUB_CLIENT_SECRET="your_github_client_secret" SESSION_SECRET="your-secret-key-change-this-in-production" CRYSTAL_COMMUNITY_ENV="development" ``` **Getting GitHub OAuth Credentials:** - Go to [GitHub Settings > Developer settings > OAuth Apps](https://github.com/settings/developers) - Click "New OAuth App" - Set Application name: `Crystal Community (Development)` - Set Homepage URL: `http://localhost:3000` - Set Authorization callback URL: `http://localhost:3000/users/auth/github/callback` - Copy the Client ID and generate a Client Secret 5. **Build the application** ```bash crystal build src/app.cr -o crystal-community ``` ## ๐ฎ Usage ### Running the Application **Option 1: Direct execution** ```bash crystal run src/app.cr ``` **Option 2: Using the compiled binary** ```bash ./crystal-community ``` The application will be available at `http://localhost:3000` ### Development with Auto-Reload This project uses [sentry.cr](https://github.com/samueleaton/sentry) for automatic rebuild/restart during development. **Installation:** ```bash curl -fsSLo- https://raw.githubusercontent.com/samueleaton/sentry/master/install.cr | crystal eval ``` **Run with auto-reload:** ```bash ./sentry --install ./sentry ``` The `.sentry.yml` file is configured to build `src/app.cr` and run the `./crystal-community` binary, watching `src/**/*.cr` and `src/**/*.ecr` files. ### Development Data Seed scripts for local development. Use `CRYSTAL_COMMUNITY_ENV=development` after database migrations and a configured `.env.development` (see **Installation** above). #### Fake User Generator Create fake users to test the map and developer directory: ```bash CRYSTAL_COMMUNITY_ENV=development crystal run src/seeders/fake_user_generator.cr ``` Creates 100 fake users by default, with random names, bios, locations, avatar URLs, and other profile data. #### Fake GitHub Stats Generator Populate the `github_stats` table with synthetic rows so the stats page and charts have data without running the real GitHub collector: ```bash CRYSTAL_COMMUNITY_ENV=development crystal run src/seeders/fake_github_stat_generator.cr ``` By default this inserts 30 rows with `collected_at` stepped back one day per row. `repos_scanned` and `total_stars` increase monotonically toward the present so time-series charts trend upward. Other fields (star buckets, owner split, top topics) are generated for plausible-looking dashboards. ## ๐ Project Structure ``` crystal-community/ โโโ db/ โ โโโ migrations/ # Database migrations โโโ public/ โ โโโ assets/ # Static assets (CSS, JS, images) โโโ spec/ # Test files โโโ src/ โ โโโ app.cr # Application entry point โ โโโ config/ # Configuration files โ โโโ controllers/ # Request handlers โ โโโ models/ # Data models โ โโโ routes/ # Route definitions โ โโโ seeders/ # Database seeders โ โโโ views/ # ECR templates โโโ .env.development # Development environment variables โโโ shard.yml # Crystal dependencies โโโ README.md ``` ## ๐งช Testing ### Running Tests Before running tests, make sure you have a test database set up: ```bash # Create test database createdb crystal_community_test # Run migrations on test database CRYSTAL_COMMUNITY_ENV=test crystal run src/micrate.cr -- up ``` Create a `.env.test` file in the project root with the following configuration: ```bash DATABASE_URL="postgres://localhost/crystal_community_test" GITHUB_CLIENT_ID="dummy_github_client_id" GITHUB_CLIENT_SECRET="dummy_github_client_secret" SESSION_SECRET="test-secret-key" CRYSTAL_COMMUNITY_PORT=3001 GA_TRACKING_ID="" ``` Run the test suite: ```bash KEMAL_ENV=test CRYSTAL_COMMUNITY_ENV=test crystal spec ``` The tests use [spec-kemal](https://github.com/kemalcr/spec-kemal) for E2E testing of Kemal routes and controllers. ## ๐ค Contributing Contributions are welcome! Please feel free to submit a Pull Request. 1. Fork the repository 2. Create your feature branch (`git checkout -b feature/amazing-feature`) 3. Commit your changes (`git commit -m 'Add some amazing feature'`) 4. Push to the branch (`git push origin feature/amazing-feature`) 5. Open a Pull Request ### Development Guidelines - Follow Crystal's [style guide](https://crystal-lang.org/reference/conventions/coding_style.html) - Write tests for new features - Update documentation as needed - Ensure migrations are reversible when possible ## ๐ Database Migrations **Create a new migration:** ```bash crystal run src/micrate.cr create migration_name ``` **Run migrations:** ```bash crystal run src/micrate.cr up ``` **Rollback migrations:** ```bash crystal run src/micrate.cr down ``` ## ๐ Security - Always use strong `SESSION_SECRET` values in production - Never commit `.env` files with real credentials - Keep dependencies up to date - Review OAuth scopes and permissions ## ๐ License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- May 30, 2026
- Crystal
>= 1.19.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/sdogruyol/crystal_community
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 1