Simple cloud storage is an aws amplify based vue web app, for hosting files. It uses only the Storage and Authentication modules of amplify backend. This provides basic username/password authentication and file storage and sharing functionality.
This repo contains both frontend and backend code. Front end is Vue.js webapp while backend is AWS Amplify. Front end and backend can be easily built from the code. Following are the requirements for performing the build.
- AWS Account
- Amplify CLI Amplify Docs
- Git Download Git
- Node.js and npm Nodejs
Make a local copy of the repository using git. Run the following command in the terminal
git clone https://github.com/3diab/simplecloudstorage.git
If you want to customize the app/backend the best way is to fork the repsitory and clone that instead.
Initialize the project and install all its dependencies by using following command
npm install
To provision backend we are using the Amplify CLI . Run the follwing command to initialize amplify
amplify init
Next, use amplify push command to provision the resource and build the backend
amplify push
This command also generates necessary configuration files in the project as well. The configuration settings are contained in src/aws-exports.js
. Since our project is in typescript , rename the file as aws-exports.ts
.
You can serve the app locally using npm run serve
or build the distribution files by running npm run build
, this will create the build of the app in the dist
directory.
Run amplify publish
to build and deploy the app on amplify hosting. It will also give the hosted url as the command output. Visit the link to access the web app.
Alternatively you can also self host the build files (contents of the dist folder) on your own server as well. You can host the same app at multiple servers , but will be using same backend.
Amplify allows to manage the backend through a web console. To access it use the follwing command:
amplify console
This will present with two options:
> Amplify Studio
> AWS Console
For adding users to manage the backend, select AWS Console
. This will open aws console for managing amplify settings.
Sign in to the console and select Amplify studio settings.
Press 'Invite Users' button to add new users.
You can also define the access level of the user, in this dialog.
After the user is added rerun the amplify console
command and choose Amplify Console
. Sign into amplify console.
By default each user has 1 GB of storage available. The storage quota is allocated by adding user to special user groups.
In order to create and add users to quotas, first we need to create user groups in the amplify console. Log into amplify console and select User Management
. Select Groups
tab and Create group.
Quota group name has to follow this format:
__storage__[storage size in bytes]
For example:
1 GB Quota - __storage__1024*1024*1024
5 GB Quota - __storage__1024*1024*1024*5
1 TB Quota - __storage__1024*1024*1024*1024
For alloting quota to a user, add the user to specific quota group. For this select the Users
tab in user management and add user to group.
- This is an open file sharing platform, anyone with the files public url can download the file.
- Do not use this to host confidential files