nextjs-openai-integration-demo Tailwind Templates

Nextjs Openai Integration Demo

This demo application, built with NextJS, TypeScript, Tailwind, Clerk, Prisma, and OpenAI, allows users to analyze their mood based on journal entries. The AI interprets users’ thoughts and generates mood statistics, displayed in detailed charts.

NextJS OpenAI Integration Monorepo (WIP)

Status: πŸ—οΈ Work in Progress

This is a Turborepo-based monorepo setup for building AI-enhanced mood analysis applications using modern web technologies. This monorepo contains two Next.js applications β€” platform and public β€” and shared packages managed with Turborepo. The project integrates tools like OpenAI, Clerk, Prisma, and Contentful to deliver a rich and interactive user experience.

πŸ“¦ Apps & Packages Structure

apps/
  β”œβ”€β”€ platform/   # Authenticated, AI-enhanced journaling platform
  └── public/     # Public-facing PWA with content from Contentful

packages/
  β”œβ”€β”€ global-analytics/  # Analytics utilities
  β”œβ”€β”€ global-ui/         # Shared UI components
  β”œβ”€β”€ global-utils/      # Common utilities
  β”œβ”€β”€ eslint-config/     # Shared ESLint configurations
  └── typescript-config/ # Shared TypeScript configurations

✨ Features

  • AI-powered mood analysis from journal entries
  • Detailed mood statistics displayed in charts
  • User authentication and management with Clerk
  • Integration with Prisma for database management
  • Integration with Contentful Headless CMS
  • Progressive Web App (PWA) support
  • Monorepo structure with shared UI components
  • Error tracking and monitoring with Sentry
  • Internationalization (i18n) support

🧰 Technologies

  • Next.js (App Router, Turbopack)
  • Turborepo β€” high-performance monorepo management
  • TypeScript β€” strict typing
  • Tailwind CSS β€” modern utility-first CSS
  • Clerk β€” user authentication and management
  • Prisma β€” ORM and DB schema
  • OpenAI / LangChain β€” mood analysis via AI
  • Contentful β€” headless CMS
  • Next-PWA β€” for offline-first capabilities
  • Vitest & Cypress β€” unit and E2E testing
  • Sentry β€” error tracking and monitoring
  • i18n β€” internationalization

πŸ“¦ Scripts (root)

yarn dev         # Run all dev servers
yarn build       # Build all apps/packages
yarn lint        # Lint all apps/packages
yarn test        # Run all tests

Each app has its own set of scripts inside apps/platform and apps/public.

πŸš€ Getting Started

git clone https://github.com/yourusername/nextjs-openai-integration-demo.git
cd nextjs-openai-integration-demo
yarn install
yarn dev

πŸ“ Environment Variables

Environment variables are managed via .env files and/or Vercel dashboard. Refer to turbo.json for globalEnv configuration used during builds:

  • Contentful CMS configuration
  • Clerk authentication
  • OpenAI API
  • Database connection
  • Cron job secrets

πŸ§‘β€πŸ’» Author

Alex Suprun
Email: alex.suprun.email@gmail.com

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.

Top categories

Loading Svelte Themes