Smart Lead Magnet

0

Transform your website into a lead-generating machine within minutes. Our intuitive platform empowers you to customize stunning lead magnets effortlessly.

Miscellaneous

smart-lead-magnet
lead-magnet
magnet
lead

SmartLeadMagnet Turbo Repo Project Setup

This project works on Bun and requires Node.js 18 or higher. Follow the instructions below to set up the environment and run the project.

Step 1: Prerequisites

Before you start, ensure that you have the following installed:

  1. Bun
    Bun is a fast JavaScript runtime. You can install it by following the instructions on the official website:
    Bun Installation Guide

  2. Node.js 18 or higher
    You can download and install Node.js from the official website:
    Node.js Downloads

  3. Docker
    Docker is required to run MongoDB using Docker Compose. You can download and install Docker from the official website:
    Docker Downloads

  4. MongoDB (via Docker Compose)
    The project uses MongoDB, and there is a Docker Compose configuration available to start MongoDB easily.

Step 2: Setting Up MongoDB Using Docker Compose

To set up MongoDB locally using Docker Compose, follow these steps:

  1. Ensure Docker is installed and running on your machine.
  2. Start the MongoDB container by running the following command in your terminal:
docker-compose up -d

This will start a MongoDB container with the username root and password prisma, accessible on port 27017. The MongoDB instance will be available locally at mongodb://root:prisma@localhost:27017/prisma-mongo?authSource=admin.

You can stop the container anytime by running:

docker-compose down

Step 3: Environment Setup

You need to create and fill the .env file in the root of the project with the following environment variables:

