Go to file
2025-12-07 04:16:55 +03:00
.storybook trial choice 2025-10-23 02:20:09 +02:00
docs fix 2025-10-30 13:26:26 +01:00
public palm 2025-12-07 04:16:11 +03:00
scripts add ab 5$ trial grid and email validation 2025-12-01 04:09:26 +03:00
src email error 2025-12-07 04:15:41 +03:00
.gitignore initial 2025-09-23 20:39:40 +04:00
components.json initial 2025-09-23 20:39:40 +04:00
eslint.config.mjs initial 2025-09-23 20:39:40 +04:00
next.config.ts fix 2025-10-30 13:26:26 +01:00
package-lock.json fix 2025-12-06 03:13:03 +03:00
package.json fix 2025-12-06 03:13:03 +03:00
postcss.config.mjs initial 2025-09-23 20:39:40 +04:00
README.md fix 2025-10-05 23:47:56 +02:00
tsconfig.json Initial commit from Create Next App 2025-09-14 18:38:07 +04:00
vitest.config.ts initial 2025-09-23 20:39:40 +04:00
vitest.shims.d.ts initial 2025-09-23 20:39:40 +04:00

Build & runtime modes

The project can be built in two isolated configurations. The build scripts set the FUNNEL_BUILD_VARIANT/NEXT_PUBLIC_FUNNEL_BUILD_VARIANT environment variables so that unused code is tree-shaken during compilation.

  • Production (frontend-only) renders funnels using the baked JSON bundle. The admin UI and MongoDB access are not included in the bundle.
    • Development preview: npm run dev:frontend
    • Production build (default): npm run build or npm run build:frontend
    • Production start (default): npm run start or npm run start:frontend
  • Development (full system) runs the public frontend together with the admin panel backed by MongoDB.
    • Development (default): npm run dev or npm run dev:full
    • Development build: npm run build:full
    • Development start: npm run start:full

Local development

  1. Install dependencies: npm install
  2. Choose the required mode:
    • Production preview (frontend-only): npm run dev:frontend
    • Full system development: npm run dev

The application will be available at http://localhost:3000.

Production build

npm run build        # frontend-only production bundle
# or
npm run build:full   # full system development bundle

After building, start the chosen bundle with npm run start (frontend-only) or npm run start:full.

Funnel Management

Database Synchronization

To sync published funnels from MongoDB into the codebase:

# Sync all published funnels from database (keeps JSON files)
npm run sync:funnels

# Preview what would be synced (dry-run mode)
npm run sync:funnels -- --dry-run

# Sync only specific funnels
npm run sync:funnels -- --funnel-ids funnel-test,ru-career-accelerator

# Sync and clean up JSON files after baking
npm run sync:funnels -- --clean-files

This script:

  1. Connects to MongoDB and fetches all latest published funnels
  2. Downloads images from database and saves them to public/images/
  3. Updates image URLs in funnels to point to local files
  4. Saves them as JSON files in public/funnels/
  5. Bakes them into TypeScript (src/lib/funnel/bakedFunnels.ts)
  6. Keeps JSON files by default (use --clean-files to remove them)

Other Funnel Commands

# Import JSON files from public/funnels/ to MongoDB
npm run import:funnels

# Manually bake JSON files to TypeScript
npm run bake:funnels

Recommended Workflow:

  1. Create/edit funnels in the admin panel
  2. Publish them in the admin
  3. Run npm run sync:funnels to update the codebase
  4. Build and deploy with the latest funnels