Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.
/ Awesome-Files Public archive

Simple app to manage files, built with the MERN stack. Upload, download, search and delete files. Dockerized.

License

Notifications You must be signed in to change notification settings

alexpunct/Awesome-Files

Repository files navigation

Awesome Files

PRs Welcome

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.

Main Features

Frontend

  • List all files and their meta-data
  • Download single file
  • Upload new files and delete existing ones

Backend

  • Stores the files meta-data in a MongoDB database
  • Uploads all files in the /uploads root folder

Other additions

Dev Quickstart

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/

Docker

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

Code structure

Frontend - client

Inside the client/modules folder is most of the functionality:

  • App module contains the wrapper, header and footer
  • File module contains most of the content like the files list, upload widget and search widget

Backend - server

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.

Known issues

  • tests are failing after the changes in the framework
  • styling needed for the notifications and dropzone

License

Awesome Files is released under the MIT License.