Skip to content

arandadeduero/rpt-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RPT App - Relación de Puestos de Trabajo

RPT application for Aranda de Duero with AdminJS backend for managing work positions.

Description

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.

Features

  • 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)

RPT Main Table (Puestos)

The core table includes the following fields:

Identifiers:

  • ID_Puesto: Auto-incrementing primary key
  • Có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 vacancies
  • Dotación_Presupuestaria: Budget allocation
  • Sueldo_Base: Base salary

Linkage Fields:

  • ID_Jefe_Superior: Links to superior position (creates dependency tree)

Prerequisites

  • Node.js (v14 or higher)
  • npm (v6 or higher)

Installation

  1. Clone the repository:
git clone <repository-url>
cd rpt-app
  1. Install dependencies:
npm install

Usage

Start the application

npm start

The application will:

  • Start on http://localhost:3000
  • Create/sync the SQLite database automatically
  • Make AdminJS interface available at http://localhost:3000/admin

Development mode

npm run dev

Access the Admin Panel

Open 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

Database

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.

Project Structure

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

Configuration

Environment Variables

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 management
  • NODE_ENV: Environment mode (development/production)

Example:

PORT=8080 SESSION_SECRET=your-secure-secret-key NODE_ENV=production npm start

Production Deployment

For production deployments, ensure:

  1. Set SESSION_SECRET environment variable to a strong, random value
  2. Set NODE_ENV=production
  3. Use HTTPS (secure cookies will be automatically enabled)
  4. Consider using database migrations instead of automatic schema synchronization
  5. Use a production-grade database (PostgreSQL, MySQL) instead of SQLite for scalability

License

ISC

Author

Aranda de Duero

About

RPT app para Aranda de Duero

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors