Skip to content

PaulChass/pbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A solution to John Crickett's Dropbox Challenge

This repository contains my solution to John Crickett's coding challenge. (https://codingchallenges.fyi/challenges/challenge-dropbox/) The project is divided into two main parts: the backend and the frontend.

Project Overview

Backend

The backend is built with Node.js and Express. It handles API requests, authentication, and database interactions.

Frontend

The frontend is built with React and was bootstrapped with Create React App. It provides a user interface for interacting with the backend services.

Project Structure

Available Scripts

Backend

In the backend directory, you can run:

  • npm start: Starts the backend server.
  • npm test: Runs the backend tests using Jest.
  • node sync.js: Runs the sync script to synchronize local folders with the remote drive.

Frontend

In the frontend directory, you can run:

  • npm start: Runs the app in development mode. Open http://localhost:3000 to view it in your browser.
  • npm test: Launches the test runner in interactive watch mode.
  • npm run build: Builds the app for production to the build folder.
  • npm run eject: Ejects the Create React App configuration.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Additional Documentation

Dependencies

Backend

  • archiver
  • bcryptjs
  • body-parser
  • cors
  • dotenv
  • express
  • jsonwebtoken
  • mime
  • mime-types
  • mysql2
  • sequelize

Frontend

  • mime
  • react-device-detect

How to Run

  1. Clone the repository.
  2. Navigate to the backend directory and run npm install.
  3. Navigate to the frontend directory and run npm install.
  4. Start the backend server by running npm start in the backend directory.
  5. Start the frontend server by running npm start in the frontend directory.
  6. To sync the local folder with the remote drive:
    • Set up the config.js file in the backend directory. This file should include the necessary configuration such as apiBaseUrl, authToken, defaultFolderId, and email.
    • Create a SyncFolder on the drive
    • Run node sync.js in the backend directory or run the service as a background process using pm2 start sync.js### Example config.js for Sync Function
module.exports = {
  apiBaseUrl: 'https://api.example.com',//Your api url
  authToken: 'your-auth-token',//Same as token in authMiddleware
  defaultFolderId: 'your-default-folder-id',//SyncFolder folderid
  email: 'your-email@example.com',// The email of the user who owns SyncFolder
  localFolder: 'D:\\SyncFolder', // The local folder you want to synchronize
}

Contact

For any questions or feedback, please contact Paul Chasseuil at chasseuilpaul@gmail.com.

About

Dropbox type app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published