Skip to content

deepshaswat/deepshaswat.com

Repository files navigation

deepshaswat.com - Modern Newsletter Platform

This is a modern newsletter platform with custom CMS to create and manage blogs, newsletters and members with Notion style text editor built with Turborepo, Next.js, and various other cutting-edge technologies. The project uses a monorepo structure to manage multiple applications and shared packages.

πŸš€ Tech Stack

  • Turborepo - High-performance build system
  • Next.js - React framework
  • Tailwind CSS - Utility-first CSS framework
  • Prisma - Next-generation ORM
  • Shadcn/ui - Re-usable components
  • AceternityUI - Modern animated components
  • Recoil - State management
  • Clerk - Authentication
  • Resend - Modern way of sending email
  • Digital Ocean - New age managed services. Using for redis, mongodb etc.
  • PostHog - Best tool for analytics and best free tier.
  • AWS - Suing S3 bucket here to store all the media

πŸ“¦ Project Structure

Apps

  • web/ - Blog site with personal website. Newsletter page with option to subscribe Live here
  • admin/ - Admin site with create blogs, newsletter and user management. Enhancements are still in progress. Link to demo

Packages

  • actions/ - Shared business logic and API actions
  • db/ - Database client and schema definitions
  • ui/ - Shared UI component library
  • store/ - State management and data stores
  • schema/ - Shared type definitions and schemas
  • config-tailwind/ - Shared Tailwind configuration
  • config-typescript/ - Shared TypeScript configurations
  • config-eslint/ - Shared ESLint configurations

πŸ› οΈ Development

Prerequisites

  • Node.js >= 16
  • Yarn
  • MongoDB (for Prisma)

Getting Started

  1. Clone the repository:
git clone https://github.com/deepshaswat/deepshaswat.com.git
  1. Install dependencies:
yarn install
  1. Set up environment variables:
cp .env.example .env
  1. Start the development server:
yarn dev

πŸ—οΈ Building

yarn build

πŸ§ͺ Testing

yarn test

πŸ“š Additional Resources

πŸ“‹ Configuration Todo List

Required Environment Variables

The following environment variables need to be configured for full functionality:

Core Services (Required)

Variable Description How to Get
DATABASE_URL MongoDB connection string MongoDB Atlas or DigitalOcean
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY Clerk public key Clerk Dashboard
CLERK_SECRET_KEY Clerk secret key Clerk Dashboard
RESEND_API_KEY Resend API key for emails Resend Dashboard
RESEND_AUDIENCE_ID Resend audience ID Resend Audiences

Storage (Required)

Variable Description How to Get
AWS_ACCESS_KEY_ID AWS access key AWS IAM Console
AWS_SECRET_ACCESS_KEY AWS secret key AWS IAM Console
AWS_S3_BUCKET_NAME S3 bucket name Create in S3 Console
AWS_REGION AWS region (e.g., us-east-1) Your S3 bucket region

Caching (Required)

Variable Description How to Get
REDIS_URL Redis connection string DigitalOcean Managed Redis

Analytics (Optional but Recommended)

Variable Description How to Get
NEXT_PUBLIC_POSTHOG_KEY PostHog project API key PostHog Dashboard
NEXT_PUBLIC_POSTHOG_HOST PostHog host URL Usually https://app.posthog.com

AI Features (Optional - for Idea Generator)

Variable Description How to Get
GCP_PROJECT_ID Google Cloud project ID GCP Console
GCP_LOCATION GCP region (default: us-central1) Vertex AI Regions
GOOGLE_APPLICATION_CREDENTIALS Path to service account JSON See setup below

AI Features Setup (Vertex AI)

To enable AI-powered features (topic suggestions, trending analysis, script generation, image generation):

  1. Create a GCP Project

    # Install gcloud CLI if not installed
    # https://cloud.google.com/sdk/docs/install
    
    gcloud projects create your-project-id
    gcloud config set project your-project-id
  2. Enable Vertex AI API

    gcloud services enable aiplatform.googleapis.com
  3. Create Service Account

    gcloud iam service-accounts create vertex-ai-sa \
      --display-name="Vertex AI Service Account"
    
    gcloud projects add-iam-policy-binding your-project-id \
      --member="serviceAccount:vertex-ai-sa@your-project-id.iam.gserviceaccount.com" \
      --role="roles/aiplatform.user"
    
    gcloud iam service-accounts keys create ./vertex-ai-key.json \
      --iam-account=vertex-ai-sa@your-project-id.iam.gserviceaccount.com
  4. Set Environment Variables

    GCP_PROJECT_ID=your-project-id
    GCP_LOCATION=us-central1
    GOOGLE_APPLICATION_CREDENTIALS=/path/to/vertex-ai-key.json
  5. Enable Imagen API (for image generation)

Cron Job Setup (for Scheduled Posts)

Set up a cron job to publish scheduled posts:

# Call this endpoint every minute
curl -X POST https://your-admin-domain.com/api/cron/publish-scheduled \
  -H "Authorization: Bearer YOUR_CRON_SECRET"

Add to your environment:

CRON_SECRET=your-secure-cron-secret

Deployment Checklist

  • Configure all required environment variables
  • Set up MongoDB database
  • Set up Redis cache
  • Create S3 bucket with CORS configuration
  • Set up Clerk authentication
  • Configure Resend for emails
  • (Optional) Set up PostHog analytics
  • (Optional) Set up Vertex AI for AI features
  • Set up cron job for scheduled posts
  • Configure domain and DNS
  • Set up SSL certificates

Feature Status

Feature Status Config Required
Blog Editor βœ… Ready Core services
Newsletter Sending βœ… Ready Resend
Image Upload βœ… Ready AWS S3
Member Management βœ… Ready Core services
Scheduled Posts βœ… Ready Cron job
Analytics βœ… Ready PostHog (optional)
AI Topic Discovery βœ… Ready Vertex AI (optional)
AI Outline Generator βœ… Ready Vertex AI (optional)
AI Script Generator βœ… Ready Vertex AI (optional)
AI Image Generator βœ… Ready Vertex AI Imagen (optional)

πŸ“ License

MIT

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages