Giter VIP home page Giter VIP logo

upload-app's Introduction

Discord OAuth 2.0 Upload App

This is a upload application that allows users to authenticate with their Discord accounts and upload files. The server is built using the Express framework and connects to a MongoDB database.

Warning

This project is unfinished and unpolished, there are bugs, there are missing things, or code that straight up does not work as intended.

Installation To install the server, you will need to have Node.js and a MongoDB server. You can then install the dependencies and start the server by running the following

commands:

npm instal 
node .

Configuration

The server is configured using a config.json file. This file contains the following properties:

{
    "mongoURI":"MONGO_CONNECT_URI",
    "redirectURL":"URL FOR DISCORD REDIRECT (BASE URL)",
    "clientID" : "DISCORD_CLIENT_ID",
    "clientSecret" : "DISCORD_CLIENT_SECRET",
    "secretCookieString": "LONG STRING OF SOMETHING",
    "webhookId":"WEBHOOK_ID",
    "webhookToken": "WEBHOOK_TOKEN"
}

Routes

Note

Most endpoints use 2 headers, X-User-ID & X-API-KEY, along with a body form for files or requests.

The server has the following routes:

  • /login: This route handles user authentication and authorization.
  • /logout: Destroys your current session
  • /callback: Used to auth with discord
  • /admin: This route handles administrative tasks, such as managing users and files.
  • /admin/delete-user: Delete a user, all their data, and their files.
  • /admin/update-storage-limit: Upadate a users storage limit
  • /upload: This route handles file uploads.
  • /info: Spits out all your information when your logged in.
  • /file: Used to view files you have uploaded
  • /files/api: Handles the loading of files like a timeline

Storage

The server stores uploaded files in a uploads directory. The default storage limit is 10GB, you can by default upload 500MB files. You can change the storage limit by updating a user in MongoDB or through the admin panel.

Running the Server

The server will listen on port 3000 by default.

License

This server is licensed under the MIT license.

upload-app's People

Contributors

trixzyy 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.