Uploadr is a simple file storage server. It is a part of completed code challenge
This has been tested on the following platforms
- Mac OSX 10.12 64-bit running python 2.7
The default login information is:
Username: atrium
Password: atrium
- The client will sometimes send a junk request after an upload attempt
- The message for no files found is sometimes incorrect
- File names will lose special characters on upload
- Initial gate authentication
- File list, upload, download and delete
- File upload progress bar
- File search using name and contents
- File type detection
- File description save and edit
- Scan for new files on startup
- Python 2.7
- Virtualenv
- MongoDB running on system
- Textract dependencies, please see https://textract.readthedocs.io/en/stable/installation.html
git clone https://github.com/lantelyes/uploadr.git
cd uploadr
virtualenv env
source env/bin/activate
pip install -r requirements.txt
python server.py
The custom API provides the following endpoints
/file
Query String Arguments | Description |
---|---|
file | File name |
Query String Arguments | Description |
---|---|
oid | ObjectId string of file to delete |
Body | Desription |
---|---|
file | File JSON object containing description and oid |
/list
Query String Arguments | Description |
---|---|
query | File name or content query for search |
type | Type of search to perform, options are 'name', and 'content' |
ext | Extentions of files to include in search, options are 'pdf', and 'doc', and 'docx' |
/upload
Data | Description |
---|---|
file | file to save |
In order to make Uploadr a production ready application the following steps would need to be completed:
- User data and API key would be encrypted and stored in a database rather than the code itself
- Unit tests would be written to test application functionality
- A Continuous Integration system would need to be implemented
- The client and backend would ideally be split into their own repositories and ran independently from each other
- Deployment procedures would need to be created
- The efficiency of file searching would need to be improved
- Migrate to Bootstrap 3.x, as 4.0 is still in beta
I had a lot of fun completing this challenge! There were a few things I could have done better in hindsight. First I should have spent more time designing my solution before getting into the code, second I could have organized my commits in a more consistent manner, and finally I could have used branches in git when adding functionality.
There were also some things I didn't get to implement due to time constraints that I wish I could have, they are:
- Login page
- Multiple users
- File list pagination and sorting based different properties on name/date etc
- More polish and cleanup of the UI and CSS
- More robust error handling for both the client and backend
- More robust database query building methods
- Full folder synchronization with server directory and database, not just new files, deleted ones also
- Server directory poller to check for new/deleted files
- Implement maximum file size and user storage check
- Use more Angular specfic libraries, such as angular-ui-bootstrap