A real-time AI chat interface with community features built with Next.js, TypeScript, and Shadcn UI, using a "Book of Answers" style interaction pattern.
- Clean, modern UI with Tailwind CSS and Shadcn UI components
- "Book of Answers" style oracle experience
- Real-time community feed with WebSocket integration
- Like and share functionality for oracle responses
- Metrics dashboard for tracking usage and popular content
- Multi-language support with automatic translation
- Preset system prompts for different oracle personalities
- SQLite database via Prisma for persistent storage
- TypeScript for type safety
- Responsive design with light/dark mode support
- Node.js 18.x or higher
- npm or yarn
- Clone this repository
- Install dependencies:
npm install- Create a
.env.localfile in the project root:
DATABASE_URL="file:./dev.db"
- Initialize the database:
npx prisma migrate dev --name initnpm run devOpen http://localhost:3000 with your browser to see the result.
- Click the "Consult the oracle" button to receive wisdom without typing a question
- Think of your question while waiting for the oracle's response
- Share interesting responses to the community feed
- View the feed of shared responses by clicking "Show Feed"
- Like responses that resonate with you
- See responses update in real-time as others share and like content
- Access the metrics dashboard by clicking the chart icon in the bottom-left corner
- View statistics on total generated and shared responses
- See the most popular (liked) responses
A Docker Compose configuration is provided for easy deployment:
docker-compose up -dThis will start the Next.js application and set up the necessary database.
To add new oracle personalities, edit the presets in src/lib/presets.ts:
export const PRESETS: Preset[] = [
// Add your new preset here
{
id: 'your-preset-id',
name: 'Your Preset Name',
description: 'Description of this oracle style',
systemPrompt: 'System prompt that controls the oracle behavior',
}
];To add support for more languages, edit the languages in src/lib/languages.ts:
export const LANGUAGES: Language[] = [
// Add your new language here
{
id: 'language-code',
name: 'Language Name',
nativeName: 'Native Language Name',
}
];/src/app: Next.js App Router pages and API routes/src/components: React components including UI elements/src/lib: Utility functions, types, and configuration/prisma: Database schema and migrations
The application uses Socket.io for real-time communication, allowing users to see new responses and likes as they happen across all connected clients.
The application uses Prisma with SQLite for data persistence. The main models include:
SharedResponse: Stores shared oracle responsesLike: Tracks likes on responses