A less-configuration, flexible library that integrates a comment area into your blog. It doesn't handle Authentication, you can use your own Auth system with Fuma Comment (ex: integrates with Auth.js).
Note that it is not a SaaS, you will need a database (PostgreSQL & MySQL) to continue.
You need a database to persist comments. Fuma Comment has built-in support for Prisma ORM, you may implement your own storage adapter following the instructions in TSDoc of StorageAdapter.
First, update your schema to include following tables:
// optional for Role System based on databasemodel Role { userId String @id @db.VarChar(256) name String @db.VarChar(256) canDelete Boolean}model Comment { id Int @id @default(autoincrement()) page String @db.VarChar(256) thread Int? author String @db.VarChar(256) content Json @db.Json timestamp DateTime @default(now()) @db.Timestamp() rates Rate[] @@index([page])}model Rate { userId String @db.VarChar(256) commentId Int like Boolean comment Comment @relation(fields: [commentId], references: [id], onDelete: Cascade) @@id([userId, commentId]) @@index([commentId])}
Then, create the adapter.
import { createAdapter } from "@fuma-comment/prisma-adapter";import { PrismaClient } from "@prisma/client";const prisma = new PrismaClient();const adapter = createAdapter({ db: prisma, getUsers(userIds) { // Fetch user profile from the user id },});