Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,90 @@ Base URL: `http://localhost:8000`

`GET /health` — Returns service status and dependency health.

```bash
curl http://localhost:8000/health
```

Example response:

```json
{"status": "ok", "version": "0.1.0"}
```

### Authentication

`POST /auth/register` — Create a new account.

```bash
curl -X POST http://localhost:8000/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "dev@example.com", "password": "s3cret"}'
```

`POST /auth/login` — Obtain a JWT access token.

```bash
curl -X POST http://localhost:8000/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "dev@example.com", "password": "s3cret"}'
```

Example response (store the token for authenticated calls):

```json
{"access_token": "<jwt>", "token_type": "bearer"}
```

### Profiles

`POST /profiles` — Create a profile with resume and GitHub username.

```bash
curl -X POST http://localhost:8000/profiles \
-H "Authorization: Bearer <jwt>" \
-H "Content-Type: application/json" \
-d '{"resume": "Experienced Python developer...", "github_username": "octocat"}'
```

`GET /profiles/{profile_id}` — Retrieve a profile.

```bash
curl http://localhost:8000/profiles/1 \
-H "Authorization: Bearer <jwt>"
```

`DELETE /profiles/{profile_id}` — Delete a profile and associated data.

```bash
curl -X DELETE http://localhost:8000/profiles/1 \
-H "Authorization: Bearer <jwt>"
```

### Reviews

`POST /reviews` — Request a new portfolio review for a profile.

```bash
curl -X POST http://localhost:8000/reviews \
-H "Authorization: Bearer <jwt>" \
-H "Content-Type: application/json" \
-d '{"profile_id": 1}'
```

`GET /reviews/{review_id}` — Retrieve a completed review.

```bash
curl http://localhost:8000/reviews/1 \
-H "Authorization: Bearer <jwt>"
```

`GET /reviews` — List reviews for the authenticated user (paginated).

```bash
curl "http://localhost:8000/reviews?page=1&page_size=10" \
-H "Authorization: Bearer <jwt>"
```

## Interactive Docs

When the API is running, visit:
Expand Down
Loading