Welcome! This guide will help you get the Labs ASP project running on your computer. The database is already set up in the cloud, so you'll just be connecting to it.
- AI Chatbot Client: A Next.js-based AI chatbot with web automation capabilities
- Web Automation: AI that can visit websites, interact with pages, and extract information using a browser tool
- Database: A cloud database with sample participant data for testing
- Browser Streaming: Real-time browser session viewing through Kernel.sh
This repository contains the infrastructure, deployment configuration, and supporting services for the Labs ASP project. The AI chatbot client lives in a separate repository and is included here as a Git submodule.
The client/ directory is a Git submodule that pulls from the navapbc/ai-chatbot repository (develop branch). This is where the application code lives. It contains:
- Next.js application — the full AI chatbot frontend and API routes
- AI tools — browser automation, participant lookup, and other agent tools
- Database schema & migrations — Drizzle ORM schema for chats, users, documents, and participants
- Artifacts system — browser session viewer, code runner, and other interactive artifacts
- UI components — chat interface, sidebar, markdown rendering, and design system
The root repository provides:
terraform/— Infrastructure-as-code for GCP deploymentscripts/— Utility scripts for deployment and maintenancedocs/— Architecture documentation, setup guides, and decision records
You'll need these installed on your computer:
- Node.js (version 20 or higher): Download here
- pnpm: Install by running:
npm install -g pnpm - gcloud CLI (optional): Install instructions — Only needed if working with GCP resources directly
Note: We use the
developbranch as our primary working branch. Make sure to checkoutdevelopafter cloning.
This project uses Git submodules to manage the client frontend. You'll need to clone with submodules or set them up after cloning.
# Clone the repository with submodules
git clone --recurse-submodules https://github.com/navapbc/labs-asp.git
cd labs-asp
# Switch to the develop branch (our primary working branch)
git checkout develop# If you already cloned the repo, initialize submodules
git submodule update --init --recursiveImportant: The
client/directory is a Git submodule that tracks thedevelopbranch of the ai-chatbot repository.
If you're using Visual Studio Code:
- Open the project folder: Go to
File > Open Folderand select thelabs-aspdirectory - Open the terminal:
- Use the keyboard shortcut:
Ctrl+(backtick)on Mac - Or go to
Terminal > New Terminalin the menu - Or use
View > Terminal
- Use the keyboard shortcut:
The terminal should automatically open in the correct labs-asp directory. You can verify this by running pwd (on Mac) to see your current directory path.
# Navigate to the client directory and install packages
cd client
pnpm installYou'll need to create a configuration file for the client. Ask your team lead for access to the 1Password secure notes containing the actual values.
cp client/.env.example client/.env.localThen update the values with the contents from the 1Password secure note for the client environment.
touch vertex-ai-credentials.jsonCopy the service account JSON from the 1Password secure note. See docs/VERTEX_AI_ANTHROPIC_SETUP.md for details on creating your own credentials if needed.
Warning about 1Password: When copying from 1Password secure notes, ensure you're copying the raw text and not a markdown-rendered version. 1Password can convert files to markdown, which breaks commented lines (e.g.,
# commentbecomes a heading). If you encounter unexpected behavior, verify your file contents match the original format.
Important: The database is already set up and populated with test data! As a team member, you only need to connect to it. Please don't run migration or seeding commands, these are reserved for admins to avoid accidentally modifying shared data.
The database is ready to use with sample participant data already loaded. You'll be able to see this data once you start the app!
# From the client directory
cd client
pnpm devThis starts the Next.js client at http://localhost:3000.
Success! The app should now be running. Click the URL in your terminal to open it!
- Web Automation: Have the AI visit websites, fill out forms, and take screenshots
- Participant Lookup: Search for participant information in the database
- Browser Sessions: Watch the AI interact with websites in real time
- "Visit google.com and take a screenshot"
- "Look up participant information for John Doe"
- "Go to benefits.gov and find information about WIC eligibility"
# Open database browser (from the client directory)
cd client
pnpm db:studioThis opens a web interface at http://localhost:5555 where you can browse the shared participant data (read-only).
If the app displays errors or becomes unresponsive:
-
Stop the current process:
- In your terminal, press
Ctrl+C(Mac) to stop the running process - If that doesn't work, close the entire terminal session:
- In VS Code: Click the trash can icon in the terminal panel, or right-click the terminal tab and select "Kill Terminal"
- In your terminal, press
-
Start fresh:
- Open a new terminal (see "Opening Terminal in Visual Studio Code" above)
- Navigate to the client:
cd labs-asp/client - Restart the app:
pnpm dev
-
If problems persist:
- Try clearing the cache and reinstalling:
rm -rf node_modules && pnpm install - Check that all environment variables are correctly set in your
client/.env.localfile
- Try clearing the cache and reinstalling:
- Make sure you have the correct
DATABASE_URLin yourclient/.env.localfile - Contact your team lead if you're getting database connection errors
- Contact your team lead for the required API keys
- Make sure they're properly copied into your
client/.env.localfile
Contact your team lead if you need the database refreshed — regular team members shouldn't modify the shared database.
# Start the app
cd client && pnpm dev
# View database (read-only)
cd client && pnpm db:studio
# Update submodule to latest
git submodule update --remote clientThis project uses Git submodules to manage the client frontend. The client/ directory is a submodule that tracks the develop branch of the ai-chatbot repository.
Set up Git to automatically handle submodules and create a convenient alias:
# Configure Git to automatically handle submodules in most operations
git config --global submodule.recurse true
# Create an alias for pulling with submodules
git config --global alias.spull "pull --recurse-submodules"# Pull latest changes from both main repo and submodules
git spull
# Alternative: Pull with submodules (if you don't have the alias)
git pull --recurse-submodules
# Update submodule to latest commit from its remote branch
git submodule update --remote client
# Check submodule status
git submodule status
# Initialize submodules if they're missing
git submodule update --init --recursiveWhen PRs are merged into the main repository, always pull with submodules:
git spull # Pulls both main repo and submodule changes automaticallySometimes you'll need to update the main repository to point to a newer commit in the submodule:
# Update submodule to latest remote commit
git submodule update --remote client
# Add and commit the submodule reference update
git add client
git commit -m "chore: update client submodule to latest commit"
git pushYou can view the submodule configuration in .gitmodules:
cat .gitmodulesThis shows how the submodule is configured to track the develop branch.
git submodule update --init --recursivegit submodule update --remote clientgit submodule update --recursivegit config -f .gitmodules --get submodule.client.branchNote: These commands are for admins only and will modify shared data:
# Add sample data (admin only)
pnpm seed:wic
# Reset everything (admin only)
pnpm db:reset
# Create migrations (admin only)
pnpm db:migrate- Client Repository: navapbc/ai-chatbot
- Detailed Database Guide: See
docs/DATABASE_SETUP.md - Architecture Docs: See the
docs/directory for detailed guides - Need Help?: Ask your team lead or create an issue