Getting started
Run the ROUNDTABLE app, seed its database, and verify your local setup
This page is for a developer starting from a fresh checkout. You will run two independent Next.js applications that live in separate repositories: the main ROUNDTABLE application (COG-GTM/NIWCPAC_N66001-26-S-C129) on port 3000, and this documentation site (COG-GTM-NIWCPAC_N66001-26-S-C129_DOCS_REPO) on port 3001. The main app needs PostgreSQL; the docs site only needs its own Node dependencies, with no database and no sign-in.
Prerequisites
Install these before troubleshooting the application:
| Tool | Expected version or capability | Why |
|---|---|---|
| Node.js | 22 | Matches the repository development assumptions. |
| pnpm | 10; the app repository pins 10.34.5 | Installs dependencies in either repository. |
| Docker | Compose plugin recommended | Runs PostgreSQL and the portable stack. |
| Git | Any current version | Retrieves the repository and branch. |
| PostgreSQL | 16 when running directly | Prisma datasource is PostgreSQL. |
The main app is Next.js 14. The docs site is a separate repository and uses Next.js 15 with a compatible Fumadocs 15 line, so the two upgrade independently.
1. Start PostgreSQL
The simplest development database is a disposable PostgreSQL container:
docker run -d --name roundtable-pg \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=roundtable \
-p 5432:5432 \
postgres:16-alpineThe root .env.example expects a connection string similar to:
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/roundtableIf a container named roundtable-pg already exists, use docker start roundtable-pg instead of creating another one.
2. Configure and install the main app
From the root of the application repository:
cp .env.example .env
pnpm install
pnpm db:setupdb:setup runs Prisma client generation, migration deployment, and the idempotent seed script. It creates commands, ten portfolio nodes, government users, eight industry organizations, calls, an announcement, and sample engagement records.
3. Start the main application
pnpm devOpen http://localhost:3000. Use the seeded accounts in Seeded accounts to demonstrate both sides.
4. Start the documentation site
Clone the docs repository next to the application checkout, then, from the docs repository root:
pnpm install
pnpm devOpen http://localhost:3001/docs. Run every docs command from that checkout: it has its own package.json and lockfile and shares nothing with the application repository.
Verify your setup
docker ps and confirm PostgreSQL is listening on host port 5432.pnpm db:setup and confirm Prisma migrations and seed complete without an error.http://localhost:3000./gov or /portal surface appears.http://localhost:3001/docs.pnpm links:check and pnpm build in the docs repository before committing documentation changes.What a successful local setup contains
| Component | Local address or location | Persistent state |
|---|---|---|
| Main Next.js app | http://localhost:3000 | None in the app process. |
| Docs Next.js app (separate repository) | http://localhost:3001/docs | None in the app process. |
| PostgreSQL | localhost:5432 | Docker volume/container database. |
| Upload storage | S3 or MinIO endpoint | Private objects under uploads/. |
| Prisma schema | prisma/schema.prisma | Migrations in prisma/migrations. |
Next steps
Read Environment variables, then Seeded accounts. If you need to understand why the app calls Prisma from route handlers, continue to Architecture. If you only need the documentation site, the main app and database are not required to render this content.
Common port conflicts
The main app and the docs site intentionally use different ports. Find the process occupying a port before changing configuration:
lsof -iTCP:3000 -sTCP:LISTEN
lsof -iTCP:3001 -sTCP:LISTENIf another process owns 3000, stop that development process or run the main app with its documented alternative. Do not silently move the docs server: links and verification instructions assume 3001. If 3001 is occupied by an earlier docs process, reuse it when it is the same checkout; otherwise stop the stale process and start the docs site again.
PostgreSQL and Prisma sequence
The order matters:
- PostgreSQL must accept connections.
.envmust point at that database.pnpm installmust install the Prisma CLI and client.pnpm prisma generatecreates the typed client.pnpm prisma migrate deployapplies committed migrations.pnpm prisma db seedinserts demo data.
prisma generate does not create tables, and migrations do not create seeded users. Treat those as separate failure domains when reading terminal output.
Migrations also run CREATE EXTENSION IF NOT EXISTS pg_trgm and build the trigram indexes the fuzzy search stage needs, so the database role running them must be allowed to create extensions. Unless the extension is already installed — CREATE EXTENSION IF NOT EXISTS is then a no-op needing no privilege — a role without that right fails the migration. Confirm the extension landed with select extname from pg_extension where extname = 'pg_trgm'; — if the pg_trgm migration alone was skipped or the extension was dropped later, full-text search still runs, but the fuzzy stage logs one error and falls back to substring matching for the life of the process rather than failing the request.
Development-only warning
The seeded password, .example.com contacts, and navy.mil demo addresses are fixtures. They make a walkthrough reproducible, but they are not identities to deploy. Replace all secrets and review seeded data before sharing an environment beyond the local team.
First successful run
The shortest reliable path is:
- Start PostgreSQL and confirm the container is healthy.
- Copy the root environment example and set a local database URL.
- Set a long random
NEXTAUTH_SECRETand a localNEXTAUTH_URL. - Configure MinIO or another S3-compatible service before testing uploads.
- Run
pnpm db:setupfrom the application repository root. This applies migrations, generates Prisma Client, and runs the idempotent seed path described in the environment page. - Start the main application on port 3000.
- Sign in with one seeded government account and one seeded industry account.
- Create a harmless read-only test flow before mutating shared seed records.
- In a second terminal, start the docs site from its own checkout on port 3001.
- Open
/docsand use the API pages alongside the running application.
What setup verification proves
| Check | What it proves |
|---|---|
pnpm prisma migrate status | The configured database can be reached and migrations are visible. |
select extname from pg_extension where extname = 'pg_trgm'; | Typo-tolerant search is available rather than silently degraded. |
pnpm prisma generate | The generated client matches the checked-in schema. |
| Seed login | Credentials lookup, bcrypt comparison, and session creation work. |
| Portal profile read | Industry organization scoping works for a signed-in user. |
| Government directory read | A government role can reach its allowed ledger view. |
| Small upload | S3/MinIO endpoint, bucket, permissions, and magic-byte path work. |
| Docs page 200 | The standalone Fumadocs server can serve generated content. |
Passing one row does not prove the next row. For example, a successful login does not prove S3 configuration, and a docs build does not prove the main application's database environment.