Welcome coder π©βπ»π¨βπ»
For this challenge, you need to develop a backend File Management System. The system should allow users to create, organize, and manage folders and files, where folders can contain other folders or files, and files cannot contain any other items.
We will assess the following:
- Data modeling and relationships
- API design and best practices
- Error handling and validation
- Performance and efficiency
- Innovation in implementation
You are tasked with developing a backend File and Folder Management System that allows users to create and manage folders and files. For every user there will be a root folder that contains all his/her folders and files. Below is a detailed breakdown of the mandatory features and functionality you need to implement.
- Users should be able to create folders that can contain files or other folders.
- Folders can be nested within other folders (hierarchical structure).
- Folder Operations:
- Create a new folder inside an existing folder.
- Rename a folder.
- Delete a folder (and all its sub-folders and files recursively).
- Move a folder to another folder.
- Users should be able to create files within folders.
- Files cannot contain any other items (i.e., no nesting under files).
- File Operations:
- Create a new file inside a folder.
- Rename a file.
- Delete a file.
- Move a file to another folder.
- Provide an API to list all contents of a folder, including sub-folders and files.
Create the following API endpoints for managing files and folders:
-
Folder Operations:
- Create a new folder (inside another folder or in the root folder).
- Rename an existing folder.
- Delete a folder and all its contents (recursive deletion). User cannot delete his root folder.
- Move a folder to another folder.
-
File Operations:
- Create a new file inside a folder.
- Rename an existing file.
- Delete a file.
- Move a file to another folder.
-
Folder Information:
- List all contents (files and folders) of a specified folder.
- Backend Framework: Use a framework like Django, Flask, FastAPI, or Node.js.
- Database: Use a relational database like PostgreSQL, MySQL, or SQLite for storing the folder and file structure.
- Each entry in the system will have:
id
: Unique identifier.name
: The name of the folder or file.type
: Should befolder
orfile
.parent_id
: The ID of the parent folder (or null if itβs a root folder).
- Only folders can act as parents, meaning files cannot be parents.
- Recursive deletion must be implemented for folders (i.e., deleting a folder deletes all sub-items).
- π Search - Implement a search functionality to find files or folders by name within the system.
- Ensure the code is clean and well-organized.
- Commit your code as a public repository on GitHub and share the link with us.
- Include a detailed
README.md
that explains: - Your choice of framework and database. - The architecture of your solution.
- Any improvements or additional features you would implement if you had more time.