Awesome Files is a simple application built using MERN Starter that allows uploading, downloading and deleting files from a server. It can be used as boilerplate for a bigger app or as it is.
- List all files and their meta-data
- Download single file
- Upload new files and delete existing ones
- Stores the files meta-data in a MongoDB database
- Uploads all files in the
/uploads
root folder
- React Dropzone Component for file uploads
- CSRF protection
Note : Please make sure your MongoDB is running. For MongoDB installation guide see this. Also npm6
is required to install dependencies properly.
Or with Docker: docker run --name db -p 27017:27017 mongo:latest
npm install
npm start
Now you are ready to go, the front-end application should be accessible at http://0.0.0.0:8000/
There are docker configurations for both development and production.
To run docker for development:
docker-compose build # re-run after changing dependencies
docker-compose up
or, if you want to override the web port:
WEB_PORT=<your_custom_port> docker-compose up
To run docker for production:
docker-compose -f docker-compose-production.yml up --build
To reset the database:
docker-compose down --volumes
Inside the client/modules
folder is most of the functionality:
App
module contains the wrapper, header and footerFile
module contains most of the content like the files list, upload widget and search widget
In the server
folder, the code is following the MERN convention:
- models - contain the schema for MongoDB
- routes - contains the API routes with the upload middleware
- controllers - here are all the methods for interacting with the Mongodb database: CRUD file meta data
Also in the server.js
file is where tha application is setup and most middlewares are added.
- tests are failing after the changes in the framework
- styling needed for the notifications and dropzone
Awesome Files is released under the MIT License.