Giter VIP home page Giter VIP logo

teledrive's Introduction

img

This is the open source project of Google Drive/OneDrive/iCloud/Dropbox alternative using Telegram API for the free unlimited cloud storage.

img

Motivation

Requirements

  • node ^14
  • psql ^13
  • redis ^5
  • yarn

Getting Started

  • Create Telegram application

  • Create a Telegram bot for forwarding messages from the contact form to your Telegram with BotFather

  • Install Redis

  • Install the PostgreSQL as a database and sync the schema

    yarn server typeorm schema:sync

    or, with dump.sql:

    psql db_name < ./server/src/model/migrations/dump.sql
  • Setup environment variables

    • Server variables

      env required description
      ENV no Hide the logs for production, default: develop
      RPS no Rate limit API per second, default: 20
      TG_API_ID yes Application ID from your Telegram App
      TG_API_HASH yes Application hash from Telegram App
      TG_BOT_TOKEN yes Telegram bot token
      TG_BOT_OWNER_ID yes Chat ID for sending messages to you
      TG_BOT_ERROR_REPORT_ID no Chat ID for sending error, default: TG_BOT_OWNER_ID
      DB_HOST no Database host URI, default: localhost
      DB_NAME yes Database name
      DB_PORT no Database port, default: 5432
      DB_USERNAME yes Database username
      DB_PASSWORD yes Database password
      GITHUB_TOKEN yes GitHub token for getting contributors
      API_JWT_SECRET yes Random string for hashing auth token
      FILES_JWT_SECRET yes Random string for encrypt public files
      PAYPAL_CLIENT_ID yes Client ID for PayPal subscription
      PAYPAL_CLIENT_SECRET yes Client secret for PayPal subscription
      PAYPAL_PLAN_PREMIUM_ID yes Product ID for premium plan
      REDIS_URI no Cache some responses from external services
      UTILS_API_KEY yes Token key for make all servers communicate
    • Web variables

      env required description
      REACT_APP_API_URL no Base URL for the API, default: '' (empty string)

Installation

Docker

  • Define environment variables in ./docker/.env

  • Run

    docker-compose -f docker/docker-compose.yml up -d
  • Open teledrive.localhost in browser

Manual

  • Define environment variables in ./server/.env and ./web/.env

  • Create .npmrc in ~/.npmrc and add your GitHub personal token

    # Copy these lines
    
    //npm.pkg.github.com/:_authToken=yourtoken
    @mgilangjanuar:registry=https://npm.pkg.github.com/
  • Install dependencies

    yarn install
  • Build all

    yarn workspaces run build
  • Run

    # All services will served in server with Express
    yarn server node .
  • Open localhost:4000 (default port: 4000)

Or, if you want to run in the local environment:

  • Build server

    yarn server build -w
  • Run server

    yarn server start
  • Run web

    # Define the REACT_APP_API_URL in web/.env first, then
    yarn web start
    
    # Or, directly define the env
    REACT_APP_API_URL=http://localhost:4000 yarn web start

API Documentation

Run in Postman

How to Contribute

  • Fork and clone this repository
  • Commit your changes
  • Create a pull request to the staging branch

Or, just send us an issue for reporting bugs and/or ask the questions, share your ideas, etc in discussions.

Folder Structure

We using the monorepo structure with yarn workspaces.

.
├── README.md
├── package.json
├── server
│   ├── package.json
│   ├── src
│   │   └── index.ts
│   └── tsconfig.json
├── web
│   ├── package.json
│   ├── public
│   ├── src
│   │   ├── pages
│   │   └── App.tsx
│   ├── tsconfig.json
│   └── yarn.lock
└── yarn.lock

teledrive's People

Contributors

mgilangjanuar avatar aqshola avatar grgp avatar sprabowo avatar prakashdivyy avatar lambdagg 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.