A modern full-stack application built with Vue 3, TypeScript, PrimeVue, Python (FastAPI), and AWS CDK.
AwsFullstack/
├── frontend/ # Vue 3 + TypeScript + PrimeVue frontend
├── backend/ # Python FastAPI backend
├── infrastructure/ # AWS CDK infrastructure as code
└── README.md
- Vue 3 - Progressive JavaScript framework
- TypeScript - Type-safe JavaScript
- PrimeVue - Rich UI component library
- Vite - Fast build tool
- FastAPI - Modern Python web framework
- Pydantic - Data validation
- Mangum - AWS Lambda ASGI adapter
- Boto3 - AWS SDK for Python
- AWS CDK - Infrastructure as Code
- Lambda - Serverless compute
- API Gateway - REST API management
- S3 - Static website hosting
- CloudFront - Content delivery network
- Docker and Docker Compose
- Node.js 18+ and npm
- Python 3.11+ and pip
- AWS CLI configured with credentials
- AWS CDK CLI:
npm install -g aws-cdk
Run both frontend and backend with a single command:
docker-compose upThis will start:
- Frontend at
http://localhost:5173 - Backend API at
http://localhost:8000 - API Documentation at
http://localhost:8000/docs
To rebuild after changes:
docker-compose up --buildTo stop the services:
docker-compose downcd frontend
npm install
npm run devThe frontend will be available at http://localhost:5173
Create and activate virtual environment:
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtRun the development server:
python main.pyThe API will be available at http://localhost:8000
API documentation: http://localhost:8000/docs
cd infrastructure
npm installcd frontend
npm run buildcd infrastructure
cdk bootstrapcd infrastructure
npm run deployThis will:
- Package the Python backend as a Lambda function
- Deploy the frontend to S3
- Set up CloudFront distribution
- Create API Gateway endpoints
- Output the URLs for your application
cd infrastructure
npm run diffcd infrastructure
npm run destroyCreate a .env file in the backend/ directory:
ENVIRONMENT=development
AWS_REGION=us-east-1Create a .env file in the frontend/ directory:
VITE_API_URL=http://localhost:8000For production, update with your API Gateway URL after deployment.
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production build
python main.py- Start development serverpip freeze > requirements.txt- Export pip dependencies
docker-compose up- Start all servicesdocker-compose up --build- Rebuild and start servicesdocker-compose down- Stop all servicesdocker-compose logs -f- View logsdocker-compose ps- View running containers
npm run synth- Synthesize CloudFormation templatenpm run deploy- Deploy to AWSnpm run diff- Compare deployed stack with current statenpm run destroy- Destroy all AWS resources
- Start services:
docker-compose up - Make changes to frontend or backend code (hot-reload enabled)
- Test changes at
http://localhost:5173(frontend) andhttp://localhost:8000(backend) - When ready to deploy:
- Build frontend:
cd frontend && npm run build - Deploy:
cd infrastructure && npm run deploy
- Build frontend:
- The CORS configuration in
backend/main.pyallows all origins for development. Update for production. - Configure proper IAM roles and policies for Lambda functions
- Use environment variables for sensitive data
- Enable CloudFront access logging for production
- Consider adding API authentication (API keys, Cognito, etc.)