Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ SimpleDB

GitHub Pages License: AGPL GitHub stars

A lightweight, no-database file archive system hosted on GitHub Pages. SimpleDB provides permanent, publicly accessible URLs for your files with zero configuration.

✨ Features

  • πŸ“ Simple File Hosting - Upload files to /files/ directory and they're instantly available
  • πŸ”— Permanent URLs - Every file gets a clean, permanent URL
  • ⚑ GitHub Pages Powered - No servers, no databases, no maintenance
  • πŸ“Š Live File Listing - Automatically displays first 10 files from your repository
  • πŸ’Ύ Smart Caching - 30-minute cache to minimize API calls
  • πŸ”„ Manual Refresh - Update file list with one click
  • πŸ“± Responsive Design - Works on all devices
  • 🎨 Clean UI - Modern, readable interface
  • β™Ώ Accessible - ARIA labels and semantic HTML

πŸš€ Quick Start

1. Fork/Clone the Repository

git clone https://github.com/dryfish09/SimpleDB.git
cd SimpleDB

2. Add Your Files

Place any files in the files/ directory:

simpledb/
β”œβ”€β”€ index.html
β”œβ”€β”€ README.md
β”œβ”€β”€ _config.yml
└── files/
    β”œβ”€β”€ your-file.pdf
    β”œβ”€β”€ image.jpg
    └── data.csv

3. Commit and Push

git add .
git commit -m "Add files to SimpleDB"
git push origin main

4. Access Your Files

Your files are now available at:

https://dryfish09.github.io/SimpleDB/files/your-file.pdf

πŸ“ File Structure

SimpleDB/
β”œβ”€β”€ index.html          # Main page with file listing
β”œβ”€β”€ README.md           # This documentation
β”œβ”€β”€ _config.yml         # GitHub Pages configuration
β”œβ”€β”€ .nojekyll           # Disables Jekyll processing
└── files/              # Directory for your files
    └── (your files here)

πŸ”— URL Structure

Resource URL
Main Page https://dryfish09.github.io/SimpleDB/
File Access https://dryfish09.github.io/SimpleDB/files/filename.ext
GitHub Repo https://github.com/dryfish09/SimpleDB

πŸ› οΈ How It Works

  1. File Storage: Files are stored in the files/ directory of the GitHub repository
  2. File Listing: Uses GitHub API to fetch and display the first 10 files
  3. Caching: Data is cached in localStorage for 30 minutes to reduce API calls
  4. Direct Access: Files are served directly via GitHub Pages CDN

API Usage

The page makes two GitHub API calls:

  • GET /repos/dryfish09/SimpleDB/contents/files - Lists files
  • GET /repos/dryfish09/SimpleDB/commits?path=files - Gets commit dates

Rate Limits: 60 unauthenticated requests per hour. Caching helps stay within limits.

πŸ“ Adding Files

Option 1: GitHub Web Interface

  1. Navigate to the files/ directory in your repository
  2. Click "Add file" β†’ "Upload files"
  3. Select your files and commit

Option 2: Git Command Line

# Add a file
cp /path/to/your/file.pdf files/
git add files/file.pdf
git commit -m "Add file.pdf"
git push

# Add multiple files
cp *.pdf files/
git add files/
git commit -m "Add multiple files"
git push

Option 3: GitHub CLI

gh repo clone dryfish09/SimpleDB
cd SimpleDB
cp /path/to/file.pdf files/
gh add files/file.pdf
gh commit -m "Add file.pdf"
gh push

βš™οΈ Configuration

_config.yml

title: SimpleDB
description: Lightweight File Archive
baseurl: "/SimpleDB"
url: "https://dryfish09.github.io"

CACHE_DURATION (in index.html)

const CACHE_DURATION = 30 * 60 * 1000; // 30 minutes

Adjust this value to change how long data is cached.

🌐 Live Demo

Visit the live site: https://dryfish09.github.io/SimpleDB/

πŸ”§ Customization

Changing the Owner/Repo

Update these variables in index.html:

const USERNAME = 'dryfish09';  // Your GitHub username
const REPO = 'SimpleDB';       // Your repository name
const FILES_PATH = 'files';    // Directory containing files

Styling

Modify the CSS in the <style> section of index.html to match your branding.

File Icons

Add or modify file icon mappings:

const FILE_ICONS = {
    'pdf': 'πŸ“„',
    'doc': 'πŸ“',
    // Add your own mappings
};

🀝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Setup

# Clone your fork
git clone https://github.com/your-username/SimpleDB.git
cd SimpleDB

# Make changes
# Test locally by opening index.html in a browser
# Or use a local server:
python3 -m http.server 8000
# Visit http://localhost:8000

πŸ“Š Performance

  • First Load: ~500ms (API calls)
  • Cached Load: ~50ms (localStorage)
  • File Size: ~15KB (HTML/CSS/JS)
  • API Calls: 2 per refresh (or 60/hour max)

πŸ”’ Security

  • Files are publicly accessible via their URLs
  • No authentication required (intentional for simplicity)
  • All files are served over HTTPS
  • No data is stored server-side (everything is static)

πŸ“‹ Requirements

  • GitHub account
  • Git (for command-line usage)
  • Web browser (Chrome, Firefox, Safari, Edge)

πŸ› Known Issues

  • Rate Limiting: 60 unauthenticated API requests per hour
    • Mitigation: 30-minute caching
  • Large Files: GitHub has a 100MB file limit
    • Use Git LFS for larger files
  • Special Characters: Some filenames may need URL encoding
    • Handled automatically by the page

🚦 Status

  • βœ… File listing
  • βœ… Direct downloads
  • βœ… Smart caching
  • βœ… Rate limit handling
  • βœ… Responsive design
  • βœ… Accessibility
  • βœ… Error handling
  • βœ… Auto-refresh

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“§ Contact


Made with ❀️ by dryfish09

About

A simple, file-based personal database that has some useful file need to archive.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages