Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 17 additions & 8 deletions .dockerignore
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
.git
.gitignore
node_modules
package-lock.json
docker-compose.yml
Dockerfile
.tool-versions
.dockerignore
README.md
.next
.git
.env
.env.*
!.env.example
config/default.json
config/local.json
config/local-*.json
config/stage.json
config/production.json
tests
e2e
test-results
playwright-report
*.tsbuildinfo
.local-backups
.superpowers
11 changes: 11 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PORT=3002
APP_ENV=development
REDIS_URL=redis://127.0.0.1:6380
SHOWCASE_KEY_PREFIX=showcase-next:development:
# Use 1 behind a single trusted Kubernetes ingress / reverse proxy.
TRUST_PROXY_HOPS=0
# NODE_CONFIG_DIR=/absolute/path/to/private/config
# PLAY_INTEGRITY_ENABLED=false

# Provider request deadline in milliseconds (1..120000; invalid values use 15000).
PROVIDER_HTTP_TIMEOUT_MS=15000
10 changes: 0 additions & 10 deletions .env.sample

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/showcase-next-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Showcase Next.js CI

on:
push:
pull_request:

permissions:
contents: read

concurrency:
group: showcase-next-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
verify:
name: Build and verify main flows
runs-on: ubuntu-latest
timeout-minutes: 20
env:
CI: 'true'
NEXT_TELEMETRY_DISABLED: '1'
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: '24.22.0'
cache: npm
cache-dependency-path: package-lock.json
- name: Install Redis
run: |
sudo apt-get update
sudo apt-get install -y redis-server
- name: Install Next.js dependencies
run: npm ci
- name: Install Chromium
run: npx playwright install --with-deps chromium
- name: Lint
run: npm run lint
- name: Typecheck
run: npm run typecheck
- name: Build
run: npm run build
- name: Unit and API tests
run: npm test
- name: Playwright main flows
run: >-
npm run test:e2e --
e2e/main-flows.spec.ts
e2e/qr.spec.ts
e2e/sms.spec.ts
e2e/result.spec.ts
e2e/auth-error.spec.ts
- name: Upload Playwright diagnostics
if: failure()
uses: actions/upload-artifact@v4
with:
name: showcase-next-playwright-results
path: test-results/
if-no-files-found: ignore
retention-days: 7
19 changes: 13 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
node_modules
node_modules/
.next/
.env*
!.env.example
config/default.json
yarn.lock
public/css/style.css
config/local.json
config/local-*.json
config/stage.json
config/production.json
*.tsbuildinfo
test-results/
playwright-report/
.local-backups/
.DS_Store
.env
.cursor

.superpowers/
31 changes: 24 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
FROM node:24-alpine

FROM node:24.22.0-bookworm-slim AS dependencies
WORKDIR /usr/app
COPY package.json ./
RUN npm install --only=prod
COPY package.json package-lock.json ./
RUN npm ci

FROM dependencies AS builder
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build

ENV PORT 8080
FROM node:24.22.0-bookworm-slim AS production-dependencies
WORKDIR /usr/app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev && npm cache clean --force

EXPOSE 8080
CMD [ "npm", "run", "start" ]
FROM node:24.22.0-bookworm-slim AS runtime
WORKDIR /usr/app
ENV NODE_ENV=production PORT=3002 NEXT_TELEMETRY_DISABLED=1
COPY --from=production-dependencies /usr/app/node_modules ./node_modules
COPY --from=builder /usr/app/.next ./.next
COPY --from=builder /usr/app/public ./public
COPY --from=builder /usr/app/config ./config
COPY --from=builder /usr/app/runtime ./runtime
COPY --from=builder /usr/app/scripts ./scripts
COPY --from=builder /usr/app/server.mjs /usr/app/package.json /usr/app/next.config.ts ./
RUN mkdir -p /run/showcase-config && chown -R node:node /usr/app /run/showcase-config
USER node
EXPOSE 3002
CMD ["node", "server.mjs"]
86 changes: 11 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,26 @@
# IPification Showcase

