DocuBox is a cloud file storing app built using Kotlin, Nodejs and MongoDb.

Overview

DocuBox

DocuBox is an app where you can securely upload your files on the cloud – from family pictures and audio recordings to spreadsheets, presentations and other confidential documents. All the files uploaded by the users are stored in an encrypted format.

This project is developed by Team 404 for Hashnode x Linode hackathon. This team comprises of Ishant and Vaibhav.

Blog ✍️

To know more about how we built this project, read my article here:
https://ishantchauhan.hashnode.dev/docubox-securely-store-access-and-share-your-files-on-cloud

About

DocuBox is an open source cloud file storing app. One can upload their files, view them on cloud or download them and also share them with their friends and colleagues. All the files uploaded by the users are stored in an encrypted format.

Here is a short video on DocuBox

Application Install

You can install the latest version of DocuBox app from the link given below 👇

DocuBox

App Features

  • User Authentication - Supports email based authentication
  • File Uploading - You can upload your files on DocuBox and access it from anywhere around the world.
  • File Encryption - Files stored on DocuBox are stored in encrypted format, so your privacy remains protected.
  • File Sharing - You can share the access of your files with other users.
  • File Management - You can create multiple folders to organize your files in the way you want.
  • File Download - You can download your files and save them locally for offline usage.
  • File Search - Enhanced file searching which can give results quickly.

Technical details

  • The frontend of DocuBox is an android app which is written using Kotlin. It follows MVVM architecture, SOLID and MAD principles, and other best practices for clean and scalable code.

  • The backend of DocuBox is built using the power of Nodejs, Expressjs and MongoDb! It follows MVC architecture, DRY code principles and uses EJS as a templating engine. Currently, the backend part is deployed on Linode, which is a popular cloud service provider platform for deploying your backend and database!

📸 Screenshots

Setup [Android App]

For this, you can refer to the Android Repository of DocuBox to setup the android part of DocuBox

Setup [Backend]

To setup the backend of this project, you will need a cloud hosting service provider like Linode, Digital Ocean or Amazon Web Services. Once you get the account, you need to configure a server where your backend will run on. For this project, I have used an ubuntu server however, you can go with any server you are comfortable with. Once you are done with this, follow the following steps to setup the backend of this project!

  1. Install the following tools on your server: nodejs, npm, git, ufw, mongodb

  2. Configure the object storage provided by your hosting provider.

  3. Open the http and https port on your server using ufw

  4. Clone this repository and navigate to the root folder

  5. Create a file named ".env" and there, write:

MONGO_URL=mongodb://127.0.0.1:27017/docubox
PORT=XXXX
JWT_SECRET=XXXXXXXX
STORAGE_ACCESS_KEY=XXXXXXXX
STORAGE_SECRET_KEY=XXXXXXXX
STORAGE_BUCKET=XXXXXXXX
STORAGE_REGION=XXXXXXXX
STORAGE_URL=XXXXXXXX
ENCRYPTION_KEY=XXXXXXXX
SIGNATURE_KEY=XXXXXXXX
  • Here, MONGO_URL is the url where your mongodb service will run on. Since we will be running it on the server itself and our nodejs server will communicate using it, we have assigned the localhost url to the MONGO_URL variable

  • Assign any value to the PORT. It is the port on which your nodejs server will run on

  • JWT_SECRET is the secret variable that will be used to encrypt the user passwords. You can assign it with any value you want

  • STORAGE_ACCESS_KEY, STORAGE_SECRET_KEY, STORAGE_BUCKET, STORAGE_REGION and STORAGE_URL are the variables that refer to the object storage of your hosting. An object storage is the place where the actual files of the users will get stored. You can easily get their values by refering to your hosting provider's manual

  • ENCRYPTION_KEY will be used to encrypt the files of the user. You can use a base 64 generator and assign it with any 32 bytes base64 value

  • SIGNATURE_KEY will be used to sign the encryption key. In encryption, a signature is a proof that the user has the private key which matches with some public key. You can use a base 64 generator and assign it with any 64 bytes base64 value

  1. Now, you need to somehow enable the your linux server to listen to the http/https requests and transfer them to your nodejs server's port. You can use a reverse proxy or any tool like nginx or apache to do so. However, for testing, you can simply open your nodejs port publically using ufw and make requests to that port!

  2. Install all the required packages to run the nodejs backend by writing "npm install" command in the root folder

  3. Finally start the nodejs backend server using "npm start" command

