Overview
The Production Inspection Form is built as a static Next.js application with static HTML export. This deployment guide covers building and hosting the application on various platforms.The application exports to static HTML files with client-side JavaScript for dynamic functionality. The exported build is located in the
/insp_pry/inspecciones base path.Build Process
The build process includes:
- JavaScript bundling and minification
- CSS optimization
- Static HTML generation
- Asset optimization
out/
├── _next/
│ └── static/
│ ├── chunks/ # JavaScript bundles
│ ├── css/ # Compiled stylesheets
│ └── media/ # Optimized images
├── index.html # Main form page
├── login.html # Login page
├── 404.html # Error page
└── favicon.ico # Site assets
Deployment Options
Option 1: Traditional Web Server
Nginx Configuration
Deploy to nginx with proper routing for the/insp_pry/inspecciones base path:
Apache Configuration
For Apache web server, use this.htaccess configuration:
Option 2: Docker Container
Create a containerized deployment:Option 3: CDN Deployment
For CDN hosting (CloudFront, Cloudflare, etc.), upload theout/ directory contents and configure:
- Origin Path:
/insp_pry/inspecciones - Default Root Object:
index.html - Error Pages: Redirect 404 to
/insp_pry/inspecciones/index.html - Cache Behavior: Cache
_next/static/*with long TTL
Environment-Specific Configuration
Base Path Configuration
The base path is defined innext.config.js:
API Endpoint Accessibility
The application communicates with
http://10.107.194.110/insp/ for authentication and data operations. Ensure network connectivity from client browsers.POST /api/login-ldap/- LDAP authenticationGET /api/divisiones/- Division dataGET /api/areas/- Area dataGET /api/zonas/- Zone dataGET /api/equipos/- Equipment dataGET /api/preguntas/{category}/- Inspection questionsPOST /api/guardar/- Save inspection form
Post-Deployment Verification
# Main form
curl https://your-domain.com/insp_pry/inspecciones/
# Login page
curl https://your-domain.com/insp_pry/inspecciones/login
Performance Optimization
Asset Optimization
The build process automatically optimizes:- JavaScript: Minified and code-split
- CSS: Extracted and minified
- Images: Optimized and properly formatted
Caching Strategy
Implement aggressive caching for static assets:CDN Recommendations
For optimal performance, serve the application through a CDN with edge locations close to your users.
Monitoring and Maintenance
Health Checks
Monitor these endpoints:- Application:
https://your-domain.com/insp_pry/inspecciones/ - API Backend:
http://10.107.194.110/insp/api/divisiones/
Update Procedures
Troubleshooting
404 Errors on Refresh
Problem: Page refreshes result in 404 errors. Solution: Configure your web server to redirect all requests toindex.html for client-side routing.
API CORS Issues
Problem: Browser blocks API requests due to CORS policy. Solution: Ensure the API server at10.107.194.110 includes proper CORS headers, or configure a reverse proxy.
Static Assets Not Loading
Problem: JavaScript/CSS files return 404. Solution: Verify the base path configuration matches your deployment path (/insp_pry/inspecciones).
Next Steps
- Configure application settings: Configuration
- Set up monitoring and analytics
- Implement backup procedures
- Review security considerations
