Google Drive Clone built for an assignment for Twospoon.ai
- Implemented
Google OAuth
for user authentication. - Securely manage user sessions.
- Users can to Upload, View and Download files.
- Implemented RESTful APIs for file operations.
- Used
MongoDB
to store metadata about the files (e.g., filename, file path, user). - Containarized both the
client
andserver
by addingDockerfiles
and.dockerignore
files and incorporatedMulti-Stage Builds
to reduce the Image size.
-
Node.js
for running server-side/client-side JavaScript. -
MongoDB Atlas
to store data about user and file. -
A
Firebase
account with firebase config details for the storage which will be used to store the user files. -
Google OAuth
Client-Id and Client-Secret for google oauth.
We need to setup firebase storage which will be used for storing the files
- Create a project on Firebase and chose name
- Select
Storage
and configerRules
- Make a folder 'files/'
We need to setup mongodb atlas which will be used for storing User
and File
information.
- Regsiter and create a project on MongoDB Atlas
- Name the project and chose your provider, location for your cluster.
- Go to
Database Access
and click onconnect
to get theconnection string or MongoURI
for thedriver
nodejs - Go to
Network Access
and select allow from anywhere
User
model stores details regarding to the user and the files belonging to that userFile
model stores details regarding to the file
- Install nodejs
- Create a mongodb atlas account and get your MONGODB URI
- Create a Firebase account and configer for storage.
- Clone this repository and install the required packages using npm.
git clone https://github.com/AMS003010/Bunker.git
cd server
npm install
cd client
npm install
- Create a .env file in the backend directory and add your MONGODB_URI and also a SECRET to hash your passwords.
PORT = 8000
REMOTE = http://localhost:3000
GOOGLE_CLIENT_ID =
GOOGLE_CLIENT_SECRET =
DATABASE=<MONGODB_URI>
DATABASE_PASSWORD=<PASSWORD>
JWT_SECRET=
JWT_TIMEOUT=90d
JWT_COOKIE_EXPIRES_IN=7776000000
- Make a
firebase.js
file inside theclient/src
folder and add your firebase config details.
import { initializeApp } from "firebase/app";
import { getStorage } from "firebase/storage";
const firebaseConfig = {
<config details>
};
const app = initializeApp(firebaseConfig);
export const storage = getStorage(app);
- From the root directory, run
cd server
npm start
- Open another terminal and run
cd client
npm start
- Then go to localhost:3000.
- Node.js - Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
- express - Fast, unopinionated, minimalist web framework for Node.js
- MongoDB Atlas - The cloud database for modern applications
- Mongoose - Elegant MongoDB object modeling for Node.js
- React - The library for web and native user interfaces
- Tailwind CSS - This node-module helps to rapidly build modern websites without ever leaving your HTML.
- Firebase Storage