RunHub is a full-stack, two-sided marketplace that connects Race Organizers with Runners. It provides a seamless platform for event companies to create, manage, and promote races, while allowing runners to discover local events, register, and process entry fee payments securely.
This project was built to demonstrate advanced full-stack capabilities, including:
- Building a stateless, RESTful API using Ruby on Rails 7.
- Implementing custom JWT (JSON Web Token) authentication from scratch.
- Designing a complex relational database schema in PostgreSQL to handle strict user roles.
- Consuming the API with a modern, fast React.js (Vite) frontend.
- Integrating third-party payment processing via Stripe.
- Dedicated Profiles: Manage enterprise details (Company Name, Website, Description).
- Race Management: Create upcoming races with specific details (Date, Location, Distance, Capacity, Price).
- Participant Tracking: View a dashboard of registered runners for specific events to manage capacity.
- Race Discovery: Browse a feed of upcoming races.
- Registration & Checkout: Book a spot in a race and securely pay the entry fee via Stripe.
- Runner Dashboard: Track upcoming and past races in a personalized dashboard.
- Framework: React.js (Bootstrapped with Vite for optimized builds).
- Routing: React Router.
- State Management: (TBD - e.g., Redux or React Context).
- Framework: Ruby on Rails 7 (API-only mode).
- Authentication: Custom JWT stateless authentication using
jwtandbcrypt(No Devise). - Database: PostgreSQL.
- Payments: Stripe API.
(Note: This section will be updated as the frontend is initialized)
- Ruby 3.x+
- Node.js & npm/yarn
- PostgreSQL
- Redis
- Stripe test credentials
- Clone the repository:
git clone <your-repo-url> - Navigate to the API directory:
cd run_hub_api - Create local environment variables:
cp .env.example .env - Install Ruby gems:
bundle install - Setup the database:
rails db:create db:migrate db:seed - Start the Rails server:
rails s(Runs onhttp://localhost:3000)
Before deploying, configure these environment variables or deployment secrets. Do not commit real values to git.
RAILS_MASTER_KEY- decrypts Rails credentials.JWT_SECRET- signs authentication tokens. Use a long random value and keep it separate fromRAILS_MASTER_KEY.DATABASE_NAME- production database name.DATABASE_HOST- production database host.DATABASE_USERNAME- production database user.DATABASE_PASSWORD- production database password.STRIPE_SECRET_KEY- Stripe server-side API key.STRIPE_PUBLISHABLE_KEY- Stripe publishable key returned to clients.STRIPE_WEBHOOK_SECRET- Stripe webhook signing secret.
APP_HOST- canonical app host used for generated URLs.ALLOWED_HOSTS- comma-separated host allowlist, usually includingAPP_HOST.
DATABASE_PORT- defaults to5432.REDIS_URL- defaults toredis://localhost:6379/0.RAILS_LOG_LEVEL- defaults toinfo.STRIPE_API_VERSION- defaults to2025-02-24.acacia.SIDEKIQ_CONCURRENCY,JOB_CONCURRENCY,RAILS_MAX_THREADS, andPORTtune runtime behavior.
- Integrate Stripe Webhooks for asynchronous payment status updates.
- Add an
Adminrole for platform-wide moderation. - Implement email notifications for successful race registrations.
- Add filtering and search capabilities for the Runner race feed.