Overview
The Production Inspection Form requires configuration for API connectivity, authentication, and deployment settings. This guide covers all configurable aspects of the application.API Configuration
API Endpoint Settings
The application connects to a backend API server for data operations and authentication.Primary API Endpoint
The API base URL is configured in the main application component: File:app/page.jsx
Current API Endpoint:
http://10.107.194.110/insp/All API requests are made relative to this base URL.Available API Endpoints
The application interacts with the following API endpoints:| Endpoint | Method | Purpose |
|---|---|---|
/api/login-ldap/ | POST | LDAP user authentication |
/api/divisiones/ | GET | Fetch division list |
/api/areas/ | GET | Fetch area list |
/api/zonas/ | GET | Fetch zone list |
/api/equipos/ | GET | Fetch equipment list |
/api/preguntas/{category}/ | GET | Fetch inspection questions by category |
/api/guardar/ | POST | Save completed inspection form |
Modifying the API Endpoint
To configure a different API server:const handleSubmit = async (e) => {
e.preventDefault()
try {
const response = await fetch(
`https://your-api-server.com/api/login-ldap/`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username, password })
}
)
// ... rest of login logic
} catch (error) {
console.error(error)
}
}
Authentication Configuration
LDAP Authentication
The application uses LDAP for user authentication through the backend API.Authentication Flow
Expected API Response
Successful Login:Session Management
User sessions are managed using browserlocalStorage:
| Key | Purpose |
|---|---|
usuario_inspeccion | Stores the username |
usuario_nombre | Stores the full name (first + last) |
redirect_after_login | Stores the URL to redirect after successful login |
Authentication Guard
The main form page checks for authentication on load:Logout Functionality
Next.js Configuration
Base Path Configuration
The application is configured to run at a specific base path for deployment. File:next.config.js
Current Base Path:
/insp_pry/inspeccionesAll routes in the application are prefixed with this path.Changing the Base Path
To deploy at a different path:Form Configuration
Pre-filled Form Data
The inspection form can be pre-populated using URL query parameters.Equipment Pre-selection
Pass equipment ID in the URL to pre-populate form fields:equipo parameter and loads:
- Division
- Area
- Zone
- Equipment details
- Physical location
- Equipment category
- Inspection questions for that category
Inspection Questions
Inspection questions are loaded dynamically based on equipment category:Question Format
Each question has three possible responses:- OK: Item is satisfactory
- NOK: Item needs attention
- NA: Not applicable
Styling Configuration
Brand Colors
The application uses Goodyear brand colors:Component Styling
The application uses styled-jsx for component-scoped CSS:Custom Logo
Replace the Goodyear logo by updating: File:public/logo-goodyear.png
Environment Variables
While the current implementation uses hardcoded values, you can implement environment-based configuration:NEXT_PUBLIC_API_BASE=http://10.107.194.110/insp/
NEXT_PUBLIC_APP_NAME=Production Inspection Form
NEXT_PUBLIC_COMPANY_NAME=Goodyear
Localization
The application is currently configured for Spanish language (lang="es").
Language Settings
File:app/layout.jsx
Metadata Configuration
Security Considerations
HTTPS Configuration
To enforce HTTPS:- Configure SSL/TLS certificates on the API server
- Update API endpoint to use
https:// - Implement HSTS headers on the web server
CORS Configuration
Ensure the API server includes appropriate CORS headers:Content Security Policy
Implement CSP headers for additional security:Advanced Configuration
Custom Build ID
Generate a custom build ID for cache busting:Compression
Enable gzip compression in your web server configuration:Validation
Configuration Testing
After making configuration changes:fetch('http://10.107.194.110/insp/api/divisiones/')
.then(res => res.json())
.then(console.log)
.catch(console.error)
Troubleshooting
API Connection Failures
Problem: API requests fail or timeout. Solution:- Verify network connectivity to
10.107.194.110 - Check firewall rules
- Confirm API server is running
- Review CORS configuration
Authentication Issues
Problem: Login fails with valid credentials. Solution:- Check LDAP server connectivity
- Verify API endpoint
/api/login-ldap/is correct - Review API response format
- Check browser console for error messages
Build Path Mismatches
Problem: Static assets return 404 after deployment. Solution:- Verify
basePathinnext.config.jsmatches deployment path - Check web server configuration
- Confirm all asset references use correct base path
Next Steps
- Review deployment procedures: Deployment
- Set up monitoring and logging
- Configure automated backups
- Implement analytics tracking