Variable NameDescriptionExample Value
PRISMA_DATABASE_URLMongoDB connection URLmongodb://root:prisma@localhost:27017/prisma-mongo?authSource=admin
LLM_TYPEType of Large Language Model (LLM) usedgroq
LLM_MODELModel of the LLMllama-3.2-90b-text-preview
LLM_API_KEYAPI key for accessing the LLMyour_llm_api_key
AUTH_GOOGLE_IDGoogle OAuth Client IDyour_google_auth_id
AUTH_GOOGLE_SECRETGoogle OAuth Client Secretyour_google_auth_secret
AUTH_SECRETSecret used for authenticationyour_auth_secret
AUTH_URLURL for authentication callbackhttp://localhost:3000
MONGO_USERNAMEMongoDB usernameroot
MONGO_PASSWORDMongoDB passwordprisma
S3_UPLOAD_KEYAWS S3 Upload Keyyour_s3_upload_key
S3_UPLOAD_SECRETAWS S3 Upload Secretyour_s3_upload_secret
S3_UPLOAD_BUCKETAWS S3 Upload Bucketyour_s3_upload_bucket
S3_UPLOAD_REGIONAWS S3 Upload Regionyour_s3_upload_region
NEXT_PUBLIC_MEDIA_CDN_NAMEMedia CDN URLyour_media_cdn_url
BEDROCK_AWS_REGIONBedrock AWS Regionyour_bedrock_aws_region
BEDROCK_AWS_ACCESS_KEY_IDBedrock AWS Access Key IDyour_bedrock_aws_access_key_id
BEDROCK_AWS_SECRET_ACCESS_KEYBedrock AWS Secret Access Keyyour_bedrock_aws_secret_access_key
OPEN_AI_KEYOpenAI API Keyyour_open_ai_key
UPSTASH_REDIS_REST_URLUpstash Redis REST URLyour_upstash_redis_rest_url
UPSTASH_REDIS_REST_TOKENUpstash Redis REST Tokenyour_upstash_redis_rest_token
EMAIL_SERVER_USEREmail Server Useryour_email_server_user
EMAIL_SERVER_PASSWORDEmail Server Passwordyour_email_server_password
EMAIL_SERVER_HOSTEmail Server Hostyour_email_server_host
EMAIL_SERVER_PORTEmail Server Portyour_email_server_port
EMAIL_FROMEmail From Addressyour_email_from_address
EMAIL_SERVER_USER_TO_UNREGISTER_USEREmail Server User for Unregistering Usersyour_email_server_user_to_unregister_user
EMAIL_SERVER_PASSWORD_TO_UNREGISTER_USEREmail Server Password for Unregistering Usersyour_email_server_password_to_unregister_user
EMAIL_SERVER_HOST_TO_UNREGISTER_USEREmail Server Host for Unregistering Usersyour_email_server_host_to_unregister_user
EMAIL_SERVER_PORT_TO_UNREGISTER_USEREmail Server Port for Unregistering Usersyour_email_server_port_to_unregister_user
EMAIL_FROM_TO_UNREGISTER_USEREmail From Address for Unregistering Usersyour_email_from_address_to_unregister_user
TOGETHER_AI_KEYTogether AI Keyyour_together_ai_key
GOOGLE_GEMINI_API_KEYGoogle Gemini API Keyyour_google_gemini_api_key
STRIPE_SECRET_KEYStripe Secret Keyyour_stripe_secret_key
STRIPE_ENDPOINT_SECRETStripe Endpoint Secretyour_stripe_endpoint_secret
STRIPE_SMARTLEADMAGNET_ONE_TIMEStripe SmartLeadMagnet One-Time Priceyour_stripe_smartleadmagnet_one_time_price
STRIPE_SMARTLEADMAGNET_LIFE_TIMEStripe SmartLeadMagnet Life-Time Priceyour_stripe_smartleadmagnet_life_time_price
STRIPE_SMARTLEADMAGNET_MONTHLY_SUBSCRIPTIONStripe SmartLeadMagnet Monthly Subscription Priceyour_stripe_smartleadmagnet_monthly_subscription_price
STRIPE_SMARTLEADMAGNET_250_CREDITStripe SmartLeadMagnet 250 Credit Priceyour_stripe_smartleadmagnet_250_credit_price
STRIPE_SMARTLEADMAGNET_500_CREDITStripe SmartLeadMagnet 500 Credit Priceyour_stripe_smartleadmagnet_500_credit_price
STRIPE_SMARTLEADMAGNET_750_CREDITStripe SmartLeadMagnet 750 Credit Priceyour_stripe_smartleadmagnet_750_credit_price
STRIPE_SMARTLEADMAGNET_1000_CREDITStripe SmartLeadMagnet 1000 Credit Priceyour_stripe_smartleadmagnet_1000_credit_price
HOST_URLHost URLyour_host_url
NEXT_PUBLIC_SITE_URLSite URLyour_site_url
SENTRY_AUTH_TOKENSentry Auth Tokenyour_sentry_auth_token
NEXT_PUBLIC_GOOGLE_ANALYTICS_IDGoogle Analytics IDyour_google_analytics_id
NEZT_PUBLIC_GOOGLE_TAG_MANGER_IDGoogle Tag Manager IDyour_google_tag_manager_id
NEXT_PUBLIC_CRISP_IDCrisp IDyour_crisp_id
NEXT_PUBLIC_ENABLE_TOAST_SOCIAL_PROOFEnable Toast Social Proofyour_enable_toast_social_proof
NEXT_PUBLIC_WORDPRESS_BLOG_URLWordPress Blog URLyour_wordpress_blog_url

Step 4: Project Structure

The SmartLeadMagnet project is structured as a monorepo using Turbo Repo. Below is the structure of apps and shared packages:

Apps and Packages

  • docs: a Next.js app for documentation.
  • web: the main Next.js app.
  • @smartleadmagnet/ui: a shared React component library used by both web and docs.
  • @smartleadmagnet/eslint-config: shared eslint configurations (includes eslint-config-next and eslint-config-prettier).
  • @smartleadmagnet/typescript-config: shared TypeScript configuration files used throughout the monorepo.

Step 5: Installing Dependencies

Once you have the environment variables set up, install the dependencies for the project.

Run the following command in the root of the project:

bun install

Step 6: Generating Prisma Schema

After setting up MongoDB and environment variables, you need to generate the Prisma schema. Run the following command from the root of the project to generate the Prisma client:

bun run migrate:prisma:generate

Step 7: Running the Development Server

Run your development server using the following command:

bun run dev

This will start the development server for the SmartLeadMagnet project.