Skip to content

Commit cd30422

Browse files
committed
Initial commit
0 parents  commit cd30422

262 files changed

Lines changed: 40239 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Generate a random secret: https://generate-secret.vercel.app/32 or `openssl rand -base64 32`
2+
AUTH_SECRET=****
3+
4+
# Google OAuth (for Google sign-in)
5+
GOOGLE_CLIENT_ID=****
6+
GOOGLE_CLIENT_SECRET=****
7+
8+
# xAI API Key for chat and image models: https://console.x.ai/
9+
XAI_API_KEY=****
10+
11+
# PostgreSQL database
12+
# Chat history, votes, documents, user data
13+
DATABASE_URL="postgresql://<user>:<password>@<host>.neon.tech/<dbname>?sslmode=require"
14+
15+
# OpenAI API Key (primary AI provider)
16+
OPENAI_API_KEY=****
17+
18+
# Alternative API keys (optional)
19+
ANTHROPIC_API_KEY=****
20+
21+
# Google Cloud Configuration
22+
GOOGLE_VERTEX_LOCATION=****
23+
GOOGLE_VERTEX_PROJECT=****
24+
GOOGLE_APPLICATION_CREDENTIALS=./vertex-ai-credentials.json
25+
GOOGLE_CLOUD_PROJECT=****
26+
27+
# Google Cloud Storage for file uploads
28+
GCS_BUCKET_NAME=****
29+
30+
# Upstash Redis for shared links
31+
# Create a Redis database at https://console.upstash.com/
32+
UPSTASH_REDIS_REST_URL=****
33+
UPSTASH_REDIS_REST_TOKEN=****
34+
35+
# Microsoft login
36+
AUTH_MICROSOFT_ENTRA_ID_ID=***
37+
AUTH_MICROSOFT_ENTRA_ID_SECRET=***
38+
AUTH_MICROSOFT_ENTRA_ID_ISSUER=https://login.microsoftonline.com/common/v2.0
39+
40+
# API configuration
41+
# Customize these to connect to your external data source
42+
API_BASE_URL=https://api.example.com
43+
API_KEY=****
44+
45+
# Environment name (dev, prod, preview-*, etc.)
46+
# Used for client-side environment checks (e.g. hiding suggested actions in prod)
47+
ENVIRONMENT=dev
48+
NEXT_PUBLIC_ENVIRONMENT=dev
49+
50+
# Kernel.sh API key for remote browser management
51+
KERNEL_API_KEY=****
52+
53+
# Feature flag for guest login
54+
# When true, enables guest login that bypasses OAuth (no credentials needed)
55+
# To enable locally: set both to true in your .env.local
56+
USE_GUEST_LOGIN=false
57+
NEXT_PUBLIC_USE_GUEST_LOGIN=false
58+
59+
# Allowed email domains for OAuth sign-in (comma-separated)
60+
ALLOWED_EMAIL_DOMAINS=@example.com,@other.org

.eslintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"extends": [
3+
"next/core-web-vitals",
4+
"plugin:import/recommended",
5+
"plugin:import/typescript",
6+
"prettier",
7+
"plugin:tailwindcss/recommended"
8+
],
9+
"plugins": ["tailwindcss"],
10+
"rules": {
11+
"tailwindcss/no-custom-classname": "off",
12+
"tailwindcss/classnames-order": "off"
13+
},
14+
"settings": {
15+
"import/resolver": {
16+
"typescript": {
17+
"alwaysTryTypes": true,
18+
"project": "./tsconfig.json"
19+
}
20+
}
21+
},
22+
"ignorePatterns": ["**/components/ui/**"]
23+
}

