Installation Guide
This guide provides detailed instructions for installing and configuring SIGEAC (Sistema de Gestión Aeronáutica Civil) in various environments.System Requirements
Minimum Requirements
- Node.js: 20.x or higher
- RAM: 4GB minimum, 8GB recommended
- Disk Space: 2GB for dependencies and build artifacts
- OS: Linux, macOS, or Windows
Supported Package Managers
- npm (comes with Node.js)
- yarn 1.x or higher
- pnpm 8.x or higher
- bun 1.x or higher
Prerequisites
Install Node.js
Install Git
Install Git from git-scm.com if not already installed:
Backend API Setup
Ensure your SIGEAC backend API is running and accessible. The frontend requires:
- A running Laravel backend API
- CORS configured to allow requests from your frontend domain
- JWT authentication endpoints (
/api/login,/api/logout, etc.) - WebSocket support (optional, for real-time features)
Installation Steps
1. Clone the Repository
2. Install Dependencies
Choose your preferred package manager and install dependencies:The installation process will download and install 80+ packages including:
- Next.js 14.2.14 - React framework
- React 18 - UI library
- TanStack Query 5 - Data fetching and caching
- Radix UI - Accessible component primitives
- Tailwind CSS 3 - Utility-first CSS framework
- TypeScript 5 - Type safety
- Axios - HTTP client
- Zustand - State management
- Zod - Schema validation
Configuration
Environment Variables
Create a.env.local file in the root directory with the following variables:
.env.local
Environment Variable Details
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_API_BASE_URL | Yes | Base URL for the SIGEAC backend API. Must include /api path |
NEXT_PUBLIC_STORAGE_BASE_URL | Yes | Base URL for file storage (images, documents, PDFs) |
NEXT_PUBLIC_REVERB_APP_KEY | No | Reverb application key for WebSocket connections |
NEXT_PUBLIC_REVERB_HOST | No | Reverb server hostname |
NEXT_PUBLIC_REVERB_SCHEME | No | Protocol for Reverb (https or http) |
Next.js Configuration
The application comes pre-configured withnext.config.mjs. Key configurations include:
next.config.mjs
Image Optimization: Update the
remotePatterns array to include your backend domain for Next.js image optimization.Tailwind CSS Configuration
SIGEAC uses a custom Tailwind configuration with:- Custom color scheme - HSL-based design tokens
- Dark mode support - Class-based theme switching
- Custom animations - Accordion, background movement effects
- Custom background images - Aviation-themed backgrounds
- shadcn/ui integration - Pre-styled component library
Running the Application
Development Mode
Start the development server with hot module replacement:Production Build
Build the application for production:Production builds are optimized with minification, code splitting, and image optimization. Build time typically takes 1-3 minutes depending on your hardware.
Application Structure
Understanding SIGEAC’s directory structure:Authentication Flow
SIGEAC implements cookie-based JWT authentication:- Login: User submits credentials to
/api/login - Token Storage: JWT token stored in
auth_tokencookie - Axios Interceptor: Automatically attaches
Authorization: Bearer <token>to all API requests - Middleware Protection:
middleware.tsprotects routes like/inicio,/ajustes,/administracion - Session Expiry: 401 responses trigger automatic logout and redirect to
/login
Code Linting
Run ESLint to check for code quality issues:Troubleshooting
Installation Issues
npm install fails with dependency conflicts
npm install fails with dependency conflicts
Try using the Or use a different package manager like
--legacy-peer-deps flag:pnpm which handles peer dependencies better:Sharp installation fails
Sharp installation fails
Node version mismatch
Node version mismatch
Ensure you’re using Node.js 20 or higher:Use nvm to switch versions:
Runtime Issues
Port 3000 already in use
Port 3000 already in use
Specify a different port:Or kill the process using port 3000:
API connection errors (CORS)
API connection errors (CORS)
CORS errors indicate backend configuration issues. Ensure your backend allows:
- Origin:
http://localhost:3000(development) or your production domain - Methods:
GET, POST, PUT, DELETE, PATCH, OPTIONS - Headers:
Authorization, Content-Type, skip_zrok_interstitial - Credentials:
true(for cookies)
Images not loading
Images not loading
If images from the backend aren’t loading:
- Verify
NEXT_PUBLIC_STORAGE_BASE_URLis correct - Add your storage domain to
next.config.mjs:
- Restart the development server after config changes
Authentication loops or infinite redirects
Authentication loops or infinite redirects
Clear cookies and local storage:Then refresh the page and log in again.
WebSocket connection fails
WebSocket connection fails
WebSocket errors are non-critical. The app functions without WebSockets, but you’ll miss real-time updates.To fix:
- Verify Reverb server is running
- Check
NEXT_PUBLIC_REVERB_*environment variables - Ensure WebSocket port is open in your firewall
- Verify the backend Reverb configuration matches frontend settings
Build Issues
Build fails with TypeScript errors
Build fails with TypeScript errors
Check for type errors:Fix errors before building. Common issues:
- Missing type definitions
- Incorrect prop types
- Unused variables (can be suppressed with
// @ts-ignore)
Out of memory during build
Out of memory during build
Increase Node.js memory limit:
Build succeeds but start fails
Build succeeds but start fails
Ensure all environment variables are set in production:
Production Deployment
For production deployment options, see:- Vercel Deployment - Recommended for Next.js apps
- Docker Deployment - Containerized deployment options
- Self-Hosted - Deploy on your own infrastructure
Next Steps
After installation:Quickstart
Quick guide to get started with SIGEAC
Configuration
Detailed configuration options
Architecture
Learn about SIGEAC’s technical architecture
API Integration
Connect to the backend API
Getting Help
If you encounter issues not covered in this guide:- Review the troubleshooting section above
- Contact your system administrator
- Report bugs via GitHub Issues
