Skip to content
Back to skills

Backend Api Jawad Chaudhary Hackathone 2 Todo Sp

ASecurity

Build FastAPI REST APIs with CORS, JWT auth, Pydantic validation, async endpoints, and proper error handling. Use when creating API endpoints, middleware, or backend services.

  • 30 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 12, 2026
developmentpythonfastapitestingapibackend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 12, 2026

npx -y skills add majiayu000/claude-skill-registry-data --skill backend-api-jawad-chaudhary-hackathone-2-todo-sp --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Backend Api Jawad Chaudhary Hackathone 2 Todo Sp?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Backend Api Jawad Chaudhary Hackathone 2 Todo Sp
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-backend-api-jawad-chaudhary-hackathone-2-todo-sp-claude-skill-registry-data/badge)](https://www.skillsdirectory.com/skills/majiayu000-backend-api-jawad-chaudhary-hackathone-2-todo-sp-claude-skill-registry-data)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: backend-api
description: Build FastAPI REST APIs with CORS, JWT auth, Pydantic validation, async endpoints, and proper error handling. Use when creating API endpoints, middleware, or backend services.
---

# FastAPI Backend API Development

## Core Pattern
```python
from fastapi import FastAPI, HTTPException, Depends
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel, Field
import os

app = FastAPI(title="API")

# CORS from environment
app.add_middleware(
    CORSMiddleware,
    allow_origins=os.getenv("CORS_ORIGINS", "").split(","),
    allow_credentials=os.getenv("CORS_ALLOW_CREDENTIALS") == "true",
    allow_methods=["*"],
    allow_headers=["*"],
)

class Request(BaseModel):
    field: str = Field(..., min_length=1)

@app.post("/api/{user_id}/endpoint")
async def endpoint(user_id: str, req: Request, current_user: str = Depends(verify_jwt)):
    if user_id != current_user:
        raise HTTPException(status_code=403, detail="User ID mismatch")
    return {"status": "ok"}
```

## Error Handling
- Use `HTTPException` with proper status codes (401, 403, 404, 500)
- Provide user-friendly error messages
- Always use async for I/O operations

## Testing
```python
from fastapi.testclient import TestClient
client = TestClient(app)
response = client.post("/api/user123/endpoint", json={"field": "value"})
assert response.status_code == 200
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.