โ 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
```