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.
The backend is built with Node.js and Express. It handles API requests, authentication, and database interactions.
The frontend is built with React and was bootstrapped with Create React App. It provides a user interface for interacting with the backend services.
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.
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 thebuildfolder.npm run eject: Ejects the Create React App configuration.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
- Code Splitting
- Analyzing the Bundle Size
- Making a Progressive Web App
- Advanced Configuration
- Deployment
- [Troubleshooting
npm run buildfails to minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
archiverbcryptjsbody-parsercorsdotenvexpressjsonwebtokenmimemime-typesmysql2sequelize
mimereact-device-detect
- Clone the repository.
- Navigate to the
backenddirectory and runnpm install. - Navigate to the
frontenddirectory and runnpm install. - Start the backend server by running
npm startin thebackenddirectory. - Start the frontend server by running
npm startin thefrontenddirectory. - To sync the local folder with the remote drive:
- Set up the
config.jsfile in thebackenddirectory. This file should include the necessary configuration such asapiBaseUrl,authToken,defaultFolderId, andemail. - Create a SyncFolder on the drive
- Run
node sync.jsin thebackenddirectory or run the service as a background process usingpm2 start sync.js### Exampleconfig.jsfor Sync Function
- Set up the
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
}For any questions or feedback, please contact Paul Chasseuil at chasseuilpaul@gmail.com.