Flink is a modern, secure, and responsive web application for sharing files and text snippets with others using simple 6-digit sharing codes. Built with cutting-edge technologies, Flink provides a seamless experience for uploading, sharing, and managing your files and texts with enterprise-grade security features.

| Category | Technology | Version | Purpose |
|---|---|---|---|
| Frontend | React | 18.3.1 | UI Framework |
| Language | TypeScript | 5.5.3 | Type Safety |
| Styling | Tailwind CSS | 3.4.0 | Utility-first CSS |
| Build Tool | Vite | 5.4.2 | Fast Development & Build |
| Backend | Supabase | Latest | Database, Auth, Storage |
| Routing | React Router | 6.22.3 | Client-side Routing |
| Animations | Framer Motion | 11.0.8 | Smooth Animations |
| Rich Text | React Quill | 2.0.0 | WYSIWYG Editor |
| Icons | Lucide React | 0.344.0 | Modern Icons |
flink/
βββ public/ # Static assets
βββ src/
β βββ components/ # Reusable UI components
β β βββ Auth/ # Authentication components
β β βββ Dashboard/ # Dashboard-specific components
β β βββ Layout/ # Layout components
β βββ contexts/ # React Context providers
β β βββ AuthContext.tsx # Authentication state management
β β βββ ShareContext.tsx # Share data management
β βββ lib/ # Utility libraries
β β βββ supabase.ts # Supabase client configuration
β β βββ database.types.ts # TypeScript database types
β βββ pages/ # Page components
β β βββ HomePage.tsx # Landing page
β β βββ LoginPage.tsx # User login
β β βββ RegisterPage.tsx # User registration
β β βββ DashboardPage.tsx # User dashboard
β β βββ AccessPage.tsx # Content access page
β β βββ ShareTextPage.tsx # Full-page text editor
β βββ App.tsx # Main application component
β βββ main.tsx # Application entry point
β βββ index.css # Global styles
βββ supabase/
β βββ migrations/ # Database migration files
βββ package.json # Dependencies and scripts
βββ tailwind.config.js # Tailwind CSS configuration
βββ vite.config.ts # Vite configuration
βββ README.md # This file
shares TableThe core table that stores all shared files and text content:
CREATE TABLE shares (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
user_id uuid REFERENCES auth.users(id) ON DELETE CASCADE NOT NULL,
type text NOT NULL CHECK (type IN ('file', 'text')),
name text NOT NULL,
title text,
content text NOT NULL,
file_type text,
file_size bigint,
access_code text NOT NULL UNIQUE,
has_password boolean DEFAULT false,
password_hash text,
expires_at timestamptz,
created_at timestamptz DEFAULT now(),
download_count integer DEFAULT 0,
file_path text
);
| Field | Type | Description |
|---|---|---|
id |
UUID | Primary key, auto-generated |
user_id |
UUID | Foreign key to auth.users |
type |
TEXT | Either βfileβ or βtextβ |
name |
TEXT | Original filename or text title |
title |
TEXT | Custom title (optional) |
content |
TEXT | File URL or rich text content |
file_type |
TEXT | MIME type for files |
file_size |
BIGINT | File size in bytes |
access_code |
TEXT | 6-digit unique access code |
has_password |
BOOLEAN | Password protection flag |
password_hash |
TEXT | SHA256 hashed password |
expires_at |
TIMESTAMPTZ | Expiration date (null = never) |
created_at |
TIMESTAMPTZ | Creation timestamp |
download_count |
INTEGER | Access/download counter |
file_path |
TEXT | Storage path for files |
interface ShareItem {
id: string;
userId: string;
type: 'file' | 'text';
name: string;
title?: string;
content: string;
fileType?: string;
size?: number;
accessCode: string;
hasPassword: boolean;
password?: string;
expiresAt: string;
createdAt: string;
downloadCount: number;
filePath?: string;
}
git clone https://github.com/SANIDHYADASH/flink.git
cd flink
npm install
# or
yarn install
cp .env.example .env
Update .env with your Supabase credentials:
VITE_SUPABASE_URL=your-supabase-url
VITE_SUPABASE_ANON_KEY=your-supabase-anon-key
Run database migrations
Execute the following SQL files in your Supabase SQL editor:
supabase/migrations/20250608144710_navy_feather.sqlsupabase/migrations/20250608144719_crimson_scene.sqlnpm run dev
# or
yarn dev
Open your browser
Navigate to http://localhost:5173
/access or use the βAccess Contentβ link| Variable | Description | Required |
|---|---|---|
VITE_SUPABASE_URL |
Your Supabase project URL | Yes |
VITE_SUPABASE_ANON_KEY |
Your Supabase anonymous key | Yes |
The application uses a custom Tailwind configuration with:
sharesnpm run build
# or
yarn build
dist folder to NetlifyEnsure your production environment has:
| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm run lint |
Run ESLint |
git checkout -b feature/amazing-feature
git commit -m 'Add amazing feature'
git push origin feature/amazing-feature
createTextShare(text, name, expiresInDays, password?)Creates a new text share with rich formatting.
Parameters:
text (string): Rich HTML contentname (string): Share titleexpiresInDays (number): Expiration in days (-1 for never)password (string, optional): Protection passwordReturns: Promise<ShareItem>
createFileShare(file, expiresInDays, password?, title?)Creates a new file share with upload to storage.
Parameters:
file (File): File object to uploadexpiresInDays (number): Expiration in days (-1 for never)password (string, optional): Protection passwordtitle (string, optional): Custom titleReturns: Promise<ShareItem>
getShareByCode(code)Retrieves a share by its access code.
Parameters:
code (string): 6-digit access codeReturns: Promise<ShareItem | null>
updateShare(id, updatedData)Updates an existing share.
Parameters:
id (string): Share IDupdatedData (PartialReturns: Promise<ShareItem>
deleteShare(id)Deletes a share and associated files.
Parameters:
id (string): Share IDReturns: Promise<void>
Error: Missing Supabase environment variables
Solution: Ensure .env file has correct VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY
Error: Failed to upload file
Solutions:
Error: Invalid code or content has expired
Solutions:
Error: Quill editor not loading
Solutions:
Enable debug logging by adding to your .env:
VITE_DEBUG=true
We welcome contributions from the community! Hereβs how you can help:
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Flink
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Website β’ Documentation β’ GitHub β’
**β Star us on GitHub if you find Flink useful!**