Built With [Backend] 🛠

  • Linode - Linode is a popular cloud hosting service provider where you can deploy your backend
  • NodeJS - NodeJS is something that allows you to write javascript code on a server! Traditionally, javascript was only available for frontend design purpose however, with NodeJS, you can use javascript for backend purpose too!
  • ExpressJS - ExpressJS is a framework that drastically reduces the amount of backend code we write in NodeJS. It is highly flexible and makes things a lot easier!
  • MongoDB - MongoDB is a NoSQL Database that unlike SQL, stores data in form of collections!
  • AWS SDk - A software development kit provided by amazon web services, it lets you easily access and manipulate the data stored in your cloud's object storage
  • Multer - A middleware for handling multipart/form-data, which is primarily used for uploading files
  • BCryptJS - This is an NPM package that lets you encrypt the passwords before you store them on the server
  • Mongoose Encryption - A library that encrypts all the data that is stored in mongodb

Architecture [Backend]

The backend of DocuBox uses MVC (Model View Controller) architecture.

Package Structure [Backend] 📂

docubox                 # Root Directory
.
├── backend             # Contains all the nodejs server code
|   ├── config          # Contains configuration files for jwt token generation, mongoose and multer
|   ├── controllers     # Contains files with functions that will get executed on specified routes
│   ├── middlewares     # Contains functions that will be executed before a particular controller, helps in authorization and error handling
│   ├── models          # Contains files which define the schema or database structure of a particular collection in mongodb
│   ├── routes          # Defines the API endpoints and the controller function to be called on them
│   ├── util            # Contains utility files for file management
│   ├── views           # Contains EJS files which will be shown when a user tries to open an image, video or audio file in the app
│   └── server.js       # The main nodejs server file which binds everything together and starts the server
|
└── package.json        # Contains list of all the libraries / modules required to run the nodejs server

Database Schemas

User Schema

File Schema

Folder Schema

Available APIs [Backend] 💻

The backend of DocuBox provides many different APIs to perform different operations such as file upload, create folder, share folder, view file etc. All the available APIs and their corresponding controllers can be found inside the routes folder.

Attribution

The project is deployed on Linode for the Hashnode X Linode Hackathon.

Contact

For any queries, you can mail me at [email protected]

You might also like...

Mongo Strict is a TypeScript based smart MongoDB ORM, It makes the usage of MongoDB safer, easier and faster with a better performance...

mongo-strict mongo-strict is compatible with mongo = 5 Mongo Strict is a TypeScript-based smart MongoDB ORM, It makes the usage of MongoDB safer, eas

Sep 22, 2022

A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM deffiniation and appropriate file structure.

Welcome to function-stencil 👋 A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM

Jun 20, 2022

Minty is an example of how to mint non-fungible tokens (NFTs) while storing the associated data on IPFS

Minty is an example of how to mint non-fungible tokens (NFTs) while storing the associated data on IPFS. You can also use Minty to pin your data on an IPFS pinning service such as nft.storage and Pinata.

Nov 12, 2022

🌸 API for storing anime picture collection in Discord server

🌸 API for storing anime picture collection in Discord server

Waifuseum Waifuseum (Museum Waifu) is a simple REST API for storing and managing anime picture collection. This project use combinaton of ExpressJS, D

Jul 24, 2022

🌸 API for storing anime picture collection in Discord server

🌸 API for storing anime picture collection in Discord server

Waifuseum Waifuseum (Museum Waifu) is a simple REST API for storing and managing anime picture collection. This project use combinaton of ExpressJS, D

Jun 28, 2022

Serve file server with single zip file as file system in Deno.

