{"id":29692243,"url":"https://github.com/gthomas08/realworld-fastapi","last_synced_at":"2026-04-15T10:36:01.579Z","repository":{"id":305933962,"uuid":"1023220083","full_name":"gthomas08/realworld-fastapi","owner":"gthomas08","description":"A modern FastAPI backend for the RealWorld spec, featuring JWT auth, article management, comments, user profiles, tags, and PostgreSQL support.","archived":false,"fork":false,"pushed_at":"2025-07-22T18:16:53.000Z","size":234,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-22T19:28:57.056Z","etag":null,"topics":["alembic","devcontainer","fastapi","grafana","openapi","opentelemetry","otel","postgres","pydantic","python","realworld","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/gthomas08.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-07-20T19:21:53.000Z","updated_at":"2025-07-22T18:16:56.000Z","dependencies_parsed_at":"2025-07-22T19:39:48.735Z","dependency_job_id":null,"html_url":"https://github.com/gthomas08/realworld-fastapi","commit_stats":null,"previous_names":["gthomas08/realworld-fastapi"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/gthomas08/realworld-fastapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gthomas08%2Frealworld-fastapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gthomas08%2Frealworld-fastapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gthomas08%2Frealworld-fastapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gthomas08%2Frealworld-fastapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gthomas08","download_url":"https://codeload.github.com/gthomas08/realworld-fastapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gthomas08%2Frealworld-fastapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31837465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T10:26:52.245Z","status":"ssl_error","status_checked_at":"2026-04-15T10:26:51.649Z","response_time":63,"last_error":"SSL_read: 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":["alembic","devcontainer","fastapi","grafana","openapi","opentelemetry","otel","postgres","pydantic","python","realworld","sqlalchemy"],"created_at":"2025-07-23T08:00:48.253Z","updated_at":"2026-04-15T10:36:01.559Z","avatar_url":"https://github.com/gthomas08.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RealWorld FastAPI\n\n[![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=for-the-badge\u0026logo=fastapi)](https://fastapi.tiangolo.com/)\n[![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54)](https://python.org)\n[![PostgreSQL](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)](https://postgresql.org)\n[![Poetry](https://img.shields.io/badge/Poetry-%233B82F6.svg?style=for-the-badge\u0026logo=poetry\u0026logoColor=0B3D8D)](https://python-poetry.org/)\n\n![Scalar API Documentation](docs/images/scalar.png)\n\nA modern, production-ready implementation of the [RealWorld specification](https://realworld-docs.netlify.app/) using FastAPI, PostgreSQL, and contemporary Python development practices. This project provides a robust backend API for a Medium-like social blogging platform with comprehensive user authentication, article management, and social features.\n\nWhile this implementation strives to closely follow the RealWorld specification, there may be minor variations in implementation details to align with FastAPI best practices and modern Python conventions.\n\n## ✨ Features\n\n- 🚀 **FastAPI** - High-performance async API framework\n- 🔐 **JWT Authentication** - Secure user authentication with FastAPI Users\n- 📚 **Article Management** - Create, read, update, delete articles with tagging\n- 💬 **Comments System** - Nested commenting on articles\n- 👥 **User Profiles** - Follow/unfollow users and view profiles\n- ❤️ **Favorites** - Like and favorite articles\n- 🏷️ **Tags** - Organize articles with tags\n- 🗄️ **PostgreSQL** - Robust relational database\n- 🔄 **Alembic Migrations** - Database schema management\n- 🧪 **Comprehensive Testing** - Unit and integration tests with pytest\n- 📖 **Interactive API Docs** - Auto-generated OpenAPI documentation\n\n## 🚀 Quick Start\n\n### Option 1: Dev Container (Recommended)\n\nThe fastest way to get started is using the provided Dev Container configuration:\n\n1. **Prerequisites**: Install [Docker](https://docker.com) and [VS Code](https://code.visualstudio.com/) with the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)\n\n2. **Launch**: Open the project in VS Code and click \"Reopen in Container\" when prompted, or:\n   ```bash\n   # Clone the repository\n   git clone https://github.com/gthomas08/realworld-fastapi\n   cd realworld-fastapi\n   \n   # Open in VS Code\n   code .\n   \n   # Use Command Palette (Ctrl+Shift+P): \"Dev Containers: Reopen in Container\"\n   ```\n\n3. **Setup database**:\n   ```bash\n   # Run database migrations\n   poetry run alembic upgrade head\n   ```\n\n4. **Run the application**:\n   ```bash\n   # The container automatically installs dependencies\n   # Start the development server\n   make run\n   # Or: poetry run uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload\n   ```\n\n5. **Access the API**:\n   - API: http://localhost:8000\n   - Interactive docs: http://localhost:8000/docs\n   - Scalar docs: http://localhost:8000/scalar\n\n### Option 2: Local Development\n\nIf you prefer to run locally without containers:\n\n#### Prerequisites\n\n| Tool | Version | Purpose |\n|------|---------|---------|\n| Python | 3.11+ | Runtime environment |\n| Poetry | Latest | Dependency management |\n| PostgreSQL | 12+ | Database |\n\n#### Installation\n\n1. **Clone and setup**:\n   ```bash\n   git clone https://github.com/gthomas08/realworld-fastapi\n   cd realworld-fastapi\n   \n   # Install dependencies\n   poetry install\n   ```\n\n2. **Database setup**:\n   ```bash\n   # Create PostgreSQL database\n   createdb realworld_fastapi\n   \n   # Set environment variables\n   cp .env.example .env\n   # Edit .env with your database credentials\n   ```\n\n3. **Run migrations**:\n   ```bash\n   poetry run alembic upgrade head\n   ```\n\n4. **Start the server**:\n   ```bash\n   make run\n   ```\n\n## ⚙️ Configuration\n\nCreate a `.env` file in the project root:\n\n```env\n# Database\nDATABASE_URL=postgresql+asyncpg://username:password@localhost/realworld_fastapi\n\n# Security\nSECRET_KEY=your-super-secret-key-here\n\n```\n\n## 🧪 Testing\n\nRun the comprehensive test suite:\n\n```bash\n# Run all tests\npoetry run pytest\n\n# Run specific test file\npoetry run pytest tests/test_tags.py\n\n# Run with verbose output\npoetry run pytest -v\n```\n\n## 🛠️ Development\n\n### Database Migrations\n\n```bash\n# Create a new migration\nmake migrate-autogen name=\"description_of_change\"\n\n# Apply migrations\nmake migrate-upgrade\n\n# Or using poetry directly:\npoetry run alembic revision --autogenerate -m \"description\"\npoetry run alembic upgrade head\n```\n\n### Code Quality\n\nThe project uses modern Python tooling:\n\n```bash\n# Format code\npoetry run ruff format\n\n# Lint code\npoetry run ruff check\n```\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eMade with ❤️ using FastAPI and modern Python\u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://realworld-docs.netlify.app/\"\u003eRealWorld\u003c/a\u003e •\n    \u003ca href=\"https://fastapi.tiangolo.com/\"\u003eFastAPI\u003c/a\u003e •\n    \u003ca href=\"https://python-poetry.org/\"\u003ePoetry\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgthomas08%2Frealworld-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgthomas08%2Frealworld-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgthomas08%2Frealworld-fastapi/lists"}