{"id":31600266,"url":"https://github.com/aanktia/good-night-app","last_synced_at":"2026-05-18T04:32:22.252Z","repository":{"id":308308055,"uuid":"1032338880","full_name":"AankTia/good-night-app","owner":"AankTia","description":"Ruby on Rails application built for users track when they go to bed and when they wake up.","archived":false,"fork":false,"pushed_at":"2025-08-14T14:24:32.000Z","size":159,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-14T16:07:01.496Z","etag":null,"topics":["api-rest","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"","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/AankTia.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}},"created_at":"2025-08-05T06:58:21.000Z","updated_at":"2025-08-10T12:47:01.000Z","dependencies_parsed_at":"2025-08-05T09:37:48.193Z","dependency_job_id":null,"html_url":"https://github.com/AankTia/good-night-app","commit_stats":null,"previous_names":["aanktia/good-night-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AankTia/good-night-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AankTia%2Fgood-night-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AankTia%2Fgood-night-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AankTia%2Fgood-night-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AankTia%2Fgood-night-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AankTia","download_url":"https://codeload.github.com/AankTia/good-night-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AankTia%2Fgood-night-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278572004,"owners_count":26008686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"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":["api-rest","ruby","ruby-on-rails"],"created_at":"2025-10-06T06:55:15.530Z","updated_at":"2025-10-06T06:55:18.094Z","avatar_url":"https://github.com/AankTia.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Good Night Application\n\n\"**Good Night**\" application to let users track when they go to bed and when they wake up.\n\n## 🚀 Features\n\n1. Clock In \u0026 Clock Out operation, and return all clocked-in times, ordered by created time.\n2. Users can follow and unfollow other users.\n3. See the sleep records of a user's All following users' sleep records. from the previous week, which are sorted based on the duration of All friends sleep length.\n\n## 🛠 Tech Stack\n\n- **Framework**: Ruby on Rails 7.x\n- **Database**: SQLite3 (development/test)\n- **Cache/Queue**: Redis\n- **Testing**: RSpec\n- **API Documentation**: RSwag\n\n## 📋 Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n- Ruby 3.1+ (check with `ruby --version`)\n- Rails 7.x (check with `rails --version`)\n- Redis server\n\n### Installing Redis\n\n**macOS (using Homebrew):**\n\n```bash\nbrew install redis\nbrew services start redis\n```\n\n**Ubuntu/Debian:**\n\n```bash\nsudo apt update\nsudo apt install redis-server\nsudo systemctl start redis-server\nsudo systemctl enable redis-server\n```\n\n**Windows:**\n\n```bash\n# Using WSL2 or download from GitHub releases\n```\n\n**Test Redis connection in Rails console**\n\n```ruby\nredis = Redis.new(url: \"redis://localhost:6379/1\")\nredis.set(\"mykey\", \"hello world\")\nredis.get(\"mykey\") # =\u003e \"hello world\"\n```\n\n## 🔧 Installation\n\n1. **Clone the Repository**\n\n   ```bash\n   git clone https://github.com/AankTia/good-night-app.git\n   cd good-night-app\n   ```\n\n2. **Install Dependencies**\n\n   ```bash\n   bundle install\n   ```\n\n3. **Set up the database**\n\n   ```bash\n   rails db:create\n   rails db:migrate\n   rails db:seed\n   ```\n\n   or\n\n   ```bash\n   rails db:prepare\n   ```\n\n   This will:\n\n   - Create databases for all environments (development, test)\n   - Run migrations\n   - Load schema (if needed)\n\n4. **Start Redis server** (if not already running)\n\n   ```bash\n   redis-server\n   ```\n\n5. **Start the Rails server**\n\n   ```bash\n   rails server\n   ```\n\n6. **Visit the application**\n\n   Open your browser and navigate to `http://localhost:3000`\n\n## 🧪 Testing\n\nRun the test suite\n\n```bash\n# Run all tests\nbundle exec rspec\n\n# Run specific test file\nbundle exec rspec spec/models/sleep_record_spec.rb\n```\n\n## API Documentation\n\nThis application uses **RSwag** to generate interactive API documentation.\n\n### Viewing the API Documentation\n\n1. **Generate the Swagger documentation** (after running tests):\n\n   ```bash\n   bundle exec rspec --pattern \"spec/requests/**/*_spec.rb\"\n   ```\n\n2. **Access the interactive API docs**:\n   - Start your Rails server (`rails server`)\n   - Visit `http://localhost:3000/api-docs` in your browser\n   - Explore and test API endpoints directly from the browser\n\n### Alternative Documentation\n\nYou can also refer to the static [API Documentation](API_Documentation.md) for quick reference.\n\n### Updating API Documentation\n\nThe API documentation is automatically generated from RSpec request specs. To update the documentation:\n\n1. Modify the relevant request specs in `spec/requests/`\n2. Run the specs to regenerate the documentation:\n   ```bash\n   bundle exec rspec --pattern \"spec/requests/**/*_spec.rb\"\n   ```\n3. The Swagger JSON will be updated automatically\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faanktia%2Fgood-night-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faanktia%2Fgood-night-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faanktia%2Fgood-night-app/lists"}