Skip to content
joupifyPublic

About

CommuneXR – A neighborhood help platform built with Rails 7 API, PostgreSQL, and React. Features interactive map, service exchange system, and gamification badges. Built for the DEV Weekend Challenge 2026.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

⚙️ CommuneXR - Backend API

This is the Rails API for CommuneXR, a community platform connecting neighbors through skill sharing.

🚀 Live API

🔗 Base URL: https://communexr.onrender.com

🎥 Demo Video

Watch the full demo of CommuneXR in action:

🔗 https://youtu.be/DE8ptjoFxhw

CommuneXR Demo

📸 Screenshots

Interactive Map Create Service
Map New Service
Dashboard Service Details
Dashboard Details

📦 Tech Stack

  • Ruby on Rails 7 (API mode)
  • PostgreSQL
  • Devise for authentication
  • Geocoder for location services
  • Deployed on Render

📊 API Endpoints

Method Endpoint Description
GET /services List all services
GET /services/:id Get service details
POST /services Create a new service
POST /exchanges Create an exchange
PATCH /exchanges/:id Update exchange status
GET /users/:id Get user profile
GET /users/:id/exchanges Get user exchanges

🏗️ Data Model

Service
├── service_type :offer or :need
├── status :open / :in_progress / :closed
├── latitude & longitude
└── belongs_to :User

Exchange
├── belongs_to :service
├── belongs_to :helper (User)
├── belongs_to :requester (User)
├── status :proposed / :accepted / :completed / :rejected
└── message :text

User
├── has_many :services
├── has_many :helped_exchanges
├── has_many :requested_exchanges
├── has_many :badges through: :user_badges
└── points :integer
🎮 Gamification Logic
ruby
# Automatic badge attribution
after_update :check_badges, if: :completed?

def check_badges
  # First exchange → "First Helper" badge
  if helper.helped_exchanges.completed.count == 1
    helper.badges << Badge.find_by(name: "First Helper")
  end

  # 5 exchanges → "Good Neighbor" badge
  if helper.helped_exchanges.completed.count == 5
    helper.badges << Badge.find_by(name: "Good Neighbor")
  end

  # +10 points per completed exchange
  helper.increment!(:points, 10)
end

🚦 Getting Started

Prerequisites
Ruby 3.2+

PostgreSQL

Bundler

Installation
bash
# Clone the repository
git clone https://github.com/joupify/communeXR.git
cd communeXR

# Install dependencies
bundle install

# Setup database
rails db:create db:migrate db:seed

# Start Rails server
rails s -p 3000
The API will be available at http://localhost:3000

🔗 Frontend Repository
👉 https://github.com/joupify/communeXR_front

🧪 Running Tests
bash
rails test
📁 Project Structure
text
communeXR/
├── app/
│   ├── controllers/     # API endpoints
│   ├── models/          # Business logic
│   └── serializers/     # JSON formatting
├── config/              # Configuration files
├── db/                  # Migrations and seeds
└── test/                # Test suite

🚀 Deployment
This API is deployed on Render.com.
Environment variables needed:

text
DATABASE_URL=postgresql://...
RAILS_MASTER_KEY=your_master_key
FRONTEND_URL=https://communexr-front.onrender.com

🤝 Contributing
Contributions, issues and feature requests are welcome!

📝 License
MIT © joupify

Built with ❤️ for the DEV Weekend Challenge

About

CommuneXR – A neighborhood help platform built with Rails 7 API, PostgreSQL, and React. Features interactive map, service exchange system, and gamification badges. Built for the DEV Weekend Challenge 2026.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages