A powerful full-stack application that leverages AI to analyze legal documents through the Cerebras API, providing intelligent insights and document management capabilities.
- 🔐 Secure user authentication with Supabase
- 📄 Document upload and management system
- 🤖 AI-powered legal document analysis
- 🔄 Real-time status updates
- 🎨 Modern and responsive UI
- 🔍 Advanced document search capabilities
- Node.js 18+ or Bun
- Supabase account
- Cerebras API access
- Clone the repository:
git clone https://github.com/yourusername/synapse.git
cd synapse- Install dependencies:
bun install- Create a
.env.localfile in the root directory with the following variables:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your-supabase-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
# Cerebras API Configuration (server-only)
CEREBRAS_API_KEY=your-cerebras-api-key
# Site URL (for auth redirects)
NEXT_PUBLIC_SITE_URL=http://localhost:3000- Set up your Supabase database with the following tables:
-- Documents table
create table documents (
id uuid default uuid_generate_v4() primary key,
created_at timestamp with time zone default timezone('utc'::text, now()) not null,
user_id uuid references auth.users not null,
title text not null,
content text not null,
status text not null default 'pending'
);
-- Analysis table
create table analysis (
id uuid default uuid_generate_v4() primary key,
created_at timestamp with time zone default timezone('utc'::text, now()) not null,
document_id uuid references documents not null,
user_id uuid references auth.users not null,
analysis jsonb not null,
status text not null default 'pending'
);
-- Set up Row Level Security (RLS)
alter table documents enable row level security;
alter table analysis enable row level security;
-- Create policies
create policy "Users can view their own documents"
on documents for select
using (auth.uid() = user_id);
create policy "Users can insert their own documents"
on documents for insert
with check (auth.uid() = user_id);
create policy "Users can view their own analysis"
on analysis for select
using (auth.uid() = user_id);
create policy "Users can insert their own analysis"
on analysis for insert
with check (auth.uid() = user_id);- Start the development server:
bun run dev- Open http://localhost:3000 in your browser.
- Build the application:
bun run build- Start the production server:
bun run startWe welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by Cheree team
