⚠️ Disclaimer: This project is no longer maintained
This project was originally created over 10 years ago and has been upgraded from Rails 4.0.3 to Rails 7.1.6. The original maintainers are no longer active and this repository is no longer maintained. Use it at your own risk. For production use, consider creating a new project with modern frameworks and best practices.
API for accessing Dominican Republic reference data including provinces, municipalities, cities, holidays, and companies (RNC).
- Rails 7.1.6
- Ruby 3.3.10
- PostgreSQL 16
- Docker Desktop (installed and running)
- Docker Compose
# Start the application
docker compose up -d
# The API will be available at http://localhost:3000# Run database migrations
docker compose exec web bundle exec rails db:migrate
# Seed database with initial data
docker compose exec web bundle exec rails db:seed
# Restart the application
docker compose restart webGet all provinces:
curl http://localhost:3000/api/v1/provinciasGet specific province:
curl http://localhost:3000/api/v1/provincias/1Get municipalities for a province:
curl http://localhost:3000/api/v1/provincias/1/municipiosGet all municipalities:
curl http://localhost:3000/api/v1/municipiosGet specific municipality:
curl http://localhost:3000/api/v1/municipios/1Get all cities:
curl http://localhost:3000/api/v1/ciudadesGet specific city:
curl http://localhost:3000/api/v1/ciudades/1Get holidays for a specific year:
curl http://localhost:3000/api/v1/feriados/2024Get company by RNC:
curl http://localhost:3000/api/v1/empresas/131001234All endpoints support multiple formats:
- JSON (default): Append
.jsonto URL or useAccept: application/jsonheader - XML: Append
.xmlto URL or useAccept: application/xmlheader - CSV: Append
.csvto URL or useAccept: text/csvheader - XLS (Tab-separated): Append
.xlsto URL
Example:
# JSON
curl http://localhost:3000/api/v1/provincias
# CSV
curl http://localhost:3000/api/v1/provincias.csv
# XML
curl http://localhost:3000/api/v1/provincias.xmlThe main web interface is available at http://localhost:3000/
# Stop the application
docker compose down
# Remove all containers and volumes
docker compose down -v# View all logs
docker compose logs
# Follow logs in real-time
docker compose logs -f
# View only web server logs
docker compose logs web -fThe application uses PostgreSQL 16 with the following configuration:
- Database:
data_developers_do_development - Host:
db(Docker service name) - Username:
postgres - Password:
postgres
Database is persisted in a Docker volume for data persistence.
app/
├── controllers/
│ ├── api/
│ │ ├── v1/
│ │ │ ├── provincias_controller.rb
│ │ │ ├── municipios_controller.rb
│ │ │ ├── ciudades_controller.rb
│ │ │ ├── feriados_controller.rb
│ │ │ └── empresas_controller.rb
│ │ └── base_controller.rb
│ ├── application_controller.rb
│ ├── main_controller.rb
│ └── servicio_controller.rb
├── models/
│ ├── provincia.rb
│ ├── municipio.rb
│ ├── ciudad.rb
│ ├── feriado.rb
│ ├── empresa.rb
│ ├── servicio.rb
│ └── detalle.rb
└── views/
├── layouts/
└── main/
config/
├── application.rb
├── routes.rb
├── environments/
└── database.yml
db/
├── migrate/
├── seeds/
└── schema.rb
docker compose exec web bundle exec rails consoledocker compose exec web bundle exec rails generate migration MigrationNamedocker compose exec web bundle exec rails testdocker compose exec web bundle install
docker compose restart webThis project provides reference data for the Dominican Republic:
- Provinces: 32 provinces including Distrito Nacional
- Municipalities: Over 400 municipalities across all provinces
- Cities: Cities and their municipalities
- Holidays: National holidays by year
- Companies: Companies by RNC (Registro Nacional del Contribuyente)
Please refer to the original project repository for license information.
Please refer to the original project repository for contribution guidelines.