Portfolio Necromancer now includes a complete fullstack web application with:
pip install -e .
python -m portfolio_necromancer.api.server
Or with custom options:
python -m portfolio_necromancer.api.server --host 0.0.0.0 --port 8080 --debug
Open your browser and navigate to:
http://localhost:5000/
GET /api/health
Returns API status and version information.
Response:
{
"status": "healthy",
"version": "0.1.0",
"timestamp": "2025-11-21T06:00:00.000000+00:00"
}
POST /api/generate
Generate a portfolio from manually provided project data.
Request Body:
{
"owner": {
"name": "Your Name",
"email": "you@example.com",
"title": "Developer",
"bio": "Your bio"
},
"projects": [
{
"title": "Project Title",
"description": "Project description",
"category": "code",
"tags": ["python", "web"],
"url": "https://project.com"
}
],
"theme": "modern",
"color_scheme": "blue"
}
Response:
{
"success": true,
"portfolio_id": "uuid-here",
"download_url": "/api/download/uuid-here",
"preview_url": "/api/preview/uuid-here",
"project_count": 1,
"message": "Portfolio generated successfully"
}
POST /api/generate/auto
Auto-generate portfolio from configured data sources.
Request Body:
{
"config": {
"user": {
"name": "Your Name",
"email": "you@example.com"
},
"google": {
"credentials_file": "credentials.json"
},
"slack": {
"token": "xoxb-your-token"
}
}
}
GET /api/preview/{portfolio_id}
Returns the generated portfolio HTML for preview.
GET /api/download/{portfolio_id}
Downloads the portfolio as a ZIP file.
GET /api/categories
Response:
{
"categories": ["Writing", "Design", "Code", "Miscellaneous Unicorn Work"]
}
GET /api/themes
Response:
{
"themes": ["modern"],
"color_schemes": ["blue", "green", "purple"]
}
import requests
# Generate portfolio
url = "http://localhost:5000/api/generate"
data = {
"owner": {
"name": "John Doe",
"email": "john@example.com",
"title": "Fullstack Developer",
"bio": "Passionate about building great software"
},
"projects": [
{
"title": "E-commerce Platform",
"description": "A scalable e-commerce solution",
"category": "code",
"tags": ["python", "django", "react"],
"url": "https://github.com/john/ecommerce"
}
],
"theme": "modern",
"color_scheme": "blue"
}
response = requests.post(url, json=data)
result = response.json()
print(f"Portfolio ID: {result['portfolio_id']}")
print(f"Preview: http://localhost:5000{result['preview_url']}")
print(f"Download: http://localhost:5000{result['download_url']}")
// Generate portfolio
const url = 'http://localhost:5000/api/generate';
const data = {
owner: {
name: 'Jane Smith',
email: 'jane@example.com',
title: 'Designer',
bio: 'Creating beautiful experiences'
},
projects: [
{
title: 'Brand Identity Design',
description: 'Complete brand redesign',
category: 'design',
tags: ['branding', 'logo', 'ui'],
url: 'https://behance.net/jane/project'
}
],
theme: 'modern',
color_scheme: 'purple'
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => {
console.log('Portfolio ID:', result.portfolio_id);
console.log('Preview:', result.preview_url);
console.log('Download:', result.download_url);
});
curl -X POST http://localhost:5000/api/generate \
-H "Content-Type: application/json" \
-d '{
"owner": {
"name": "Alex Developer",
"email": "alex@example.com",
"title": "Software Engineer"
},
"projects": [
{
"title": "My Project",
"description": "An amazing project",
"category": "code",
"tags": ["python", "api"]
}
],
"theme": "modern",
"color_scheme": "green"
}'
The built-in Flask development server is suitable for testing:
python -m portfolio_necromancer.api.server --debug
For production, use a WSGI server like Gunicorn:
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 'portfolio_necromancer.api.app:create_app()'
Create a Dockerfile:
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
RUN pip install -e .
EXPOSE 5000
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "portfolio_necromancer.api.app:create_app()"]
Build and run:
docker build -t portfolio-necromancer .
docker run -p 5000:5000 portfolio-necromancer
SECRET_KEY - Flask secret key (change in production)PORT - Server port (default: 5000)DEBUG - Enable debug mode (default: False)export SECRET_KEY="your-random-secret-key"
Use HTTPS in production
Rate limiting - Consider adding rate limiting for production
# Use a different port
python -m portfolio_necromancer.api.server --port 8080
Check firewall settings and ensure the server is running:
curl http://localhost:5000/api/health
Run the test suite:
pytest tests/test_api.py -v
Contributions to the API and dashboard are welcome! Please submit pull requests with:
Need Help? Open an issue on GitHub or check the main README.md