Automify is a Next.js automation SaaS for connecting apps and building workflow automations. The app provides an authenticated dashboard where users can connect services such as Google Drive, Discord, Notion, and Slack, then compose workflows with trigger/action nodes for tasks like sending messages, creating Notion entries, and reacting to Google Drive activity.
- Next.js 15 App Router with React 19 and TypeScript
- Auth.js/NextAuth for Google and GitHub OAuth login
- Prisma with PostgreSQL for persistence
- Razorpay for paid plan checkout
- Tailwind CSS and Radix UI for the interface
- OAuth integrations for Google Drive, Discord, Notion, and Slack
- Node.js compatible with Next.js 15
- npm (this repo includes
package-lock.json) - PostgreSQL database
- OAuth apps/credentials for the integrations you plan to use
- Auth.js application secret and OAuth credentials for Google/GitHub login
- Razorpay key ID and key secret if billing pages/API are used
-
Install dependencies:
npm install
-
Create local environment files. This project currently reads variables from both
.envand.env.local; keep secrets in.env.localand public/client-safe values in.env. -
Configure the database and generate Prisma artifacts:
npx prisma generate npm run db:migrate
-
If using the current development script, create local HTTPS certificates at
ssl/key.pemandssl/cert.pem. Thenpm run devscript runsnode server.js, and that server reads those files before starting onhttps://localhost:3000. -
Start the development server:
npm run dev
-
Open
https://localhost:3000.
The exact values depend on your Auth.js, OAuth, Razorpay, and database setup. Variables discovered in the app are listed below.
| Variable | Purpose |
|---|---|
DATABASE_URL |
PostgreSQL connection string used by Prisma |
NEXTAUTH_SECRET / AUTH_SECRET |
Secret used to sign Auth.js sessions |
NEXTAUTH_URL |
Base app URL used by Auth.js callbacks |
AUTH_GOOGLE_ID / AUTH_GOOGLE_SECRET |
Google OAuth credentials for app login |
AUTH_GITHUB_ID / AUTH_GITHUB_SECRET |
GitHub OAuth credentials for app login |
LOCAL_AUTH_ENABLED |
Optional local login fallback toggle |
LOCAL_AUTH_SECRET |
Optional local login session signing secret |
LOCAL_AUTH_EMAIL / LOCAL_AUTH_PASSWORD |
Optional production local fallback credentials |
NEXT_PUBLIC_URL |
Base application URL used by OAuth callbacks |
RAZORPAY_KEY_ID |
Razorpay key ID used to create checkout orders |
RAZORPAY_KEY_SECRET |
Razorpay key secret used to create orders and verify payment signatures |
| Variable | Purpose |
|---|---|
DISCORD_CLIENT_ID / NEXT_PUBLIC_DISCORD_CLIENT_ID |
Discord OAuth client ID |
DISCORD_CLIENT_SECRET |
Discord OAuth client secret |
DISCORD_REDIRECT_URI |
Discord OAuth callback URL |
DISCORD_TOKEN |
Discord bot/application token, if needed by Discord features |
DISCORD_PUBLIC_KEY |
Discord public key, if needed by Discord features |
NOTION_CLIENT_ID / NEXT_PUBLIC_NOTION_CLIENT_ID |
Notion OAuth client ID |
NOTION_CLIENT_SECRET |
Notion OAuth client secret |
NOTION_REDIRECT_URI |
Notion OAuth callback URL |
NOTION_ENCRYPTION_KEY |
Key used when storing Notion connection data |
SLACK_CLIENT_ID / NEXT_PUBLIC_SLACK_CLIENT_ID |
Slack OAuth client ID |
SLACK_CLIENT_SECRET |
Slack OAuth client secret |
SLACK_REDIRECT_URI |
Slack OAuth callback URL |
SLACK_SIGNING_SECRET |
Slack request signing secret |
SLACK_BOT_TOKEN |
Slack bot token |
SLACK_APP_TOKEN |
Slack app-level token |
GOOGLE_CLIENT_ID / NEXT_PUBLIC_GOOGLE_CLIENT_ID |
Google OAuth client ID |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret |
OAUTH2_REDIRECT_URI |
Google OAuth redirect URI used by Drive API routes |
NEXT_PUBLIC_GOOGLE_REDIRECT_URI |
Google Drive OAuth callback URL used by connection cards |
NEXT_PUBLIC_GOOGLE_SCOPES |
Google OAuth scopes, if configured externally |
NEXT_PUBLIC_OAUTH2_ENDPOINT |
Google OAuth endpoint, if configured externally |
NGROK_URI |
Public tunnel URL for Google Drive change notifications |
CRON_JOB_KEY |
Bearer token used by scheduled/notification flows |
| Variable | Purpose |
|---|---|
NEXT_PUBLIC_DOMAIN |
Public app domain |
NEXT_PUBLIC_SCHEME |
URL scheme, such as http or https |
NEXT_PUBLIC_UPLOAD_CARE_CSS_SRC |
Uploadcare CSS source, if Uploadcare UI is enabled |
NEXT_PUBLIC_UPLOAD_CARE_SRC_PACKAGE |
Uploadcare package source, if Uploadcare UI is enabled |
| Command | Description |
|---|---|
npm run dev |
Starts the custom HTTPS Next.js development server via node server.js |
npm run build |
Runs prisma generate, applies deployed migrations, then builds Next.js |
npm run start |
Starts the production Next.js server |
npm run lint |
Runs the configured Next.js lint command |
npm run db:migrate |
Runs Prisma migrations with .env.local loaded through dotenv-cli |
Prisma schema lives in prisma/schema.prisma and targets PostgreSQL. The main models are users, connected accounts, workflow definitions, and provider-specific connection records for Google, Discord, Notion, and Slack.
Typical local workflow:
npx prisma generate
npm run db:migrate-
Required environment: set
DATABASE_URLin.env.localbefore running migrations. It must point at the intended PostgreSQL database; Prisma reads it throughenv("DATABASE_URL")inprisma/schema.prisma. -
Local command behavior:
npm run db:migrateloads.env.localwithdotenv-cliand runsnpx prisma migrate dev. Use it for local development databases because it may create new migration files, apply pending migrations, and ask for/reset local state when Prisma detects drift. -
Staging/production behavior: do not run
npm run db:migrateagainst shared, staging, or production databases. For deployed environments, review committed migration SQL first, take a database backup/snapshot, then apply migrations with Prisma's deploy flow, for examplenpx prisma migrate deploy, using the environment-specificDATABASE_URL. -
Backup expectation: take a restorable backup before applying migrations anywhere with shared or customer data. Confirm the backup can be restored before running destructive or uniqueness-changing migrations.
-
Rollback expectation: Prisma migrations are forward-only in this project. If a migration has already been applied to a shared environment, prefer a new forward-fix migration over editing or deleting the applied migration. Only use database restores as an operational rollback after confirming the restore target and data-loss impact.
-
Validation commands before opening a PR or deploying:
npm pkg get scripts npx prisma validate npx prisma migrate status
npx prisma migrate statusrequiresDATABASE_URL; run it only against the database you intend to inspect.
Configure provider dashboards to point back to the matching app routes and set the corresponding redirect URI variables:
- Discord:
/api/auth/callback/discord - Notion:
/api/auth/callback/notion - Slack:
/api/auth/callback/slack - Google Drive:
/api/auth/callback/googleDrive
For local development, make sure the callback URLs match the HTTPS localhost or tunnel URL used by the running app.
- The repository currently has a custom
server.jsdevelopment entrypoint that requires local SSL files. If those files are absent,npm run devfails before Next.js starts. - Google Drive activity notifications require a publicly reachable callback URL, so local testing usually needs a tunnel such as ngrok and a matching
NGROK_URI. - Do not commit real
.envor.env.localvalues.