crystal_community
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.
โจ 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 - Fast, statically typed language
- Kemal - Fast, effective web framework
- PostgreSQL - Robust relational database
- Micrate - Database migrations
- Kemal Session - Session management
๐ Prerequisites
Before you begin, ensure you have the following installed:
- Crystal (>= 1.19.1)
- PostgreSQL (>= 12.0)
- Git
๐ Installation
-
Clone the repository
git clone https://github.com/your-username/crystal-community.git cd crystal-community -
Install dependencies
shards install -
Set up the database
# Create PostgreSQL database createdb crystal_community_development # Run migrations crystal run src/micrate.cr -- up -
Configure environment variables
Create a
.env.developmentfile in the project root: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
- 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
-
Build the application
crystal build src/app.cr -o crystal-community
๐ฎ Usage
Running the Application
Option 1: Direct execution
crystal run src/app.cr
Option 2: Using the compiled binary
./crystal-community
The application will be available at http://localhost:3000
Development with Auto-Reload
This project uses sentry.cr for automatic rebuild/restart during development.
Installation:
curl -fsSLo- https://raw.githubusercontent.com/samueleaton/sentry/master/install.cr | crystal eval
Run with auto-reload:
./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.
๐ 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
Run the test suite:
crystal spec
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Guidelines
- Follow Crystal's style guide
- Write tests for new features
- Update documentation as needed
- Ensure migrations are reversible when possible
๐ Database Migrations
Create a new migration:
crystal run src/micrate.cr -- create migration_name
Run migrations:
crystal run src/micrate.cr -- up
Rollback migrations:
crystal run src/micrate.cr -- down
๐ Security
- Always use strong
SESSION_SECRETvalues in production - Never commit
.envfiles 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 file for details.
crystal_community
- 1
- 0
- 0
- 0
- 7
- about 4 hours ago
- February 12, 2026
MIT License
Thu, 12 Feb 2026 21:30:07 GMT