npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@univ-lehavre/atlas-redcap-sandbox

v1.0.5

Published

REDCap testing sandbox - Docker environment and contract tests for validating OpenAPI specs

Readme

REDCap Sandbox

Sandbox Docker et tests d'intégration pour valider REDCap avec Atlas.

Ce workspace fournit un environnement REDCap isolé, des scripts d'installation, des tests de contrat, des tests de sécurité et des smoke tests API. Il sert à confronter les spécifications OpenAPI et clients Atlas à une instance REDCap réelle ou locale.

Structure

redcap-sandbox/
├── docker/                 # Docker environment for REDCap
│   ├── docker-compose.yml  # Main compose file (MySQL, PHP, phpMyAdmin)
│   ├── config/             # PHP and database configuration
│   └── init.sql            # Database initialization
├── scripts/                # Automation scripts
│   ├── install-redcap.sh   # Automated REDCap installation
│   ├── test-contract.sh    # Run contract tests
│   └── test-security.sh    # Run security/fuzzing tests
├── tests/                  # Integration tests
│   ├── contract/           # API contract tests (require Docker)
│   ├── fixtures/           # Test data and setup scripts
│   └── api-smoke.ts        # Quick API smoke tests
├── docker-compose.yaml     # Main compose file
└── vitest.config.ts        # Vitest configuration

REDCap source code is located in the sibling package redcap-openapi/upstream/.

Purpose

The development environment serves three main purposes:

  1. Validation - Verify that extracted OpenAPI specs match actual REDCap behavior
  2. Contract Testing - Ensure API responses conform to documented schemas
  3. Security Testing - Fuzz testing with Schemathesis to find edge cases

Quick Start

1. Start Docker Environment

# From packages/redcap-sandbox directory
pnpm docker:up

This starts:

  • REDCap at http://localhost:8888
  • phpMyAdmin at http://localhost:8889
  • Mailpit at http://localhost:8025

2. Install REDCap Database

pnpm docker:install

This script:

  1. Submits the REDCap install form
  2. Extracts and executes the SQL schema
  3. Creates an API token for testing
  4. Saves config to docker/config/.env.test

3. Run Tests

# Quick API smoke test
pnpm test:api

# Full contract tests (26 tests)
pnpm test:contract

# Security/fuzzing tests
pnpm test:security

Docker Services

| Service | URL | Credentials | | ---------- | --------------------- | ------------------------ | | REDCap | http://localhost:8888 | site_admin | | phpMyAdmin | http://localhost:8889 | redcap / redcap_password | | Mailpit | http://localhost:8025 | - | | MariaDB | localhost:3306 | redcap / redcap_password |

Multi-Version Testing

The Docker environment supports multiple REDCap versions:

# Start with specific version
REDCAP_VERSION=14.6.0 pnpm docker:up

# Extract spec for that version
REDCAP_VERSION=14.6.0 pnpm extract

Versions are stored in ../redcap-openapi/upstream/versions/<version>/.

Commands Reference

# Docker management
pnpm docker:up       # Start services
pnpm docker:down     # Stop services
pnpm docker:logs     # View logs
pnpm docker:reset    # Reset database (destroys data)
pnpm docker:install  # Automated installation

# Testing
pnpm test:setup      # Setup test fixtures
pnpm test:api        # Smoke tests (quick)
pnpm test:contract   # Contract tests (full)
pnpm test:security   # Security/fuzz tests

Test Fixtures

The tests/fixtures/ directory contains:

  • projects.json - Test project configurations
  • setup-test-projects.ts - Script to create test projects via API

Test Projects

| Project | Type | Features | | --------------------- | ------------ | ----------------- | | Classic Database | Classic | Basic data entry | | Longitudinal (1 arm) | Longitudinal | 8 events | | Basic Demography | Classic | Single form | | Repeating Instruments | Classic | 4 repeating forms |

Contract Tests

The contract tests validate:

  • Version endpoint returns valid version string
  • Project info matches expected schema
  • Metadata export returns field definitions
  • Record export with filters works correctly
  • Event endpoint handles longitudinal vs classic
  • Error responses follow expected format
  • Response formats (JSON, CSV, XML) work

Troubleshooting

Container not starting

# Check logs
pnpm docker:logs

# Reset and restart
pnpm docker:reset

API token not working

# Regenerate token
pnpm docker:install

Tests failing

Ensure REDCap is running and initialized:

curl -X POST http://localhost:8888/api/ \
  -d "token=$(cat sandbox/docker/config/.env.test | grep TOKEN | cut -d= -f2)" \
  -d "content=version"