{"id":16863557,"url":"https://github.com/vbrazo/napice-ruby-on-roda","last_synced_at":"2026-05-05T18:40:28.358Z","repository":{"id":46644518,"uuid":"140518219","full_name":"vbrazo/napice-ruby-on-roda","owner":"vbrazo","description":"A Ruby API using Roda Web Framework. An example of Ruby off Rails","archived":false,"fork":false,"pushed_at":"2025-10-04T19:54:34.000Z","size":503,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T21:07:53.885Z","etag":null,"topics":["api","postresql","roda","rspec","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/vbrazo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2018-07-11T03:44:36.000Z","updated_at":"2025-10-04T19:57:46.000Z","dependencies_parsed_at":"2025-10-09T21:07:16.876Z","dependency_job_id":"8b30f7e9-41eb-4cd6-bcdd-cb747aba9d36","html_url":"https://github.com/vbrazo/napice-ruby-on-roda","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vbrazo/napice-ruby-on-roda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbrazo%2Fnapice-ruby-on-roda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbrazo%2Fnapice-ruby-on-roda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbrazo%2Fnapice-ruby-on-roda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbrazo%2Fnapice-ruby-on-roda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vbrazo","download_url":"https://codeload.github.com/vbrazo/napice-ruby-on-roda/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbrazo%2Fnapice-ruby-on-roda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32663432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","postresql","roda","rspec","ruby"],"created_at":"2024-10-13T14:39:00.073Z","updated_at":"2026-05-05T18:40:28.323Z","avatar_url":"https://github.com/vbrazo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Napice Ruby API \n\n![CI](https://github.com/Napice/napice-ruby/workflows/CI/badge.svg) \n[![Ruby Version](https://img.shields.io/badge/ruby-3.2+-red.svg)](https://www.ruby-lang.org)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nA lightweight, high-performance Ruby API built with the Roda web framework. This project demonstrates modern Ruby best practices with a focus on simplicity, security, and maintainability.\n\n## Table of Contents\n\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Development](#development)\n- [Testing](#testing)\n- [Deployment](#deployment)\n- [Built With](#built-with)\n- [Project Structure](#project-structure)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- **Lightweight \u0026 Fast:** Built on Roda, one of the fastest Ruby web frameworks\n- **RESTful API:** Clean and consistent API design\n- **Database Management:** PostgreSQL with Sequel ORM for reliable data handling\n- **Authentication:** HTTP Basic Auth for secure endpoints\n- **Security:** Built-in CSRF and session protection with Rack Protection\n- **Testing:** Comprehensive test suite with RSpec\n- **Code Quality:** Enforced with RuboCop and SimpleCov for coverage tracking\n- **CI/CD Ready:** Automated testing with GitHub Actions\n- **Production Ready:** Configured for Heroku deployment\n\n## Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n- **Ruby:** 3.2 or higher\n- **Bundler:** 2.6.9 or higher\n- **PostgreSQL:** 13 or higher\n- **Make:** For convenient command execution\n\n## Installation\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/Napice/napice-ruby.git\ncd napice-ruby-on-roda\n```\n\nOr fork the project first and clone your fork:\n\n```bash\ngit clone https://github.com/YOUR_USERNAME/napice-ruby.git\ncd napice-ruby-on-roda\n```\n\n### 2. Install dependencies\n\n```bash\nmake install\n```\n\nOr manually:\n\n```bash\nbundle install\n```\n\n### 3. Set up the database\n\n```bash\nmake build_database\n```\n\nThis will create the database and run all migrations.\n\n## Configuration\n\n### Environment Variables\n\nCreate your environment configuration files based on the example:\n\n```bash\ncp .env.example .env\ncp .env.example .env.test\ncp .env.example .env.development\n```\n\nConfigure the following variables in each file:\n\n```bash\n# Database Configuration\nDATABASE_ENV=postgres://username:password@localhost:5432/database_name\n\n# Authentication\nHTTP_USER=your_username\nHTTP_PASSWORD=your_secure_password\n\n# Session Security (use a strong random string)\nRACK_COOKIE_KEY=your_cookie_key\nRACK_COOKIE_SECRET=your_cookie_secret_min_32_characters\n\n# Environment\nENVIRONMENT=development  # or test, production\n```\n\n**Security Note:** Never commit `.env` files to version control. Use strong, randomly generated values for production secrets.\n\n## Development\n\n### Available Make Commands\n\n```bash\nmake install          # Install dependencies\nmake build_database   # Create database and run migrations\nmake console          # Launch interactive Ruby console\nmake server           # Start the development server\n```\n\n### Launch the console\n\nAccess an interactive Ruby environment with full application context:\n\n```bash\nmake console\n```\n\nThis is useful for testing queries, debugging, and exploring the API programmatically.\n\n### Start the development server\n\n```bash\nmake server\n```\n\nOr manually:\n\n```bash\nbundle exec puma\n```\n\nThe API will be available at `http://localhost:9292` (or the port configured in your environment).\n\n## Testing\n\n### Run the test suite\n\n```bash\nbundle exec rspec spec\n```\n\n### Run with coverage report\n\nSimpleCov is configured to generate coverage reports automatically when running tests. View the report at `coverage/index.html`.\n\n### Run the linter\n\nCheck code quality with RuboCop:\n\n```bash\nbundle exec rubocop\n```\n\nAuto-fix issues where possible:\n\n```bash\nbundle exec rubocop -a\n```\n\n### Run all checks\n\n```bash\nmake test     # If configured in Makefile\n```\n\n## Deployment\n\n### Heroku\n\nThis application is ready for Heroku deployment:\n\n```bash\nheroku create your-app-name\nheroku addons:create heroku-postgresql:mini\nheroku config:set RACK_COOKIE_KEY=your_key\nheroku config:set RACK_COOKIE_SECRET=your_secret\nheroku config:set HTTP_USER=your_user\nheroku config:set HTTP_PASSWORD=your_password\ngit push heroku main\nheroku run rake db:migrate\n```\n\n## Built With\n\n### Core Technologies\n- **[Roda](http://roda.jeremyevans.net/)** - Fast, flexible routing tree Ruby web framework\n- **[Sequel](http://sequel.jeremyevans.net/)** - Database toolkit for Ruby\n- **[PostgreSQL](https://www.postgresql.org/)** - Advanced open source relational database\n- **[Puma](https://puma.io/)** - Ruby web server built for concurrency\n\n### Security\n- **[Rack Protection](https://github.com/sinatra/sinatra/tree/main/rack-protection)** - Protection against common web attacks\n- **[Roda HTTP Auth](https://github.com/jeremyevans/roda-http-auth)** - HTTP authentication plugin\n\n### Development \u0026 Testing\n- **[RSpec](https://rspec.info/)** - Behavior-driven development framework\n- **[FactoryBot](https://github.com/thoughtbot/factory_bot)** - Fixtures replacement\n- **[Faker](https://github.com/faker-ruby/faker)** - Generate fake data\n- **[RuboCop](https://rubocop.org/)** - Ruby static code analyzer and formatter\n- **[SimpleCov](https://github.com/simplecov-ruby/simplecov)** - Code coverage analysis\n\n### DevOps\n- **[GitHub Actions](https://github.com/features/actions)** - CI/CD automation\n- **[Dotenv](https://github.com/bkeepers/dotenv)** - Environment variable management\n\n## Project Structure\n\n```\nnapice-ruby-on-roda/\n├── application/\n│   ├── api/\n│   │   ├── models/          # Database models\n│   │   ├── operations/      # Business logic layer\n│   │   ├── routes/          # API route definitions\n│   │   └── api_support.rb   # Shared API utilities\n│   ├── api.rb               # Main API application\n│   ├── config/              # Configuration files\n│   │   ├── database.rb\n│   │   └── sequel.rb\n│   ├── db/\n│   │   └── migrations/      # Database migrations\n│   └── tasks/               # Rake tasks\n├── spec/                    # Test files\n│   ├── api/\n│   ├── models/\n│   ├── operations/\n│   └── workflow/\n├── config.ru                # Rack configuration\n├── Gemfile                  # Dependencies\n└── Makefile                 # Convenient commands\n```\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details on:\n\n- Code of Conduct\n- Development process\n- Submitting pull requests\n- Coding standards\n\n### Quick Start for Contributors\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Run tests and linter (`bundle exec rspec \u0026\u0026 bundle exec rubocop`)\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to your branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## License\n\nThis project is available as open source under the terms of the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbrazo%2Fnapice-ruby-on-roda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvbrazo%2Fnapice-ruby-on-roda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbrazo%2Fnapice-ruby-on-roda/lists"}