Public archive and search engine for DKIM (DomainKeys Identified Mail) records. This is designed to help users discover, contribute, and verify email authentication keys with web UI and over API.
archive provides a comprehensive solution for managing DKIM records. Users can:
- Discover DKIM public keys: Access a searchable database of DKIM keys for various domains via a web interface and a programmatic API.
- Contribute DKIM signatures: Submit DKIM signatures from multiple sources, including integrated Gmail accounts or by uploading mailbox files (
.mbox/.pst). - Verify Authenticity: Ensure the integrity and active timeframe of DKIM keys, with records timestamped on-chain using TLSNotary for robust verification.
These instructions will guide you through setting up the project on your local machine for development and testing.
- Node.js (LTS version recommended)
pnpm(recommended),npm, oryarn- A running PostgreSQL server instance
- Access to Google Cloud Platform (GCP) for Cloud Function deployment (required for full functionality)
-
Clone the repository:
git clone https://github.com/zkemail/archive cd archive -
Install dependencies:
pnpm install # or npm install # or yarn install -
Set up environment variables: Copy the example environment file and customize it with your configurations:
cp .env.example .envKey variables to configure:
POSTGRES_PRISMA_URL: Your PostgreSQL connection string for Prisma.POSTGRES_URL_NON_POOLING: Direct PostgreSQL connection string (used for migrations, etc.).GOOGLE_CLIENT_ID&GOOGLE_CLIENT_SECRET: Credentials for Gmail OAuth integration via NextAuth.js.NEXTAUTH_URL: The canonical URL of your deployment (e.g.,http://localhost:3000for local development).NEXTAUTH_SECRET: A secret key for NextAuth.js session encryption.- API keys or endpoint URLs for GCP Cloud Functions and other external services, if applicable.
-
Run Prisma migrations to initialize your database schema:
pnpm prisma migrate dev # or npx prisma migrate dev -
(Optional) Seed the database with initial data if a seed script is available:
pnpm prisma db seed # or npx prisma db seed
To start the Next.js development server:
pnpm run dev
# or npm run dev
# or yarn dev
The application will typically be available at http://localhost:3000 (or your configured port).
- Framework: Next.js (with App Router)
- Language: TypeScript
- UI Components: Shadcn/ui
- Styling: Tailwind CSS
- Database: PostgreSQL
- ORM: Prisma
- Authentication: NextAuth.js (for Gmail integration)
- Serverless Functions: GCP Cloud Functions (e.g., for Python/C++ based GCD)
- Linting/Formatting: ESLint, Prettier
- Git Hooks: Husky
The system is structured as follows:
- Next.js Application:
- Frontend: User interface built with React/Next.js and Shadcn/ui components.
- API Routes: Backend logic handling DKIM lookups, submissions, Gmail integration, and communication with the GCP Cloud Function.
- Database Layer:
- PostgreSQL: Stores DKIM records, domain-selector pairs, metadata, and GCD results.
- Prisma: ORM for database interactions.
- GCP Cloud Function:
- A serverless function dedicated to computationally intensive tasks, such as GCD calculations for DKIM key recovery.