zipland Serve file server with one-single zip file in Deno. Support zip just zip32 with deflated or uncompressed serving plaintext deflate Examples Yo

Nov 2, 2022

Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

Hacktoberfest Indonesia Apa Itu Hacktoberfest ? Hacktoberfest adalah acara tahunan yang bertujuan untuk mendorong berkontribusi kedalam ekosistem open

Dec 15, 2022

Nodejs,Expreess,Mongodb,Reactjs,Redux,Java app,Google,Docker,Heroku,...

Nodejs,Expreess,Mongodb,Reactjs,Redux,Java app,Google,Docker,Heroku,...

Tiến độ công việc Team: https://docs.google.com/spreadsheets/d/1BBv4CXNniNjqdIE7tjrG9UM4nprd3NSVy2FX9oaWq0Q/edit#gid=0 Web Online: https://movienetfli

Sep 17, 2022

API Bate Papo UOL - A backend application developed using NodeJS and mongoDB

BatePapoUOL BackEnd My first backend project! Building an API to the most used brazillian chat app ages ago - Bate Papo UOL! Table of Contents Overvie

Apr 13, 2022
Owner
Ishant Chauhan
I love solving real world problems using my programming skills!
Ishant Chauhan
A simple app that helps a user monitor daily activities by adding, storing and deleting activities.Built with HTML,CSS and JavaScript

To-do-list A simple list app that allows a user to add and remove tasks. Built With HTML CSS JS Webpack Live Demo Click To-do-list to see the page. Ge

Catherine K 7 Apr 8, 2022
Advanced Web3 file storing and sharing application.

Storz Winner of Decentralized Storage Infrastructure & Community Choice Award of Web3 Infinity Hackathon 2022 organized by Protocol Labs, Filecoin Fou

Anom Chakravorty 99 Dec 30, 2022
An obsidian plugin that allows code blocks executed interactively in sandbox like jupyter notebooks. Supported language rust、kotlin、python、Javascript、TypeScript etc.

Obsidian Code Emitter This plugin allows code blocks executed interactively like jupyter notebooks. Currently, support languages: Rust Kotlin JavaScri

YiiSh 38 Dec 28, 2022
Source code of kotlin course (UK, RU) for beginners.

Kotlin Course Kotlin course for beginners (UK, RU). Site available at course.y9vad9.com. News & Updates If you want to receive updates and news about

Vadim Yaroschuk 15 Jan 6, 2023
A developer directory built on Next.js and MongoDB Atlas, deployed on Vercel with the Vercel + MongoDB integration.

MongoDB Starter – Developer Directory A developer directory built on Next.js and MongoDB Atlas, deployed on Vercel with the Vercel + MongoDB integrati

Vercel 246 Dec 20, 2022
fully selfhosted multi-user web app for externally storing Reddit items (saved, created, upvoted, downvoted, hidden) to bypass Reddit's 1000-item listing limits

expanse fully selfhosted multi-user web app for externally storing Reddit items (saved, created, upvoted, downvoted, hidden) to bypass Reddit's 1000-i

J Chan 216 Dec 30, 2022
This is a full-stack exercise tracker web application built using the MERN (MongoDB, ExpressJS, ReactJS, NodeJS) stack. You can easily track your exercises with this Full-Stack Web Application.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

WMouton 2 Dec 25, 2021
Awesome Books project : An online Book Library. Storing book information using local storage and displaying it as a list on HTML page

This is project is my based on building an online Book Library. Storing book information using local storage and displaying it as a list on html page

Richard Chileya 7 Nov 11, 2022
A peroidic-table api built with Nodejs & Mongodb to help make frontend requests dealing with chemistry...

A peroidic-table api for frontend apps Usage Example (GET all elements) // GET /api/elements const ajio = require("ajio") ajio.baseUrl("https://apis-

John Daniels 3 May 24, 2022
Analysing and storing r/Place 2022 event

Caching r/Place 2022 This project is live at place.thatguyalex.com. Running scraper locally Install Python and all dependencies from scraper.py import

Alex Tsernoh 157 Dec 16, 2022