Introduction
The portfolio application is built with Angular 20 and supports both static and server-side rendering (SSR) deployment options. This guide covers the deployment process and available hosting options.Prerequisites
Before deploying, ensure you have:- Node.js 20+ installed
- All dependencies installed (
npm install) - Production environment variables configured
- Build process tested locally
Build for Production
To build the application for production:ng build with the production configuration, which:
- Enables optimization and minification
- Applies output hashing for cache busting
- Generates both browser and server bundles (for SSR)
- Enforces bundle size budgets (500kB initial warning, 1MB error)
The default build configuration is set to
production in angular.json.Output Structure
After building, the output is generated in thedist/portafolio/ directory:
Deployment Options
Static Hosting
Deploy to Vercel, Netlify, or GitHub Pages for simple static sites
SSR Deployment
Full server-side rendering for optimal SEO and performance
Docker
Containerize the application for cloud deployment
Cloud Platforms
Deploy to AWS, Google Cloud, or Azure
Static Hosting
For static hosting without SSR, you can deploy thedist/portafolio/browser/ directory to:
Vercel
- Install Vercel CLI:
npm i -g vercel - Run
vercelin the project root - Follow the prompts to deploy
Netlify
- Connect your Git repository to Netlify
- Set build command:
npm run build - Set publish directory:
dist/portafolio/browser - Deploy
GitHub Pages
- Build the project:
npm run build - Copy contents of
dist/portafolio/browser/to your GitHub Pages repository - Push to deploy
Server Deployment (SSR)
For server-side rendering deployment, you need a Node.js server environment. See the SSR Configuration guide for detailed setup instructions.Quick Start
After building:PORT environment variable).
Environment Considerations
Set Environment Variables
Configure production environment variables before deployment:
PORT: Server port (default: 4000)NODE_ENV: Set toproduction- API endpoints and keys as needed
Bundle Size Monitoring
The build enforces size budgets:
- Initial bundle: 500kB warning, 1MB error
- Component styles: 4kB warning, 8kB error
Performance Optimization
The production build automatically applies several optimizations:
- Code minification and tree-shaking
- Output hashing for cache busting
- License extraction
- Bundle size optimization
Next Steps
- Learn about SSR Configuration for server-side rendering setup
- Configure your hosting provider
- Set up CI/CD pipelines for automated deployment
- Monitor application performance and errors