A modern, full-stack AI roleplay chat platform built with Next.js, allowing users to create, share, and chat with AI characters using varied personas and scenarios.
- Real-time AI Chat: Seamless streaming chat experience with AI characters.
- Multi-Model Support: Integration with OpenRouter to support various LLMs (Claude, GPT, Llama, etc.).
- Character Creation: Detailed character editor with support for:
- Names, Tags, and Avatars
- Personas and Scenarios
- First Messages and Example Dialogues
- Lorebooks: Create and link extensive lorebooks to characters for deeper context.
- Authentication: Secure user authentication (Login/Register) with email verification.
- Community Feed: Discover new characters and lorebooks created by the community.
- Responsive Design: Mobile-first UI tailored for all devices.
- Chat History: Persistent chat history using Prisma ORM.
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Database: PostgreSQL (via Prisma ORM)
- AI Provider: OpenRouter API
- State Management: React Hooks & Context
-
Clone the repository:
git clone https://github.com/JoshuaRVLS/jchatai.space.git cd jchatai.space -
Install dependencies:
pnpm install
-
Environment Variables: Create a
.envfile in the root directory and add the necessary variables (DATABASE_URL, OPENROUTER_API_KEY, AUTH_SECRET, etc.). -
Run the development server:
pnpm dev
Open http://localhost:3000 with your browser to see the result.
POST /api/users/register- Register a new userPOST /api/users/validate- Validate user credentialsPOST /api/send-verification- Send email verificationGET /api/verify-email- Verify email tokenGET /api/users/[userId]- Get user profileGET /api/users/picture/[userId]- Get user avatar
GET /api/characters- List characters (with filtering/sorting)GET /api/characters/[id]- Get character detailsPOST /api/characters- Create a new characterPOST /api/import/chub- Import character/lorebook from Chub.aiPOST /api/ai- Generate AI responseGET /api/suggestions- Get chat suggestions
GET /api/chats- List user chatsGET /api/chats/[id]- Get chat historyPOST /api/messages- Send a messagePOST /api/messages/regenerate- Regenerate last AI response
GET /api/lorebooks- List lorebooksPOST /api/lorebooks- Create lorebookGET /api/lorebooks/[id]- Get lorebook details