This project is a Ruby on Rails based system for managing the You Ship We Ship (YSWS) program, including admin controls, user projects, Hackatime integration, and more!
- User Management: Authentication and authorization system with admin roles
- Project Management: Create, track, and manage user projects
- Devlogs: Log development time and progress for projects
- Hackatime Integration: Sync project time tracking with Hackatime API
- Leaderboards: Display top contributors and projects
- Order Management: Handle YSWS orders and requests
- Ship Requests: Manage shipping requests for completed projects
- Admin Dashboard: Centralized admin controls
- User Management: View and manage all users
- Project Oversight: Monitor all projects and their progress
- Approval System: Approve/reject projects and orders
- Analytics: View statistics and metrics
- Hackatime API: Real-time time tracking integration
- Slack Integration: User authentication via Slack OAuth
- Hack Club Integration: OAuth integration with Hack Club
app/controllers/home_controller.rb- Main landing page and dashboardusers_controller.rb- User profile and managementprojects_controller.rb- Project CRUD operationsdevlogs_controller.rb- Development log managementorders_controller.rb- Order managementleaderboards_controller.rb- Leaderboard displayship_requests_controller.rb- Shipping request handlingsessions_controller.rb- Authentication sessionsdev_sessions_controller.rb- Developer sessionsadmin/- Admin-specific controllers
app/models/user.rb- User model with authenticationproject.rb- Project model with time trackingdevlog.rb- Development log entriesorder.rb- Order model (includes optionalcharm_image_urlfor custom charms)ship_request.rb- Shipping request model
app/views/layouts/- Application layout templateshome/- Home page viewsusers/- User profile viewsprojects/- Project views (index, show, new, edit)devlogs/- Devlog viewsorders/- Order viewsleaderboards/- Leaderboard viewsadmin/- Admin dashboard views
app/services/hackatime_service.rb- Hackatime API integration
app/jobs/- Background jobs for processing
app/mailers/- Email notifications
- Ruby 3.4.3 (see
.ruby-version) - Rails 8.1.2
- SQLite3 (development) or PostgreSQL (production)
- Node.js (for asset compilation)
- Redis (for caching and background jobs)
-
Clone the repository
git clonerepository-url>gt; cd Metroid-Mania -
Install dependencies
bundle install npm installl
-
Setup environment variables
cp .env.example .env
Edit
.envwith your configuration:HACKCLUB_CLIENT_IDandHACKCLUB_CLIENT_SECRET- From Hack Club OAuth appHACKATIME_API_KEY- From Hackatime APIAPP_URL- Your local development URL (e.g.,http://localhost:3000)AUTO_ADMIN_EMAILandAUTO_ADMIN_PASSWORD- For admin user creation
-
Setup database
bin/rails db:create bin/rails db:migrate bin/rails db:seeded
-
Start the development server
bin/dev
The app will be available at
http://localhost:3000
-
Build the Docker image
docker build -t metroid_mania . -
Run the container
docker run -d -p 80:3000 \ -e RAILS_MASTER_KEY==your-master-key>gt; \ -e HACKCLUB_CLIENT_ID== your-client-id>gt; \ -e HACKCLUB_CLIENT_SECRET== your-client-secret>gt; \ -e HACKATIME_API_KEY== your-api-key>gt; \ --name metroid_mania metroid_maniaa
Required environment variables:
HACKCLUB_CLIENT_ID- Hack Club OAuth client IDHACKCLUB_CLIENT_SECRET- Hack Club OAuth client secretHACKATIME_API_KEY- Hackatime API keyAPP_URL- Application URLRAILS_MASTER_KEY- Rails master key for production
Optional environment variables:
AUTO_ADMIN_EMAIL- Email for auto-created admin userAUTO_ADMIN_PASSWORD- Password for auto-created admin userAUTO_ADMIN- Set to1to enable auto-admin creation
bin/rails test# RuboCop
bundle exec rubocop
# ERB Lint
bundle exec erb_lint
# Security audit
bundle exec brakeman
bundle exec bundler-audit# Start background job processor
bin/jobssbin/rails cable# Setup
kamal setup
# Deploy
kamal deploy
# View logs
kamal logssBuild and push the image to your container registry, then deploy to your hosting provider.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For issues and questions, please open an issue on the repository.