{"id":23947500,"url":"https://github.com/ledsouza/chirpy","last_synced_at":"2026-06-22T09:32:03.871Z","repository":{"id":270523639,"uuid":"910255809","full_name":"ledsouza/chirpy","owner":"ledsouza","description":"Chirpy is a REST API project built with Golang, inspired by Twitter, offering core functionalities like user creation, authentication, chirping (posting), and basic administrative features.","archived":false,"fork":false,"pushed_at":"2025-01-05T14:16:52.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T07:33:30.932Z","etag":null,"topics":["go","golang","goose","jwt","postgresql","sqlc"],"latest_commit_sha":null,"homepage":"","language":"Go","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/ledsouza.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}},"created_at":"2024-12-30T20:03:29.000Z","updated_at":"2025-01-05T14:20:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"930e4930-8f36-4313-acee-3ea4ad5f87b5","html_url":"https://github.com/ledsouza/chirpy","commit_stats":null,"previous_names":["ledsouza/chirpy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ledsouza/chirpy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledsouza%2Fchirpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledsouza%2Fchirpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledsouza%2Fchirpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledsouza%2Fchirpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ledsouza","download_url":"https://codeload.github.com/ledsouza/chirpy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledsouza%2Fchirpy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34643598,"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-22T02:00:06.391Z","response_time":106,"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":["go","golang","goose","jwt","postgresql","sqlc"],"created_at":"2025-01-06T09:20:02.585Z","updated_at":"2026-06-22T09:32:03.865Z","avatar_url":"https://github.com/ledsouza.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chirpy - A Twitter-like API built with Golang\n\nChirpy is a REST API project built with Golang, inspired by Twitter, offering core functionalities like user creation, authentication, chirping (posting), and basic administrative features.  It serves as a practical example of building a backend API, demonstrating the use of various technologies and best practices.\n\n## Why Chirpy?\n\nThis project is valuable for developers looking to:\n\n* **Learn Golang API Development:** Explore building a RESTful API with Go, handling routing, database interactions, and authentication.\n* **Understand Database Migrations:**  The project utilizes `goose` for database migrations, showcasing how to manage database schema changes effectively.\n* **Implement JWT Authentication:**  Chirpy incorporates JWT (JSON Web Token) for secure user authentication and authorization.\n* **Practice with PostgreSQL and SQLX:** See how to interact with a PostgreSQL database using `psql` for code generation from SQL queries.\n* **Study API Metrics and Monitoring:**  Basic administrative endpoints provide insights into API usage and allow for resetting data in a development environment.\n\n## Features\n\n* **User Management:** Create, update, and log in users.\n* **Chirping:** Post and retrieve chirps (tweets), including listing chirps by author and sorting.\n* **Authentication:** Secure API access with JWT, including refresh and revoke token functionality.\n* **Administrative Features:**  Metrics tracking and data reset capabilities (dev environment only).\n* **Database Migrations:** Managed using `goose`.\n* **PostgreSQL Integration:**  Leveraging `psql` for SQL query-based code generation.\n\n\n## Installation and Running\n\n### Prerequisites\n\n* **Go:** Make sure you have Go installed on your system.  You can download it from [https://go.dev/dl/](https://go.dev/dl/).\n* **PostgreSQL:**  Install and set up a PostgreSQL database.\n* **Goose:** Install the `goose` CLI tool for database migrations. ([https://github.com/pressly/goose](https://github.com/pressly/goose))\n* **psql:** Ensure you have the `psql` command-line utility available for interacting with your PostgreSQL database.\n\n\n### Steps\n\n1. **Clone the Repository:**\n\n```bash\ngit clone https://github.com/ledsouza/chirpy.git\ncd chirpy\n```\n\n2. **Set Up Environment Variables:**\n\nCreate a `.env` file in the root directory and add the following environment variables:\n\n```\nDB_URL=your_postgresql_connection_string  # Example: postgres://user:password@host:port/database?sslmode=disable\nPLATFORM=dev  # Or \"prod\"\nJWT_SECRET_KEY=your_secret_key\nPOLKA_KEY=your_polka_api_key\n```\n\n3. **Run Database Migrations:**\n\n```bash\ngoose postgres \"postgres://username:password@localhost:5432/chirpy\" up \n```\n\n4. **Run the Application:**\n\n```bash\ngo run main.go\n```\n\nThe API will start running on port 8080.\n\n\n## Contributing\n\nContributions are welcome!  Please feel free to open issues and submit pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fledsouza%2Fchirpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fledsouza%2Fchirpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fledsouza%2Fchirpy/lists"}