Tech Stack Advisor - Code Viewer

โ† Back to File Tree

API_QUICKSTART.md

Language: markdown | Path: API_QUICKSTART.md | Lines: 72
# Tech Stack Advisor API - Quick Start

## ๐Ÿš€ Start the Server

```bash
cd /Users/admin/codeprojects/tech-stack-advisor
source .venv/bin/activate
python -m backend.src.api.main
```

Server runs on: **http://localhost:8000**

---

## ๐Ÿ“– Interactive Docs

- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc

---

## ๐Ÿ”ฅ Quick Test

```bash
# Health check
curl http://localhost:8000/health

# Get recommendation
curl -X POST http://localhost:8000/recommend \
  -H "Content-Type: application/json" \
  -d '{"query":"Building a chat app for 100K users"}'

# Check metrics
curl http://localhost:8000/metrics
```

---

## ๐Ÿ“Š Available Endpoints

| Method | Endpoint | Description |
|--------|----------|-------------|
| GET | / | Web UI (with authentication) |
| GET | /health | Health check |
| POST | /auth/register | Register new user |
| POST | /auth/login | Login (returns JWT) |
| POST | /auth/logout | Logout |
| GET | /auth/google/login | Google OAuth login |
| POST | /recommend | Get recommendations (requires JWT) |
| GET | /metrics | Usage stats (requires JWT) |
| POST | /feedback | Submit feedback (requires JWT) |
| GET | /admin/users | List users (admin only) |
| GET | /admin/feedback | View feedback (admin only) |

---

## ๐Ÿ›ก๏ธ Features

โœ… Rate limiting (5 req/hour demo)
โœ… Cost controls ($2/day budget)
โœ… Input validation
โœ… Structured logging
โœ… Error handling
โœ… CORS enabled

---

## ๐Ÿงช Run Tests

```bash
python test_api.py
```