A demonstration application showcasing IPification's identity verification and authentication features.
A Next.js demonstration of IPification phone verification, login and identity flows.

## Features
## Start locally

- **Phone Number Verification** (IP, IP+, IM, SIM)
- **Quick Access Login** (IP, IP+, IM, SIM)
- **Identity Services** (Anonymous Identity, KYC)
- **QR Code Desktop Flow**
- **Server-to-Server Backchannel**
- **TS43 Protocol Support**

## Local Development

Choose either Node.js or Docker Compose to run the application locally.

### Prerequisites

- IPification account credentials
- For Node.js: Node.js >= 24.0.0 and npm (24.22.0 is pinned in `.tool-versions` and Docker)
- For Docker Compose: Docker with the Compose plugin

### Run with Node.js

Install dependencies and create the local configuration:
Use Node.js 24.22.0, npm, Redis and your IPification configuration:

```bash
npm install
npm ci
cp config/default.json.sample config/default.json
```

Edit `config/default.json` with your IPification credentials, then start the server with auto-reload:

```bash
cp .env.example .env.local
# Configure credentials in config/default.json and REDIS_URL in .env.local.
npm run config:check
npm run dev
```

Open `http://localhost:3000` (unless `PORT` is overridden in your environment or `.env`). To run without auto-reload, use `npm start`.
For phone QR testing, open one of the Network URLs printed at startup on the desktop and use a phone that can reach that address. Register the actual callback URL with your provider.

### Run with Docker Compose

Create the configuration file mounted by Compose:
Run with Docker Compose from the repository root after configuring `config/default.json`:

```bash
cp config/default.json.sample config/default.json
docker compose up --build
```

Edit `config/default.json` with your IPification credentials, then build and start the container:

```bash
docker compose up -d --build
```

Open `http://localhost:3001`. Compose sets `PORT=3001` and mounts `config/default.json` as `/usr/app/config/default.json`. This container runs `npm start` without auto-reload; rebuild after application code changes.

View logs or stop the local container:

```bash
docker compose logs -f app
docker compose down
```

### Configuration

See the [Quick Start Guide](docs/QUICKSTART.md) for setup and troubleshooting, and the [Sample Config Reference](docs/CONFIG_DEFAULT_JSON_SAMPLE.md) for configuration fields.

The application loads `.env` for local environment overrides. Docker Compose sets the container port explicitly in `docker-compose.yml`.

| Variable | Description | Default |
| ---------- | -------------------------------------------------- | ---------------------------- |
| `PORT` | Server port | `3000` (`3001` with Compose) |
| `NODE_ENV` | Environment (`development`, `stage`, `production`) | `development` |

When testing from a mobile device, replace `localhost` with your computer's reachable IP address and configure the corresponding callback URL in your IPification client settings.

## Documentation

- **[Quick Start](docs/QUICKSTART.md)** - Setup guide and common issues
- **[API Reference](docs/API.md)** - Complete endpoint documentation
- **[Architecture](docs/ARCHITECTURE.md)** - System design and components
- **[PNV via IP](docs/PNV.md)** - Phone input, authorization redirect, callback, code exchange, and verification-result handling
- **[Sample Config Reference](docs/CONFIG_DEFAULT_JSON_SAMPLE.md)** - Application configuration fields
- **[Play Integrity backend demo](docs/PLAY_INTEGRITY.md)** - Backend verification setup, request hashing, and Android checklist
- **[Documentation Index](docs/INDEX.md)** - Documentation overview

## Support

- Developer Portal: https://developer.ipification.com/
- Website: https://www.ipification.com/
See the [integration guide](docs/nextjs/README.md) and [local setup and testing](docs/nextjs/running.md). The Playwright tests use a local mock provider and do not verify live stage or carrier behavior.
88 changes: 0 additions & 88 deletions app.js

This file was deleted.

Loading
Loading