{"id":34036516,"url":"https://github.com/jm-sky/fastapi-blocks-registry","last_synced_at":"2026-04-04T12:59:04.115Z","repository":{"id":320093571,"uuid":"1080748891","full_name":"jm-sky/fastapi-blocks-registry","owner":"jm-sky","description":"A modular scaffolding system for FastAPI backends, inspired by shadcn-vue.","archived":false,"fork":false,"pushed_at":"2025-11-07T15:36:48.000Z","size":576,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-12-15T12:23:29.383Z","etag":null,"topics":["backend","boilerplate","cli","fastapi","python","scaffolding"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jm-sky.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2025-10-21T20:11:25.000Z","updated_at":"2025-11-07T15:36:49.000Z","dependencies_parsed_at":"2025-10-21T23:29:08.556Z","dependency_job_id":"40f7b03c-864c-4b2d-a79c-6ff6b21e837f","html_url":"https://github.com/jm-sky/fastapi-blocks-registry","commit_stats":null,"previous_names":["jm-sky/fastapi-blocks-registry"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jm-sky/fastapi-blocks-registry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jm-sky%2Ffastapi-blocks-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jm-sky%2Ffastapi-blocks-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jm-sky%2Ffastapi-blocks-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jm-sky%2Ffastapi-blocks-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jm-sky","download_url":"https://codeload.github.com/jm-sky/fastapi-blocks-registry/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jm-sky%2Ffastapi-blocks-registry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31400460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"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":["backend","boilerplate","cli","fastapi","python","scaffolding"],"created_at":"2025-12-13T20:28:44.302Z","updated_at":"2026-04-04T12:59:04.110Z","avatar_url":"https://github.com/jm-sky.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧩 FastAPI Blocks Registry\n\nA modular scaffolding system for FastAPI backends, inspired by **shadcn-vue**.\nAdd production-ready modules (like `auth`, `users`, `billing`) to your FastAPI project with a single CLI command.\n\n## 🎯 Project Goal\n\nFastAPI Blocks Registry allows you to quickly add complete, production-ready modules to your FastAPI projects. Each module includes models, schemas, routers, services, and all necessary configurations - just copy and customize.\n\nUnlike traditional packages, modules are copied directly into your project, giving you full control to modify and adapt them to your needs.\n\n## ✨ Features\n\n- 📦 **Copy, not install** - Modules are copied into your project for full customization\n- 🔧 **Auto-configuration** - Automatically updates `main.py`, `requirements.txt`, and `.env`\n- 🎨 **Production-ready** - Each module follows best practices and includes proper error handling\n- 🔒 **Type-safe** - Full type hints and Pydantic validation\n- 📚 **Well-documented** - Clear code structure with docstrings\n- 🚀 **Quick start** - Get authentication, user management, and more in seconds\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\n# Install from source (for development)\npip install -e .\n\n# Or install from PyPI (when published)\npip install fastapi-blocks-registry\n```\n\n### Usage\n\n```bash\n# Initialize a new FastAPI project\nfastapi-registry init\n\n# List available modules\nfastapi-registry list\n\n# Show module details\nfastapi-registry info auth\n\n# Add a module to your project\nfastapi-registry add auth\n\n# Remove a module\nfastapi-registry remove auth\n```\n\n### What Gets Installed\n\nWhen you initialize a project, the CLI creates:\n- ✅ Complete FastAPI project structure with `app/` directory\n- ✅ Backend documentation in `app/README.md` (architecture, patterns, best practices)\n- ✅ Configuration files (`.env`, `requirements.txt`, `pyproject.toml`)\n- ✅ Core utilities (`config.py`, `database.py`, middleware)\n\nWhen you add a module, the CLI automatically:\n- ✅ Copies module files to `app/modules/\u003cmodule\u003e/`\n- ✅ Updates `main.py` to register the router\n- ✅ Adds dependencies to `requirements.txt`\n- ✅ Adds environment variables to `.env`\n\n## 📦 Available Modules\n\n### Auth Module\n\nComplete JWT-based authentication system with:\n- User registration with password strength validation\n- Login with JWT access and refresh tokens\n- Password reset flow\n- Password change for authenticated users\n- Token blacklisting support\n\n**Endpoints:**\n- `POST /api/v1/auth/register` - Register new user\n- `POST /api/v1/auth/login` - Login user\n- `POST /api/v1/auth/refresh` - Refresh access token\n- `POST /api/v1/auth/forgot-password` - Request password reset\n- `POST /api/v1/auth/reset-password` - Reset password with token\n- `POST /api/v1/auth/change-password` - Change password (authenticated)\n- `GET /api/v1/auth/me` - Get current user info\n\n**Technologies:**\n- PyJWT for token management\n- Passlib + bcrypt for password hashing\n- Pydantic for validation\n- In-memory user store (easily replaceable with database)\n\n## 🏗️ Project Structure\n\n```\nfastapi-blocks-registry/\n├── fastapi_registry/\n│   ├── __init__.py\n│   ├── cli.py                  # CLI implementation\n│   ├── registry.json           # Module registry\n│   ├── core/\n│   │   ├── file_utils.py       # File operations\n│   │   ├── installer.py        # Module installer\n│   │   └── registry_manager.py # Registry management\n│   ├── modules/\n│   │   └── auth/               # Auth module\n│   │       ├── __init__.py\n│   │       ├── models.py       # User model \u0026 store\n│   │       ├── schemas.py      # Pydantic schemas\n│   │       ├── router.py       # FastAPI routes\n│   │       ├── service.py      # Business logic\n│   │       ├── dependencies.py # FastAPI dependencies\n│   │       ├── auth_utils.py   # JWT \u0026 password utils\n│   │       └── exceptions.py   # Custom exceptions\n│   └── templates/              # Project templates\n│       └── fastapi_project/\n│           └── app/\n│               └── README.md   # Backend documentation (copied to projects)\n├── tests/\n├── docs/\n├── CLAUDE.md                   # Development guidelines\n├── README.md\n└── pyproject.toml\n```\n\n## 🧠 Module Structure\n\nEach module follows a consistent structure:\n\n- **`models.py`** - Data models (Pydantic or SQLAlchemy)\n- **`schemas.py`** - Request/response schemas with validation\n- **`router.py`** - FastAPI route definitions\n- **`service.py`** - Business logic layer\n- **`dependencies.py`** - FastAPI dependency injection\n- **`exceptions.py`** - Module-specific exceptions\n- **`__init__.py`** - Module initialization\n\n## 💻 Example Usage\n\n### Starting from Scratch\n\n#### 1. Initialize a new project\n\n```bash\n# Create project directory\nmkdir my-fastapi-app\ncd my-fastapi-app\n\n# Initialize project structure\nfastapi-registry init --name \"My FastAPI App\"\n```\n\n#### 2. Set up virtual environment\n\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n#### 3. Install dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n#### 4. Add modules\n\n```bash\n# Add authentication module\nfastapi-registry add auth\n```\n\n#### 5. Configure and run\n\n```bash\n# Edit .env with your settings\n# Then start the server\nuvicorn main:app --reload\n```\n\n### Adding to Existing Project\n\n#### 1. Add the auth module to your project\n\n```bash\ncd your-fastapi-project\nfastapi-registry add auth\n```\n\n#### 2. Install dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n#### 3. Configure environment variables\n\nEdit your `.env` file:\n```bash\nSECRET_KEY=your-secret-key-min-32-characters\nJWT_ALGORITHM=HS256\nACCESS_TOKEN_EXPIRES_MINUTES=30\nREFRESH_TOKEN_EXPIRES_DAYS=7\n```\n\n#### 4. Start your server\n\n```bash\nuvicorn main:app --reload\n```\n\n#### 5. Test the endpoints\n\n```bash\n# Register a new user\ncurl -X POST \"http://localhost:8000/api/v1/auth/register\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"email\": \"user@example.com\",\n    \"password\": \"Test123!@#\",\n    \"name\": \"Test User\"\n  }'\n\n# Login\ncurl -X POST \"http://localhost:8000/api/v1/auth/login\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"email\": \"user@example.com\",\n    \"password\": \"Test123!@#\"\n  }'\n```\n\n## 🔧 CLI Commands\n\n### `fastapi-registry init`\nInitialize a new FastAPI project with proper structure:\n- Creates `main.py` with FastAPI app setup\n- Sets up `app/` directory structure with backend-specific documentation\n- Creates `app/core/` with config and database utilities\n- Creates `app/modules/` for your modules\n- Generates `requirements.txt` with essential dependencies\n- Creates `.env` with default configuration\n- Adds `.gitignore`, `README.md`, and development config files\n- Includes `app/README.md` with backend architecture documentation\n- Includes code quality tools config (`.flake8`, `.pylintrc`, `pyproject.toml`)\n\n**Options:**\n- `--project-path, -p` - Path to create project (default: current directory)\n- `--name, -n` - Project name (default: directory name)\n- `--description, -d` - Project description\n- `--force, -f` - Initialize even if directory is not empty\n\n**Example:**\n```bash\n# Initialize in current directory\nfastapi-registry init\n\n# Create a new project directory\nmkdir my-api \u0026\u0026 cd my-api\nfastapi-registry init --name \"My API\" --description \"My awesome API\"\n\n# Initialize in specific path\nfastapi-registry init --project-path /path/to/project\n```\n\n### `fastapi-registry list`\nDisplay all available modules from the registry\n\n**Options:**\n- `--search, -s` - Search modules by name or description\n\n### `fastapi-registry info \u003cmodule\u003e`\nShow detailed information about a specific module\n\n### `fastapi-registry add \u003cmodule\u003e`\nAdd a module to your project:\n- Copies module files to `app/modules/\u003cmodule\u003e/`\n- Updates `main.py` with router registration\n- Adds dependencies to `requirements.txt`\n- Adds environment variables to `.env`\n\n**Options:**\n- `--project-path, -p` - Path to FastAPI project (default: current directory)\n- `--yes, -y` - Skip confirmation prompts\n\n### `fastapi-registry remove \u003cmodule\u003e`\nRemove a module from your project (manual cleanup required for dependencies)\n\n**Options:**\n- `--project-path, -p` - Path to FastAPI project (default: current directory)\n- `--yes, -y` - Skip confirmation prompts\n\n### `fastapi-registry version`\nShow version information\n\n## 🛠️ Development\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/fastapi-blocks-registry\ncd fastapi-blocks-registry\n\n# Create virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n\n# Install in editable mode\npip install -e .\n```\n\n### Local Development \u0026 Testing\n\nTo run the CLI locally without publishing to PyPI:\n\n```bash\n# Activate virtual environment\nsource .venv/bin/activate\n\n# Install in editable mode\npip install -e .\n\n# Test the CLI\nfastapi-registry --help\nfastapi-registry list\n\n# Create a test project\ncd /tmp\nfastapi-registry init my-test-app --name \"TestApp\"\ncd my-test-app\nfastapi-registry add auth --yes\n```\n\nFor detailed testing guide and additional methods (build \u0026 install from wheel, TestPyPI testing, automated tests), see [docs/LOCAL_TESTING.md](docs/LOCAL_TESTING.md).\n\n### Running Tests\n\n```bash\npytest\n```\n\n### Code Quality\n\n```bash\n# Format code\nblack .\n\n# Lint code\nruff check .\n\n# Type checking\nmypy fastapi_registry\n```\n\n## 🔮 Roadmap\n\n- [x] CLI implementation with Typer\n- [x] Project initialization command\n- [x] Auth module with JWT\n- [x] Auto-configuration system\n- [ ] Users module with RBAC\n- [ ] Database integration (SQLAlchemy)\n- [ ] Alembic migrations support\n- [ ] Email module\n- [ ] Billing/subscription module\n- [ ] Projects/workspaces module\n- [ ] Remote registry support (GitHub)\n- [ ] PyPI publication\n- [ ] Module templates generator\n- [ ] Test generation for modules\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📄 License\n\nMIT\n\n## 🙏 Inspiration\n\nThis project is inspired by:\n- [shadcn-vue](https://github.com/shadcn-ui/ui) - Copy, don't install philosophy\n- [FastAPI](https://fastapi.tiangolo.com/) - Modern Python web framework\n- [Typer](https://typer.tiangolo.com/) - CLI framework by the creator of FastAPI\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjm-sky%2Ffastapi-blocks-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjm-sky%2Ffastapi-blocks-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjm-sky%2Ffastapi-blocks-registry/lists"}