{"id":23207162,"url":"https://github.com/bluette1/vibes-api","last_synced_at":"2026-05-05T04:35:12.086Z","repository":{"id":258052132,"uuid":"862020989","full_name":"Bluette1/vibes-api","owner":"Bluette1","description":"Backend for the Vibes meditation application","archived":false,"fork":false,"pushed_at":"2025-10-26T15:33:43.000Z","size":100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-10-29T20:53:53.601Z","etag":null,"topics":["postgresql","redis","rest-api","ruby","ruby-on-rails","sidekiq"],"latest_commit_sha":null,"homepage":"https://vibes-api-gn8v.onrender.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bluette1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-23T22:32:43.000Z","updated_at":"2025-10-27T22:35:38.000Z","dependencies_parsed_at":"2024-11-21T09:27:45.660Z","dependency_job_id":"a104904e-868c-4631-88a3-4ff257819cb7","html_url":"https://github.com/Bluette1/vibes-api","commit_stats":null,"previous_names":["bluette1/vibes-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bluette1/vibes-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bluette1%2Fvibes-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bluette1%2Fvibes-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bluette1%2Fvibes-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bluette1%2Fvibes-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bluette1","download_url":"https://codeload.github.com/Bluette1/vibes-api/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bluette1%2Fvibes-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32635756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"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":["postgresql","redis","rest-api","ruby","ruby-on-rails","sidekiq"],"created_at":"2024-12-18T17:18:00.853Z","updated_at":"2026-05-05T04:35:12.070Z","avatar_url":"https://github.com/Bluette1.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vibes API\n\nVibes API is a Ruby on Rails application designed to provide robust and secure data management for the Vibes app, featuring user management, secure data storage, and automated testing.\n\n[Deployed site](https://vibes-api-gn8v.onrender.com)\n\n## Overview\n\n- **User Management**: Admins can manage user roles and permissions.\n- **Secure Data Storage**: All sensitive data is encrypted and securely stored.\n- **Automated Testing**: CI/CD pipeline runs tests automatically on new commits.\n\n## Getting Started\n\n### Prerequisites\n\n- Ruby 3.1 \n- Rails 7\n- Bundler\n- PostgreSQL \n### Installation\n\n1. **Clone the repository**:\n\n   ```bash\n   git clone https://github.com/Bluette1/vibes-api.git\n   cd vibes-api\n   ```\n\n2. **Install dependencies**:\n\n   ```bash\n   bundle install\n   ```\n\n3. **Set up the database**:\n\n   ```bash\n   rake db:create db:migrate\n   ```\n\n4. **Run the application**:\n   ```bash\n   rails server\n   ```\n\n## Migrating the database to Supabase (Postgres)\n\nSupabase runs PostgreSQL under the hood. To move from your current Postgres to Supabase, you can either load the Rails schema fresh or copy existing data with `pg_dump`/`psql`.\n\nPrerequisites:\n\n- Supabase project created and a Postgres connection string (DATABASE_URL)\n- `psql` and `pg_dump` installed locally\n- App can read environment from `.env` (this repo includes dotenv)\n\n### 1) Configure credentials\n\nAdd your Supabase connection string to `.env` (or the host environment):\n\n```bash\n# .env\nDATABASE_URL=postgresql://postgres:YOUR_PASSWORD@db.PROJECT_REF.supabase.co:5432/postgres?sslmode=require\n```\n\nNote: `sslmode=require` is necessary for Supabase.\n\nProduction already uses `DATABASE_URL` in `config/database.yml`, so no code changes are required.\n\n### 2A) Fresh setup (no data to migrate)\n\nIf you don't need existing data, just prepare the database:\n\n```bash\nbundle exec rails db:prepare\n# or, explicitly\nbundle exec rails db:schema:load db:seed\n```\n\n### 2B) Migrate existing data from Postgres to Supabase\n\nIf you have an existing Postgres database you want to migrate:\n\n1. Export from the source database (replace placeholders):\n\n```bash\npg_dump \\\n   --no-owner --no-privileges \\\n   --format=custom \\\n   --file=backup.dump \\\n   --dbname=\"postgresql://USER:PASSWORD@SOURCE_HOST:5432/SOURCE_DB\"\n```\n\n2. Restore into Supabase:\n\n```bash\npg_restore \\\n   --no-owner --no-privileges \\\n   --clean --if-exists \\\n   --dbname=\"$DATABASE_URL\"\n```\n\nAlternatively, use a direct pipe if you prefer a one-liner:\n\n```bash\npg_dump --no-owner --no-privileges \\\n   \"postgresql://USER:PASSWORD@SOURCE_HOST:5432/SOURCE_DB\" | \\\n   psql \"$DATABASE_URL\"\n```\n\n3. Run pending Rails migrations (if any):\n\n```bash\nbundle exec rails db:migrate\n```\n\n4. Verify the app connects:\n\n```bash\nbundle exec rails runner \"puts ActiveRecord::Base.connection.active?\"\n```\n\n### Notes\n\n- Ensure any extensions required by your app exist in Supabase (most common ones are enabled; you can enable more from Supabase SQL editor).\n- If you use background jobs or cron, confirm they keep using your existing Redis. This DB migration doesn't change Redis.\n- For CI/CD, set `DATABASE_URL` as a secret in your deployment environment.\n\n### Troubleshooting: connection is unreachable\n\nIf you see an error like:\n\n\u003e connection to server at \"2a05:...\", port 5432 failed: Network is unreachable\n\nYour system is trying IPv6 but doesn't have IPv6 connectivity. Options:\n\n- Use the Supabase Connection Pooler endpoint (PgBouncer) which often provides IPv4. In the Supabase dashboard, copy the pooled connection string and use its host/port (usually 6543). When using the pooler, disable prepared statements:\n\n   ```bash\n   # .env\n   PG_PREPARED_STATEMENTS=false\n   ```\n\n- Enable IPv6 on your network/machine, or connect via a VPN that supports IPv6.\n\n- For local development, remove or comment out `DATABASE_URL` in `.env` so Rails uses the local development/test databases instead.\n\nIf your provider exposes both IPv6 and IPv4 for the direct endpoint, you can force IPv4 by adding `hostaddr=\u003cipv4\u003e` to the connection string when an IPv4 A record exists.\n\n### Running Tests\n\nExecute the test suite using Rake:\n\n```bash\nbundle exec rake test\n```\n\n### Code Style\n\nEnsure code style consistency with RuboCop:\n\n```bash\nbundle exec rubocop\n```\n\n## Contributing\n\n1. Fork the repository.\n2. Create a feature branch.\n3. Commit your changes.\n4. Push to the branch.\n5. Open a pull request.\n\n\n**View user stories:** [https://www.notion.so/User-Stories-Vibes-11fe6a4d98f280c98b15d37c90890c0e?pvs=4](https://www.notion.so/User-Stories-Vibes-11fe6a4d98f280c98b15d37c90890c0e?pvs=21)\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluette1%2Fvibes-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluette1%2Fvibes-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluette1%2Fvibes-api/lists"}