{"id":50940265,"url":"https://github.com/sn/rocking-with-sinatra","last_synced_at":"2026-06-17T13:31:16.784Z","repository":{"id":350522934,"uuid":"1207129217","full_name":"sn/rocking-with-sinatra","owner":"sn","description":"A free book teaching advanced, production-oriented Sinatra development by building a Udemy-like course marketplace.","archived":false,"fork":false,"pushed_at":"2026-04-10T17:59:13.000Z","size":98,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-10T19:31:49.360Z","etag":null,"topics":["book","ebook","graphql","mvc","oauth2","rack","rest-api","rspec","ruby","sinatra","sinatra-framework"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-10T15:53:34.000Z","updated_at":"2026-04-10T17:59:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sn/rocking-with-sinatra","commit_stats":null,"previous_names":["sn/rocking-with-sinatra"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sn/rocking-with-sinatra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sn%2Frocking-with-sinatra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sn%2Frocking-with-sinatra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sn%2Frocking-with-sinatra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sn%2Frocking-with-sinatra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sn","download_url":"https://codeload.github.com/sn/rocking-with-sinatra/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sn%2Frocking-with-sinatra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34451334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["book","ebook","graphql","mvc","oauth2","rack","rest-api","rspec","ruby","sinatra","sinatra-framework"],"created_at":"2026-06-17T13:31:15.996Z","updated_at":"2026-06-17T13:31:16.772Z","avatar_url":"https://github.com/sn.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rocking with Sinatra\n\nA free book teaching advanced, production-oriented Sinatra development by building a Udemy-like course marketplace.\n\n## About This Book\n\nThis is not a beginner's book - it dives straight into advanced topics for building real-world production software with Sinatra. The first two chapters cover essential concepts, then we build a fully functional course marketplace.\n\nI highly recommend reading the [Sinatra documentation](https://sinatrarb.com) and having a solid understanding of Ruby before starting.\n\nRecommended Ruby resources:\n\n1. [Eloquent Ruby, Second Edition](https://pragprog.com/titles/eruby2/eloquent-ruby-second-edition/) by Russ Olsen\n2. [Practical Object-Oriented Design in Ruby](https://www.poodr.com/) by Sandi Metz\n3. [The Odin Project](https://www.theodinproject.com/) (free, comprehensive full-stack curriculum)\n\n## What We're Building\n\nA fully functional Udemy-type clone where users can buy and publish short video courses, featuring user management, authentication, REST \u0026 GraphQL APIs, real-time WebSockets, database-backed content, and production deployment.\n\n## Running the Example Code\n\nEach example in the `examples/` directory is self-contained with its own `Gemfile`:\n\n```bash\ncd examples/ch01-modular\nbundle install\nbundle exec rackup\n# Open http://localhost:9292\n```\n\nFor chapters that use PostgreSQL or Redis, use the included Docker environment:\n\n```bash\ndocker compose up\n```\n\nSee [Running Examples](book/running-examples.md) for full details.\n\n## Contents\n\n#### [Chapter 1 - Important Concepts](book/ch1-important-concepts.md)\n\n1. [Classic vs Modular Style Applications](book/ch1-important-concepts.md#classic-vs-modular-style-applications)\n2. [Useful Tools](book/ch1-important-concepts.md#useful-tools) - Sinatra Contrib, Helpers, Logging, Code Analyzers\n3. [A Brief Introduction to Rack](book/ch1-important-concepts.md#a-brief-introduction-to-rack)\n4. [Software Architecture Patterns](book/ch1-important-concepts.md#software-architecture-patterns)\n\n#### [Chapter 2 - Working with Routes \u0026 Conditions](book/ch2-routes-and-conditions.md)\n\n1. [Named Parameters](book/ch2-routes-and-conditions.md#named-parameters)\n2. [Wildcard Routing](book/ch2-routes-and-conditions.md#wildcard-routing)\n3. [Routing with Regular Expressions](book/ch2-routes-and-conditions.md#routing-with-regular-expressions)\n4. [Using Query String Parameters](book/ch2-routes-and-conditions.md#using-query-string-parameters)\n5. [Routing Conditions](book/ch2-routes-and-conditions.md#routing-conditions)\n\n#### [Chapter 3 - Templates, Partials, Layouts \u0026 Emails](book/ch3-templates-layouts.md)\n\n1. [Configuration](book/ch3-templates-layouts.md#configuration)\n2. [Types of Template Engines](book/ch3-templates-layouts.md#types-of-template-engines)\n3. [Namespacing Templates](book/ch3-templates-layouts.md#namespacing-templates)\n4. [Layouts](book/ch3-templates-layouts.md#layouts)\n5. [Embedding Partials](book/ch3-templates-layouts.md#embedding-partials)\n6. [Effectively Dealing with Mailers](book/ch3-templates-layouts.md#effectively-dealing-with-mailers)\n\n#### [Chapter 4 - Rendering CSS, Images \u0026 JavaScript Assets](book/ch4-assets.md)\n\n1. [Rake-based Asset Bundling](book/ch4-assets.md#rake-based-asset-bundling)\n2. [Sprockets](book/ch4-assets.md#sprockets)\n3. [Serving Directly with Rack::Static](book/ch4-assets.md#serving-directly-with-rackstatic)\n4. [Effective Caching](book/ch4-assets.md#effective-caching)\n5. [Serving Assets from Nginx](book/ch4-assets.md#serving-assets-from-nginx)\n\n#### [Chapter 5 - WebSockets, Ajax \u0026 CORS](book/ch5-websockets-ajax-cors.md)\n\n1. [Understanding WebSockets](book/ch5-websockets-ajax-cors.md#understanding-websockets)\n2. [Basic WebSocket Setup with Sinatra](book/ch5-websockets-ajax-cors.md#basic-websocket-setup-with-sinatra)\n3. [Realtime Chat Application](book/ch5-websockets-ajax-cors.md#realtime-chat-application)\n4. [Embeddable JavaScript Applications with CORS](book/ch5-websockets-ajax-cors.md#embeddable-javascript-applications-with-cors)\n5. [Realtime Exception Tracking System](book/ch5-websockets-ajax-cors.md#realtime-exception-tracking-system)\n\n#### [Chapter 6 - Structuring Your Applications](book/ch6-structuring-applications.md)\n\n1. [MVC \u0026 Directory Structure](book/ch6-structuring-applications.md#mvc--directory-structure)\n2. [Helpers](book/ch6-structuring-applications.md#helpers)\n3. [Settings / Configuration](book/ch6-structuring-applications.md#settings--configuration)\n4. [Application Boot Process](book/ch6-structuring-applications.md#application-boot-process)\n5. [Creating Custom Helpers](book/ch6-structuring-applications.md#creating-custom-helpers)\n6. [Creating Custom Extensions](book/ch6-structuring-applications.md#creating-custom-extensions)\n\n#### [Chapter 7 - Working with Databases](book/ch7-working-with-databases.md)\n\n1. [ActiveRecord with PostgreSQL](book/ch7-working-with-databases.md#activerecord-with-postgresql)\n2. [Redis](book/ch7-working-with-databases.md#redis)\n3. [Workshop: Modeling Our Course Marketplace](book/ch7-working-with-databases.md#workshop-modeling-our-course-marketplace)\n\n#### [Chapter 8 - Securing Your Application](book/ch8-securing-your-application.md)\n\n1. [User Authentication](book/ch8-securing-your-application.md#user-authentication)\n2. [Rack Protection Module](book/ch8-securing-your-application.md#rack-protection-module)\n3. [API Authentication](book/ch8-securing-your-application.md#api-authentication)\n4. [OAuth Authentication](book/ch8-securing-your-application.md#oauth-authentication)\n5. [Input Validation](book/ch8-securing-your-application.md#input-validation)\n6. [SSL/HTTPS in Production](book/ch8-securing-your-application.md#sslhttps-in-production)\n\n#### [Chapter 9 - All About APIs](book/ch9-apis.md)\n\n1. [Basic REST API Principles](book/ch9-apis.md#basic-rest-api-principles)\n2. [Creating a JSON API Service](book/ch9-apis.md#creating-a-json-api-service)\n3. [API Authentication](book/ch9-apis.md#api-authentication)\n4. [Consuming External APIs](book/ch9-apis.md#consuming-external-apis)\n5. [GraphQL with Sinatra](book/ch9-apis.md#graphql-with-sinatra)\n6. [Testing \u0026 Documenting Your APIs](book/ch9-apis.md#testing--documenting-your-apis)\n\n#### [Chapter 10 - Testing \u0026 Deployment](book/ch10-testing-and-deployment.md)\n\n1. [Testing with Rack::Test](book/ch10-testing-and-deployment.md#testing-with-racktest)\n2. [Testing with RSpec](book/ch10-testing-and-deployment.md#testing-with-rspec)\n3. [Testing with Minitest](book/ch10-testing-and-deployment.md#testing-with-minitest)\n4. [Containerized Deployment with Docker](book/ch10-testing-and-deployment.md#containerized-deployment-with-docker)\n5. [Deploying with Puma behind Nginx](book/ch10-testing-and-deployment.md#deploying-with-puma-behind-nginx)\n6. [Production Checklist](book/ch10-testing-and-deployment.md#production-checklist)\n\n## Contributing\n\nIf you want to help by contributing to the content of this book, please submit a [pull request](https://github.com/sn/rocking-sinatra/pulls).\n\n## Author\n\nSean Nieuwoudt - [sean@underwulf.com](mailto:sean@underwulf.com)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsn%2Frocking-with-sinatra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsn%2Frocking-with-sinatra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsn%2Frocking-with-sinatra/lists"}