Code Monkey home page Code Monkey logo

cdn's Introduction

CDN

This is my own personal CDN written in GO and Svelte using DigitalOceans Spaces.

Credits

Anthony's repository as I would have been lost with DigitalOcean, Firebase and other things without it: https://github.com/acollierr17/cdn

Building

This uses Make to make it easier to build the frontend and backend into a folder.
You are not required to use Make if that's what you prefer, simply execute commands in the build rule.

Client

Build the frontend using yarn build inside of the client folder, it'll output the built files into public/build

Server

Golang by default builds to the current operating system, if you would like to build for Windows or Linux then you need to set the GOOS environment variable (check GOOS examples).
You can find more information about this here: https://www.digitalocean.com/community/tutorials/building-go-applications-for-different-operating-systems-and-architectures

Then build the executable using go build, by default it'll output in the current directory, if you want it elsewhere you'll need to use the -o option with a directory.

GOOS Examples

Unix:

GOOS=linux

Windows PowerShell:

$env:GOOS = "linux"

Firebase, DigitalOcean and server configuration

To connect to a Firebase App you will need the authentication file service-account.json in the current directory.
For DigitalOcean Spaces you will need to add the necessary info that start with SPACES in the .env file, which should also be in the current directory.

More explanation of the rest of the environment variables:

CDN_ENDPOINT is your site endpoint, such as https://cdn.mysite.com
AUTHORIZATION is the main authorization token, this should be kept as anyone will be able to upload and delete files through the site.

Todo

  • Server routes

    • Files
      • Upload
      • Delete
      • Retrieve
    • Folders
      • Create
      • Edit
      • Retrieve
      • Delete
    • Get user info such as amount of files, total size
    • Live socket
  • Dashboard

    • View and manage files
      • Upload directly
      • Delete files
      • View files?
    • View and manage folders
      • Create folders
      • Edit folders, add/remove files
      • Retrieve folders and their files
      • Delete

Planned things

  • Authentication with firebase auth
    • Multiple users
    • Admin account

cdn's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.