Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LuminescentDev/twinkforsale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒธ twink.forsale

โš ๏ธ DISCLAIMER: This project is mostly AI-generated and represents an exploration of how much functionality can be achieved through AI assistance. It serves as an experiment in AI-driven development rather than a production-ready application.

A cute and modern file hosting service built with Qwik, featuring ShareX integration, Discord authentication, and a kawaii aesthetic. Perfect for sharing screenshots, images, and files with style! (โ—•โ€ฟโ—•)โ™ก

โœจ Features

๐ŸŽจ Core Functionality

  • File Upload & Sharing: Upload images, documents, and other files with automatic short URL generation
  • ShareX Integration: One-click configuration for seamless ShareX uploads
  • Discord Authentication: Secure OAuth login through Discord
  • Custom Domains: Support for custom upload domains and subdomains
  • User Management: Admin approval system with role-based access control

๐Ÿ“Š Analytics & Tracking

  • Detailed Analytics: Track views, downloads, and user statistics
  • Real-time Charts: Beautiful visualizations of upload and view data
  • File Management: Organize and manage your uploads with advanced filtering
  • Storage Monitoring: Track storage usage with configurable limits

๐ŸŽ€ User Experience

  • Multiple Themes: Choose from various cute themes (kawaii, cyberpunk, etc.)
  • Responsive Design: Beautiful UI that works on all devices
  • Embed Customization: Customize Discord embed appearance for your uploads
  • File Expiration: Set expiration dates and view limits for uploads

๐Ÿ”ง Advanced Features

  • API Keys: Generate API keys for programmatic access
  • Batch Operations: Select and manage multiple files at once
  • File Cleanup: Automatic cleanup of expired files
  • Download Tracking: Monitor file download statistics
  • Private Access: Application-only access with admin approval required

๐Ÿš€ Tech Stack

  • Framework: Qwik - Modern web framework
  • Backend: Node.js with Qwik City
  • Database: SQLite with Prisma ORM
  • Authentication: Auth.js with Discord provider
  • Styling: Tailwind CSS with custom themes
  • Deployment: Node.js server adapter
  • File Storage: Local filesystem with configurable upload directory

๐Ÿ“ Project Structure

twinkforsale/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/          # Reusable UI components
โ”‚   โ”œโ”€โ”€ lib/                # Utility functions and stores
โ”‚   โ”œโ”€โ”€ routes/             # Application routes and pages
โ”‚   โ””โ”€โ”€ global.css          # Global styles and theme variables
โ”œโ”€โ”€ prisma/
โ”‚   โ”œโ”€โ”€ schema.prisma       # Database schema
โ”‚   โ””โ”€โ”€ migrations/         # Database migrations
โ”œโ”€โ”€ public/                 # Static assets
โ””โ”€โ”€ uploads/               # User uploaded files (gitignored)

๐Ÿ› ๏ธ Installation & Setup

Prerequisites

  • Node.js 18.17.0+ or 20.3.0+
  • Bun (recommended) or npm/yarn
  • Discord application for OAuth

1. Clone & Install

git clone <repository-url>
cd twinkforsale
bun install

2. Environment Configuration

Create a .env file with the following variables:

# Database
DATABASE_URL="file:./dev.db"

# Authentication
AUTH_SECRET="your-secret-key-here"
DISCORD_CLIENT_ID="your-discord-client-id"
DISCORD_CLIENT_SECRET="your-discord-client-secret"

# Application
BASE_URL="http://localhost:3000"
NODE_ENV="development"

# File Upload Settings
UPLOAD_DIR="./uploads"
MAX_FILE_SIZE="10485760"  # 10MB in bytes
BASE_STORAGE_LIMIT="10737418240"  # 10GB in bytes
ALLOWED_MIME_TYPES="image/png,image/jpeg,image/gif,image/webp,text/plain,application/pdf"

3. Database Setup

bun run prisma:generate
bun run prisma:migrate

4. Development

bun run dev

The application will be available at http://localhost:3000

5. Production Build

bun run build
bun run build.server
bun run deploy

๐ŸŽฎ Usage

For Users

  1. Sign Up: Use Discord OAuth to create an account
  2. Wait for Approval: Admin approval required for new accounts
  3. Generate API Key: Create API keys for ShareX integration
  4. Configure ShareX: Download automatic configuration files
  5. Start Uploading: Share files with cute short URLs!

For Admins

  • Access admin panel at /admin
  • Approve/reject user registrations
  • Manage upload domains
  • Monitor system analytics
  • Perform file cleanup operations

๐Ÿ”ง Configuration

Upload Domains

Configure custom domains in the admin panel to use your own domain for file URLs instead of the default domain.

Themes

Multiple themes available:

  • Kawaii: Pink and cute aesthetic
  • Cyberpunk: Dark tech vibes
  • Pastel: Soft pastel colors
  • Dark: Classic dark theme
  • Light: Clean light theme

Storage Limits

Configure per-user storage limits and file size restrictions through environment variables and admin settings.

๐Ÿ“Š API Endpoints

Upload API

Authentication Required: All uploads require a valid API key.

POST /api/upload
Authorization: Bearer <api-key>
Content-Type: multipart/form-data

file: <file-data>

Response: Returns the twink.forsale URL for proper embed support:

{
  "url": "https://twink.forsale/f/abc123",
  "deletion_url": "https://twink.forsale/delete/xyz789",
  "thumbnail_url": "https://twink.forsale/f/abc123"
}

File Access

GET /f/<shortCode>              # View file with embed
GET /f/<shortCode>?direct=true  # Direct file access
GET /f/<shortCode>?preview=true # Preview mode

๐ŸŽจ AI Development Notes

This project demonstrates extensive use of AI assistance in:

  • Feature Implementation: Complex functionality like analytics and file management
  • UI/UX Design: Responsive design with multiple themes
  • Database Design: Prisma schema with relationships
  • API Development: RESTful endpoints and authentication
  • Error Handling: Comprehensive error management

The AI-assisted development process showcased capabilities in:

  • Understanding complex requirements
  • Implementing modern web standards
  • Creating maintainable, scalable code
  • Integrating multiple technologies seamlessly

๐Ÿšจ Important Notes

  • Private Instance: This is designed as a private/application-only service requiring admin approval
  • Development Focus: Primarily an experiment in AI-driven development
  • Security: Implements proper authentication and authorization
  • Performance: Optimized for small to medium-scale usage

๐Ÿ“ Contributing

While this is primarily an AI development experiment, contributions are welcome! Please note that major changes should maintain the project's experimental nature and cute aesthetic.

๐Ÿ“„ License

This project is for educational and experimental purposes. Please ensure you have proper rights for any code or assets used.


Made with AI assistance and lots of kawaii energy! (๏ฝกโ—•โ€ฟโ—•๏ฝก)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages