ratneshjain40 / cloud-storage-backend

An express server that provides endpoints for auth and storage to the react-gdrive repo.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Cloud Storage Backend

Backend service for google drive clone built using Azure services by @ratneshjain40



NOTE : Frontend For this app can be found at 👉 @ArnavGuptaaa/google-drive-clone



📌How To Use

To clone and run this application, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/ratneshjain40/cloud-storage-backend

# Go into the repository
$ cd cloud-storage-backend

# Install dependencies
$ npm install

# Run the app
$ npm start

📌Environment Variables

You will need the following environment variables in your .env file

DB_STRING=""
SECRET=""

COSMOSDB_USER =
COSMOSDB_PASSWORD = ""
COSMOSDB_DBNAME = ""
COSMOSDB_HOST= ""
COSMOSDB_PORT=""

AZURE_STORAGE_CONNECTION_STRING=""
AZURE_STORAGE_ACCESS_KEY=""

📌API Endpoints

  • Auth
POST  - /register

Request:
{
    username: 'username',
    email: 'email'
    password: 'password',
}

Response on success:
{
    "success": true,
}
POST - /login

Request:
{
    username: 'username',
    password: 'password',
}

Response on success:
{
    "user": req.user.username,
    "email": req.user.email,
    "success": true,
}
GET - /is-logged

Response on success:
{
    "user": req.user.username,
    "email": req.user.email,
    "success": true,
}
  • Storage Routes
GET - /listBlobs

Response on success:
{
    "success": true,
  "blob_list": blob_list
}
POST - /uploadFile

Request:
{
  "filename": filename,
  "newFile": file
}

Response on success:
{
  "success": true,
  "msg": message
}
POST - /getSASUrl

Request:
{
    "filename": filename
}

Response on success:
{
  "success": true,
  "url": sas_url
}
POST - /setMetaData

Request:
{
    "metadata": metadata
}

Response on success:
{
  "success": true
}
PATCH - /renameBlob

Request:
{
    "filename": filename,
    "metadata": metadata
}

Response on success:
{
  "success": true
}
DELETE - /deleteBlob

Request:
{
    "filename": filename
}

Response on success:
{
  "success": true
}

📌Credits

This software uses the following open source packages:


Made with ❤️ by @ratneshjain40

About

An express server that provides endpoints for auth and storage to the react-gdrive repo.


Languages

Language:JavaScript 100.0%