{"id":23703368,"url":"https://github.com/tushar-3549/api-development","last_synced_at":"2026-05-15T22:05:39.307Z","repository":{"id":269250905,"uuid":"904115290","full_name":"tushar-3549/API-Development","owner":"tushar-3549","description":"FastAPI application showcasing backend development with Python, including RESTful APIs, database integration with PostgreSQL, and modern development practices.","archived":false,"fork":false,"pushed_at":"2025-05-26T15:09:20.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T15:24:02.790Z","etag":null,"topics":["api-development","backend","fastapi","jwt","oauth2","postgresql-database","sqlalchemy"],"latest_commit_sha":null,"homepage":"","language":"Python","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/tushar-3549.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":"2024-12-16T09:29:58.000Z","updated_at":"2025-05-26T15:09:24.000Z","dependencies_parsed_at":"2024-12-22T06:26:08.005Z","dependency_job_id":"35e35ceb-e6cc-4e1d-b014-e3f6918d6aba","html_url":"https://github.com/tushar-3549/API-Development","commit_stats":null,"previous_names":["tushar-3549/api-development"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tushar-3549/API-Development","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushar-3549%2FAPI-Development","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushar-3549%2FAPI-Development/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushar-3549%2FAPI-Development/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushar-3549%2FAPI-Development/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tushar-3549","download_url":"https://codeload.github.com/tushar-3549/API-Development/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushar-3549%2FAPI-Development/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016101,"owners_count":26085802,"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-13T02:00:06.723Z","response_time":61,"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-development","backend","fastapi","jwt","oauth2","postgresql-database","sqlalchemy"],"created_at":"2024-12-30T13:01:36.163Z","updated_at":"2026-05-15T22:05:39.300Z","avatar_url":"https://github.com/tushar-3549.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Share Thoughts API\n\n[![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=for-the-badge\u0026logo=fastapi)](https://fastapi.tiangolo.com/)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)](https://www.postgresql.org/)\n[![Render](https://img.shields.io/badge/Render-46E3B7?style=for-the-badge\u0026logo=render\u0026logoColor=white)](https://render.com/)\n\nA modern, high-performance Social Media API backend built with **FastAPI**, **PostgreSQL**, and **SQLAlchemy**. This API supports secure authentication, real-time voting, nested comments, and seamless deployment.\n\n---\n\n## 🚀 Features\n\n- **Secure Authentication**: OAuth2 with JWT (Access \u0026 Refresh tokens).\n- **Post Management**: Full CRUD operations for user posts.\n- **Commenting System**: Add and retrieve comments for any post.\n- **Dynamic Voting**: Smart vote toggling (Like/Unlike) and vote counts.\n- **User Profiles**: Dedicated endpoints for user registration and profile management.\n- **Database Versioning**: Automated migrations with Alembic.\n- **Safety First**: Built-in protection against SQL Injection using SQLAlchemy ORM.\n- **System Health**: Real-time health check endpoint for API and Database status.\n\n---\n\n## 🛠️ Tech Stack\n\n- **Framework**: [FastAPI](https://fastapi.tiangolo.com/)\n- **Database**: [PostgreSQL](https://www.postgresql.org/)\n- **ORM**: [SQLAlchemy](https://www.sqlalchemy.org/)\n- **Migrations**: [Alembic](https://alembic.sqlalchemy.org/)\n- **Validation**: [Pydantic v2](https://docs.pydantic.dev/)\n- **Auth**: [JOSE](https://python-jose.readthedocs.io/) \u0026 [Passlib](https://passlib.readthedocs.io/)\n- **Server**: [Uvicorn](https://www.uvicorn.org/)\n\n---\n\n## 🏁 Getting Started\n\n### Prerequisites\n\n- Python 3.10+\n- PostgreSQL installed and running\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/tushar-3549/API-Development.git\n   cd API-Development\n   ```\n\n2. **Setup virtual environment**\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # Windows: venv\\Scripts\\activate\n   ```\n\n3. **Install dependencies**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Environment Variables**\n   Create a `.env` file in the root directory:\n   ```env\n   DATABASE_HOSTNAME=localhost\n   DATABASE_PORT=5432\n   DATABASE_NAME=social_media\n   DATABASE_USERNAME=postgres\n   DATABASE_PASSWORD=your_password\n   SECRET_KEY=your_secure_random_key\n   ALGORITHM=HS256\n   ACCESS_TOKEN_EXPIRE_MINUTES=30\n   ```\n\n5. **Run Migrations**\n   ```bash\n   alembic upgrade head\n   ```\n\n6. **Start the Server**\n   ```bash\n   uvicorn app.main:app --reload\n   ```\n\n---\n\n## 📖 API Documentation\n\nOnce the server is running, you can access the interactive Swagger UI at:\n- **Local**: `http://127.0.0.1:8000/docs`\n- **ReDoc**: `http://127.0.0.1:8000/redoc`\n\n### Primary Endpoints\n\n| Category | Method | Endpoint | Description | Auth Required |\n| :--- | :--- | :--- | :--- | :---: |\n| **Auth** | `POST` | `/login` | User login \u0026 get tokens | No |\n| | `POST` | `/auth/refresh` | Refresh access token | Yes (Refresh) |\n| **Users** | `POST` | `/users` | Register a new user | No |\n| | `GET` | `/users/me` | Get current user profile | Yes |\n| **Posts** | `GET` | `/posts` | List all posts (with pagination/search/sort) | Yes |\n| | `POST` | `/posts` | Create a new post | Yes |\n| | `GET` | `/posts/{id}` | Get post details | Yes |\n| | `DELETE` | `/posts/{id}` | Delete a post | Yes |\n| | `PUT` | `/posts/{id}` | Update a post | Yes |\n| **Comments**| `POST` | `/posts/{id}/comments` | Add a comment to a post | Yes |\n| | `GET` | `/posts/{id}/comments` | List comments for a post | No |\n| **Votes** | `POST` | `/vote` | Vote on a post | Yes |\n| | `POST` | `/vote/toggle` | Toggle vote (Like/Unlike) | Yes |\n| | `GET` | `/vote/{post_id}` | Get total votes for a post | No |\n| **Health** | `GET` | `/health` | API \u0026 Database health check | No |\n\n---\n\n## ☁️ Deployment\n\nThis project is configured for one-click deployment on **Render** using a Blueprint.\n\n### Deploy to Render\n1. Push your code to GitHub.\n2. In the Render Dashboard, click **New +** -\u003e **Blueprint**.\n3. Select this repository.\n4. Render will use the `render.yaml` to provision a PostgreSQL database and a Web Service automatically.\n\n---\n\n## 🧪 Testing\n\nRun the test suite using `pytest`:\n```bash\npytest\n```\n\n**ER Diagram**\n\n![fastapi - public](https://github.com/user-attachments/assets/fd5483ed-7abf-4943-a931-e8c9e365b17b)\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftushar-3549%2Fapi-development","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftushar-3549%2Fapi-development","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftushar-3549%2Fapi-development/lists"}