RPT application for Aranda de Duero with AdminJS backend for managing work positions.
This application provides a complete backend system for managing "Relación de Puestos de Trabajo" (RPT - Work Position Registry) with an intuitive administrative interface powered by AdminJS.
- Complete CRUD operations for work positions (Puestos)
- AdminJS interface for easy data management
- SQLite database for simplicity and portability
- Hierarchical structure support (positions linked to superior positions)
The core table includes the following fields:
Identifiers:
ID_Puesto: Auto-incrementing primary keyCódigo_Interno: Internal code (unique)Número_Orden: Order number
Descriptive Fields:
Denominación_Puesto: Position name/title (required)Descripción_Funciones: Function description (text)Observaciones: Observations/notes (text)
Quantitative Fields:
Número_Vacantes: Number of vacanciesDotación_Presupuestaria: Budget allocationSueldo_Base: Base salary
Linkage Fields:
ID_Jefe_Superior: Links to superior position (creates dependency tree)
- Node.js (v14 or higher)
- npm (v6 or higher)
- Clone the repository:
git clone <repository-url>
cd rpt-app- Install dependencies:
npm installnpm startThe application will:
- Start on
http://localhost:3000 - Create/sync the SQLite database automatically
- Make AdminJS interface available at
http://localhost:3000/admin
npm run devOpen your browser and navigate to:
http://localhost:3000/admin
From there you can:
- View all positions (Puestos)
- Create new positions
- Edit existing positions
- Delete positions
- Filter and search positions
- Manage hierarchical relationships between positions
The application uses SQLite with the database file stored as database.sqlite in the project root. This file is automatically created on first run and is excluded from version control via .gitignore.
rpt-app/
├── models/
│ ├── index.js # Database configuration and model exports
│ └── puestos.js # Puestos model definition
├── index.js # Main application file with AdminJS setup
├── package.json # Project dependencies and scripts
├── .gitignore # Git ignore rules
└── README.md # This file
You can customize the following settings using environment variables:
PORT: Server port (default: 3000)SESSION_SECRET: Required in production - Session secret key for secure session managementNODE_ENV: Environment mode (development/production)
Example:
PORT=8080 SESSION_SECRET=your-secure-secret-key NODE_ENV=production npm startFor production deployments, ensure:
- Set
SESSION_SECRETenvironment variable to a strong, random value - Set
NODE_ENV=production - Use HTTPS (secure cookies will be automatically enabled)
- Consider using database migrations instead of automatic schema synchronization
- Use a production-grade database (PostgreSQL, MySQL) instead of SQLite for scalability
ISC
Aranda de Duero