This project is a command-line interface (CLI) application (written in Java) that mimics some of the core functionalities of Dropbox, allowing users to synchronize files between their local machine and cloud storage (in this particular implementation, Amazon Web Services (AWS) Simple Storage Service (S3)).
- User authentication
- new account:
signup
- login:
login
- logout:
logout
- delete account:
delete_account
- new account:
- File and folder operations
- change current working directory:
cd
- create:
mkdir
- delete:
rm
- list:
ls
- change current working directory:
- Sync files between local machine and cloud storage (
push
,pull
) - Change root directory (
change_root
) - User preferences storage
- Java 17
- Spring Boot 3.1.0
- AWS SDK for Java 1.12.465
- AWS S3 for file storage
- AWS Cognito for user authentication
The project is organized into several packages:
io.github.lwcarani
: Main application packageio.github.lwcarani.cli
: Contains the CLI runnerio.github.lwcarani.config
: AWS configurationio.github.lwcarani.model
: Data modelsio.github.lwcarani.service
: Service interfaces and implementationsio.github.lwcarani.util
: Utility classes
-
Ensure you have Java 17 installed.
-
Clone the repository:
git clone https://github.com/lwcarani/dropbox-clone.git
-
Navigate to the project directory:
cd dropbox-clone
-
Create an
application.properties
file in thesrc/main/resources
directory with the following content:aws.s3.bucket-user-preferences=<your_s3_bucket_name_for_user_preferences> aws.s3.bucket-user-storage=<your_s3_bucket_name_for_user_storage> aws.accessKey=<your_aws_access_key> aws.secretKey=<your_aws_secret_key> aws.region=<your_aws_region> aws.cognito.userPoolId=<your_cognito_user_pool_id> aws.cognito.clientId=<your_cognito_client_id> aws.cognito.clientSecret=<your_cognito_client_secret> spring.main.banner-mode=console logging.level.root=ERROR
Replace the placeholder values with your actual AWS credentials and resource identifiers.
The project uses the following main dependencies:
- Spring Boot Starter Web
- Spring Boot Starter Security
- AWS Java SDK for Amazon Cognito Identity Provider
- AWS Java SDK for Amazon S3
For a full list of dependencies, please refer to the pom.xml
file.
The project uses the Spring Boot Maven plugin for building. The main class is set to io.github.lwcarani.DropboxCloneApplication
.
To build a JAR file in Eclipse IDE using Maven, follow these steps:
- Ensure your project is set up as a Maven project in Eclipse.
- Open the project in Eclipse.
- Right-click on the project in the Package Explorer.
- Navigate to "Run As" > "Maven build..."
- In the "Goals" field, enter "clean package"
- Click "Run"
Maven will then compile your code, run any tests, and package your application into a JAR file. The JAR file will typically be created in the target
directory of your project.
Once you've built a JAR file, you can run the application from the command line, like so:
java -jar target\dropbox-clone-0.0.2.jar
Once the application is running, you can use the following commands:
signup
: Create a new user accountlogin
: Log in to your accountlogout
: Log out of your accountdelete_account
: Permanently delete your accountpush
: Upload all local files and folders to cloud storagepull
: Download all files and folders from cloud to local machinemkdir <folder_name>
: Create a new directorycd <path>
: Change current directoryls <path>
: List contents of current or specified directoryrm <path>
: Delete a directory and its contents (both locally and in cloud)change_root <path>
: Set a new root directory for your Dropbox Clone fileshelp
: Display available commandsexit
: Exit the application
Feedback, bug reports, issues, and pull requests welcome!
Thanks to John Crickett for the idea from his site, Coding Challenges!