An interactive digital mosaic celebrating the vibrant, chaotic, and sensory-rich environments of markets from around the world. Souk Machine is an online directory where people capture the visual and auditory experience of visiting markets, creating a dynamic and interactive cultural archive through video and audio recordings.
- Interactive Map: Explore market submissions from around the world using Mapbox GL
- Media Submissions: Upload video and audio recordings directly from markets
- Geolocation: Automatic address geocoding and map pinning
- Artist Showcase: Dedicated profiles for contributing artists
- Responsive Design: Mobile-optimized interface with progressive web app capabilities
- Admin Dashboard: Manage submissions and artists through a secure admin panel
- Backend: Ruby on Rails 7.1.3
- Database: PostgreSQL
- Authentication: Devise
- File Storage: Cloudinary (video/audio uploads)
- Geocoding: Geocoder gem with Mapbox integration
- Frontend:
- Stimulus (JavaScript framework)
- Bootstrap 5
- Mapbox GL JS for interactive maps
- SCSS for styling
- Deployment: Docker-ready configuration
Before you begin, ensure you have the following installed:
- Ruby 3.1.2
- PostgreSQL
- Node.js (for JavaScript dependencies)
- Yarn package manager
-
Clone the repository
git clone https://github.com/your-username/souk-machine.git cd souk-machine
-
Install dependencies
bundle install yarn install
-
Environment Setup Create a
.env
file in the root directory with the following variables:# Mapbox (required for maps and geocoding) MAPBOX_API_KEY=your_mapbox_api_key # Cloudinary (required for file uploads) CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret # Database (development) LEILA_DATABASE_PASSWORD=your_db_password
-
Database Setup
rails db:create rails db:migrate rails db:seed
-
Start the server
rails server
-
Visit the application Navigate to
http://localhost:3000
in your browser
- Sign up for a Mapbox account
- Create an API token with the following scopes:
- Maps
- Geocoding
- Add your token to the
.env
file asMAPBOX_API_KEY
- Sign up for a Cloudinary account
- Get your credentials from the dashboard
- Add them to your
.env
file andconfig/cloudinary.yml
The application includes Docker configuration for easy deployment:
# Build the image
docker build -t souk-machine .
# Run the container
docker run -p 3000:3000 souk-machine
- Interactive map powered by Mapbox GL JS
- Custom markers for each submission
- Click markers to view submission details in a popup
- Automatic bounds fitting to show all submissions
- Supports video and audio file uploads
- Files are automatically uploaded to Cloudinary
- Streaming support for large video files
- Fallback handling for upload failures
- Real-time address suggestions using Mapbox Geocoder
- Automatic latitude/longitude extraction
- Location validation before submission
- Secure admin dashboard protected by Devise authentication
- Manage user submissions and artist profiles
- Soft delete functionality with confirmation dialogs
app/
├── assets/ # Stylesheets and static assets
├── controllers/ # Rails controllers
├── javascript/ # Stimulus controllers and JS modules
├── models/ # ActiveRecord models
├── uploaders/ # CarrierWave file uploaders
└── views/ # ERB templates
config/
├── initializers/ # Configuration files
├── environments/ # Environment-specific settings
└── routes.rb # Application routes
db/
├── migrate/ # Database migrations
├── schema.rb # Current database schema
└── seeds.rb # Seed data
We welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Follow Rails conventions and best practices
- Write meaningful commit messages
- Add tests for new functionality
- Update documentation when needed
Run the test suite:
rails test
rails test:system # For system tests
- The application is configured for production deployment with Docker
- Environment variables must be properly set in production
- SSL is enforced in production (configured in
production.rb
) - Asset precompilation is handled in the Dockerfile
See the app/assets/stylesheets/LICENSE
file for details.
- Special thanks to all contributing artists featured in the platform
Souk Machine - Capturing the sounds and sights of markets worldwide, one submission at a time. 🎥🎵🗺️