.github/pull_request_template.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Checklist
2+
3+
- [ ] Update PR Title to follow this pattern: `[INTENT]:[MESSAGE]`
4+
> The title will become a one-line commit message in the git log, so be as concise and specific as possible -- refer to [How to Write a Git Commit Message](https://cbea.ms/git-commit/). Prepend [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/#summary) intent (`fix:`, `feat:`, `chore:`, `ci:`, `docs:`, `style:`, `refactor:`, `perf:`, `test:`).
5+
6+
## Ticket
7+
8+
Resolves #{TICKET NUMBER or URL or description} or Adds {new capability or feature}
9+
10+
## Changes
11+
12+
> What was added, updated, or removed in this PR.
13+
> Prefer small PRs; try to limit to 300 lines of code changes
14+
> * https://blog.logrocket.com/using-stacked-pull-requests-in-github/
15+
> * https://opensource.com/article/18/6/anatomy-perfect-pull-request
16+
> * https://developers.google.com/blockly/guides/modify/contribute/write_a_good_pr
17+
18+
## Testing
19+
20+
> What was tested? How did you test it? Add unit tests for new functions, integration tests for API/database interactions, and E2E tests for critical user flows.
21+
> * https://martinfowler.com/articles/practical-test-pyramid.html
22+
> * https://blog.logrocket.com/javascript-testing-best-practices/
23+
> * https://www.testim.io/blog/typescript-unit-testing-101/
24+
25+
## Context for reviewers
26+
27+
> Background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers.
28+
> Add comments to your code under the "Files Changed" tab to explain complex logic or code
29+
> * https://betterprogramming.pub/how-to-make-a-perfect-pull-request-3578fb4c112

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint
2+
on:
3+
push:
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-22.04
8+
strategy:
9+
matrix:
10+
node-version: [20]
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Install pnpm
14+
uses: pnpm/action-setup@v4
15+
with:
16+
version: 9.12.3
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
cache: 'pnpm'
22+
- name: Install dependencies
23+
run: pnpm install
24+
- name: Run lint
25+
run: pnpm lint

.gitignore

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# IDE
4+
.vscode
5+
6+
# build artifacts
7+
*.tsbuildinfo
8+
next-env.d.ts
9+
10+
# dependencies
11+
node_modules
12+
.pnp
13+
.pnp.js
14+
15+
# testing
16+
coverage
17+
artifacts/session_*
18+
19+
# next.js
20+
.next/
21+
out/
22+
build
23+
24+
# misc
25+
.DS_Store
26+
*.pem
27+
28+
# debug
29+
*.log
30+
npm-debug.log*
31+
yarn-debug.log*
32+
yarn-error.log*
33+
.pnpm-debug.log*
34+
35+
# local env files
36+
.env.local
37+
.env.development.local
38+
.env.test.local
39+
.env.production.local
40+
41+
# turbo
42+
.turbo
43+
44+
.env
45+
.vercel
46+
.env*.local
47+
48+
# Playwright
49+
/test-results/
50+
/playwright-report/
51+
/blob-report/
52+
/playwright/*
53+
vertex-ai-credentials.json
54+
55+
.claude/

CODE_OF_CONDUCT.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
- The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at labs@navapbc.com. All complaints will be reviewed and investigated promptly and fairly.
63+
64+
All community leaders are obligated to respect the privacy and security of the
65+
reporter of any incident.
66+
67+
## Enforcement Guidelines
68+
69+
Community leaders will follow these Community Impact Guidelines in determining
70+
the consequences for any action they deem in violation of this Code of Conduct:
71+
72+
### 1. Correction
73+
74+
**Community Impact**: Use of inappropriate language or other behavior deemed
75+
unprofessional or unwelcome in the community.
76+
77+
**Consequence**: A private, written warning from community leaders, providing
78+
clarity around the nature of the violation and an explanation of why the
79+
behavior was inappropriate. A public apology may be requested.
80+
81+
### 2. Warning
82+
83+
**Community Impact**: A violation through a single incident or series
84+
of actions.
85+
86+
**Consequence**: A warning with consequences for continued behavior. No
87+
interaction with the people involved, including unsolicited interaction with
88+
those enforcing the Code of Conduct, for a specified period of time. This
89+
includes avoiding interactions in community spaces as well as external channels
90+
like social media. Violating these terms may lead to a temporary or
91+
permanent ban.
92+
93+
### 3. Temporary Ban
94+
95+
**Community Impact**: A serious violation of community standards, including
96+
sustained inappropriate behavior.
97+
98+
**Consequence**: A temporary ban from any sort of interaction or public
99+
communication with the community for a specified period of time. No public or
100+
private interaction with the people involved, including unsolicited interaction
101+
with those enforcing the Code of Conduct, is allowed during this period.
102+
Violating these terms may lead to a permanent ban.
103+
104+
### 4. Permanent Ban
105+
106+
**Community Impact**: Demonstrating a pattern of violation of community
107+
standards, including sustained inappropriate behavior, harassment of an
108+
individual, or aggression toward or disparagement of classes of individuals.
109+
110+
**Consequence**: A permanent ban from any sort of public interaction within
111+
the community.
112+
113+
## Attribution
114+
115+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
116+
version 2.0, available at
117+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
118+
119+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
120+
enforcement ladder](https://github.com/mozilla/diversity).
121+
122+
[homepage]: https://www.contributor-covenant.org
123+
124+
For answers to common questions about this code of conduct, see the FAQ at
125+
https://www.contributor-covenant.org/faq. Translations are available at
126+
https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Contributing to the Form-Filling Assistant
2+
3+
Thank you for your interest in contributing! The Form-Filling Assistant is an open-source AI tool built by [Nava Labs](https://www.navapbc.com/labs/ai-tools-public-benefits) to help caseworkers navigate benefit portals and complete applications on behalf of the families they serve. We welcome contributions from developers, designers, policy experts, and community members. This document explains how to get involved.
4+
5+
## Community
6+
7+
We are committed to providing a welcoming and respectful environment for all contributors. All contributors are expected to follow our [Code of Conduct](CODE_OF_CONDUCT.md).
8+
9+
## Bugs and Issues
10+
11+
Bug reports are welcome — they help us make this tool better for caseworkers and the communities they serve.
12+
13+
When you're ready to file, [create a GitHub issue](https://github.com/navapbc/labs-form-filling-agent/issues/new) and include:
14+
- A clear description of the bug and what you expected to happen
15+
- Steps to reproduce
16+
- Your environment (OS, Node version, browser if relevant)
17+
- Any relevant logs or screenshots
18+
19+
**Security issues:** Please do not file security vulnerabilities as public GitHub issues. See our [Security Policy](SECURITY.md) for how to report them privately.
20+
21+
## Suggesting Features
22+
23+
We're especially interested in feedback from people who work directly with caseworkers or benefit systems. If you have an idea for how this tool could better serve that context, [open a GitHub issue](https://github.com/navapbc/labs-form-filling-agent/issues/new) with the label `enhancement` and describe:
24+
- The problem you're trying to solve
25+
- Who it would benefit
26+
- Any ideas you have for how it might work
27+
28+
## Getting Started
29+
30+
To contribute code, start by forking the repository and setting up your local environment. See the [Getting Started](README.md#getting-started) section in the README for setup instructions.
31+
32+
Once you're ready, submit a pull request with:
33+
- A clear title and description of what you changed and why
34+
- A reference to the related issue (e.g., `Closes #123`)
35+
- Screenshots or screen recordings for UI changes
36+
- Test results confirming nothing is broken
37+
38+
## Code Review Process
39+
40+
### Submitting for Review
41+
42+
Before opening a pull request:
43+
- Make sure all tests pass locally
44+
- Update any documentation affected by your changes
45+
- Do a self-review of your diff before requesting others' time
46+
- Request a review from a maintainer
47+
48+
### Review Criteria
49+
50+
Reviewers will evaluate contributions for:
51+
52+
- **Functionality** — does the code work as intended?
53+
- **Security** — are there any vulnerabilities or data exposure risks, particularly given the sensitive nature of benefit casework?
54+
- **Performance** — does this impact system responsiveness for users on lower-bandwidth connections?
55+
- **Accessibility** — does this maintain accessibility standards (WCAG 2.1 AA)?
56+
- **Maintainability** — is the code readable, well-structured, and documented?
57+
- **Testing** — is there adequate test coverage for the changes?
58+
59+
### Addressing Feedback
60+
61+
- Respond to review comments in a timely way
62+
- Make requested changes or explain your reasoning if you'd like to discuss an alternative
63+
- Update tests and documentation as needed
64+
- Re-request review once changes are complete
65+
66+
## Questions?
67+
68+
If you're unsure about anything before contributing, feel free to open a GitHub issue with the `question` label. We'd rather you ask than get stuck.
69+
70+
Thank you for contributing to the Form-Filling Assistant!

0 commit comments

Comments
 (0)