Skip to content

Repository files navigation

AI Vita

AI Vita is a full-stack web application built with Next.js (frontend) and Express (backend). It includes chat, diagnostics, personality assessment, reporting, subscription flows, and integrations such as Supabase, OpenAI, Stripe, and LINE.

Tech Stack

  • Frontend: Next.js, React, TypeScript, Tailwind CSS
  • Backend: Express, TypeScript, Prisma
  • Database/Auth: Supabase, PostgreSQL
  • Integrations: OpenAI, Stripe, LINE Messaging API, Redis (optional)

Repository Structure

  • src/: Frontend application (Next.js App Router)
  • backend/: Backend API server
  • backend/prisma/: Prisma schema and migrations
  • .env.example: Frontend environment template
  • backend/.env.example: Backend environment template

Prerequisites

  • Node.js 20+ (Node 22 is recommended)
  • npm
  • PostgreSQL (for backend database)

Setup

1) Install dependencies

Install frontend dependencies in the project root:

npm install

Install backend dependencies:

cd backend
npm install

2) Configure environment variables

Frontend:

  1. Copy .env.example to .env.local.
  2. Set at least:
    • NEXT_PUBLIC_SUPABASE_URL
    • NEXT_PUBLIC_SUPABASE_ANON_KEY
    • NEXT_PUBLIC_LINE_OFFICIAL_ID

Backend:

  1. Copy backend/.env.example to backend/.env.
  2. Configure:
    • PORT
    • DATABASE_URL
    • SUPABASE_JWKS_URL
    • SUPABASE_ISSUER
    • SUPABASE_AUDIENCE
    • OPENAI_API_KEY
    • Stripe and LINE variables if those features are used

3) Run database migration (backend)

cd backend
npm run migrate:dev

Run in Development

Start backend API:

cd backend
npm run dev

In another terminal, start frontend:

npm run dev

Default URLs:

  • Frontend: http://localhost:3000
  • Backend: http://localhost:5000 (or the value of PORT)

Build and Start (Production)

Frontend:

npm run build
npm run start

Backend:

cd backend
npm run build
npm run start

Useful Scripts

Frontend (root):

  • npm run dev - Start Next.js in development mode
  • npm run build - Build frontend for production
  • npm run start - Start frontend in production mode
  • npm run lint - Run Next.js lint

Backend (backend/):

  • npm run dev - Start backend with watch mode
  • npm run build - Compile backend TypeScript
  • npm run start - Start backend
  • npm run migrate:dev - Create/apply Prisma migration in development
  • npm run migrate:deploy - Apply migrations in deployment
  • npm run prisma:studio - Open Prisma Studio

Notes

  • Do not commit real secrets in .env files.
  • Update FRONTEND_URL and callback/webhook URLs for your environment.
  • If webhooks are used (Stripe/LINE), ensure your public endpoint is reachable and correctly configured.

About

AI Vita is a full-stack health and wellness platform with an AI-powered chat experience, diagnostic tools, personality assessment, reporting, and subscription workflows, built with Next.js + Express and integrated with Supabase, OpenAI, Stripe, and LINE.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages