A serverless Personal/CV PoC API built with AWS Lambda, API Gateway, and Python with automated deployment and API key management.
- Serverless Architecture: Built with AWS Lambda and API Gateway
- RESTful API Design: Clean, intuitive endpoints with API key authentication
- CORS Enabled: Frontend-friendly with proper CORS headers
- Search Functionality: Search through CV content
- Modular Data Access: Different endpoints for different CV sections
- Infrastructure as Code: SAM template for easy deployment
- Automated Deployment: Complete deployment script with API key management
- Cost Effective: Runs entirely within AWS free tier limits
All endpoints require API key authentication via the x-api-key header.
| Endpoint | Method | Description |
|---|---|---|
/ or /cv |
GET | Get complete CV data |
/cv/personal |
GET | Get personal information only |
/cv/experience |
GET | Get work experience |
/cv/education |
GET | Get education information |
/cv/skills |
GET | Get technical skills |
/cv/projects |
GET | Get project portfolio |
/cv/summary |
GET | Get professional summary |
/cv/certifications |
GET | Get certifications |
/cv/languages |
GET | Get languages spoken |
/cv/achievements |
GET | Get achievements |
/cv/interests |
GET | Get interests and hobbies |
/cv/search?q=keyword |
GET | Search through CV content |
- Backend: Python 3.12
- Cloud Services: AWS Lambda, API Gateway
- Infrastructure: AWS SAM (Serverless Application Model)
- Deployment: AWS CloudFormation
- API Security: API Gateway API Keys and Usage Plans
personal-api/
βββ src/
β βββ lambda_function.py # Main Lambda function
βββ .envrc # direnv environment configuration
βββ devbox.json # devbox development environment
βββ devbox.lock # devbox lockfile
βββ deployment.sh # Automated deployment script
βββ template.yaml # SAM template (production)
βββ template-local.yaml # SAM template for local testing
βββ samconfig.toml # SAM configuration
βββ README.md # This file
- AWS Account (free tier eligible)
- AWS CLI configured with appropriate permissions
- SAM CLI installed
- Python 3.12+
- jq (optional, for better JSON parsing)
This project uses devbox and direnv for consistent development environments.
-
Install devbox
curl -fsSL https://get.jetpack.io/devbox | bash -
Install direnv
# For Ubuntu/Debian sudo apt-get install direnv # For other distributions, visit: https://direnv.net/docs/installation.html
-
Configure direnv Add to your
~/.bashrcor~/.zshrc:eval "$(direnv hook bash)" # or zsh
-
Clone the repository and set up environment
git clone https://github.com/yourusername/personal-api.git cd personal-api -
Allow direnv
direnv allow
Now your development environment will automatically load the correct dependencies when you enter the project directory.
The project includes a comprehensive deployment.sh script that handles the complete deployment lifecycle:
# Make the script executable
chmod +x deployment.sh
# Deploy the application (interactive)
./deployment.sh deploy
# Or use the interactive menu
./deployment.sh./deployment.sh deploy # Deploy application with optional API key creation
./deployment.sh destroy # Complete cleanup of all resources
./deployment.sh newkey # Create additional API keys for existing deployment
./deployment.sh # Interactive menu-
Update CV data
- Edit
src/lambda_function.py - Replace the
CV_DATAdictionary with your information
- Edit
-
Test locally
sam build sam local start-api -t template-local.yaml -
Deploy to AWS
sam build sam deploy --config-file samconfig.toml
After deployment using deployment.sh, you'll receive an API key. Test your endpoints:
# Example with your API key
curl -H "x-api-key: YOUR_API_KEY" https://your-api-id.execute-api.eu-west-1.amazonaws.com/Stage/cv
# Test specific endpoints
curl -H "x-api-key: YOUR_API_KEY" https://your-api-id.execute-api.eu-west-1.amazonaws.com/Stage/cv/skills
curl -H "x-api-key: YOUR_API_KEY" https://your-api-id.execute-api.eu-west-1.amazonaws.com/Stage/cv/search?q=pythonThe samconfig.toml file contains deployment settings:
- Stack name:
personal-api - Region:
eu-west-1 - Stage:
Stage
- All endpoints require API key authentication
- Usage plans limit requests to 1000/month with 10 requests/second rate limit
- Burst limit of 20 requests
The deployment.sh script automatically handles API key creation:
- During initial deployment: Script prompts to create an API key
- Create additional keys: Use
./deployment.sh newkey - Automatic usage plan linking: Keys are automatically associated with usage plans
- Monthly quota: 1000 requests
- Rate limit: 10 requests per second
- Burst limit: 20 requests
- CloudWatch Logs: Automatic logging for Lambda function
- CloudWatch Metrics: Monitor invocation count, duration, errors
- API Gateway Metrics: Track API usage, throttling, and errors
- Usage Plan Monitoring: Track API key usage against quotas
To completely remove all resources:
./deployment.sh destroyThis will:
- Delete the CloudFormation stack
- Remove all usage plans
- Delete all associated API keys
- Clean up all AWS resources
- Add route handling in
src/lambda_function.py - Update the
template.yamlwith new API Gateway events - Redeploy using
./deployment.sh deploy
Edit the CV_DATA dictionary in src/lambda_function.py with your personal information.
- Check CloudWatch logs for Lambda function errors
- Use
sam local start-apifor local testing - Review API Gateway logs for request/response issues
- CI/CD Pipeline: GitHub Actions or AWS CodePipeline integration
- DynamoDB Integration: Store CV data in DynamoDB for dynamic updates
- API Versioning: Support for multiple API versions
- Frontend Integration: React/Vue.js frontend dashboard
- Enhanced Monitoring: Custom CloudWatch dashboards and alarms
This project is licensed under the MIT License - see the LICENSE file for details.
This is a proof-of-concept project created for demonstration purposes. Feel free to fork and modify according to your needs.