ExcelToMongo is a simple web application designed to convert Excel files into MongoDB databases. This tool is particularly useful for users looking to upload Excel files and assets without the need for extensive database knowledge or developer intervention. This application serves as a proof of concept for a larger project aimed at simplifying database creation from user-uploaded files.
Before you begin, ensure you have met the following requirements:
- Docker and Docker Compose installed on your machine.
- Basic understanding of Docker, MongoDB, and Excel file structures.
To install ExcelToMongo, follow these steps:
- Clone the repo:
git clone [repository URL]
- Navigate to the cloned repository's directory.
To run ExcelToMongo, use the following command:
docker-compose up --buildThis command builds and starts the necessary Docker containers for the application. By default, the application should be accessible on http://localhost:[PORT] (replace [PORT] with the actual port number specified in your Docker configuration).
After starting the application, follow these steps to use ExcelToMongo:
- Access the web interface via your browser.
- Upload an Excel file in xlsx format.
- Specify the desired configurations for database creation (if applicable).
- Click 'Submit' to process the file and create a MongoDB database from its contents.
- The application will provide a confirmation once the database is successfully created.
When a user uploads an Excel file via the /uploadFile endpoint, the backend, it reads the file into a pandas DataFrame, handling any necessary data manipulation. This DataFrame is then directly inserted into a MongoDB database using the async Motor library, with each row in the Excel file becoming a separate document in the created collection.