Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaleabteweld/xlsx-import-backend
https://github.com/kaleabteweld/xlsx-import-backend
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kaleabteweld/xlsx-import-backend
- Owner: kaleabteweld
- Created: 2023-06-09T20:56:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-12T20:15:42.000Z (10 months ago)
- Last Synced: 2024-05-03T07:12:24.299Z (8 months ago)
- Language: TypeScript
- Size: 61.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# xlsx-import-backend
# Backend System for Parsing XLSX to MySQL
## Overview:
The backend system is designed to handle the parsing of XLSX files, extract data from them, and then store that data into a local MySQL database. This system is particularly useful for scenarios where data needs to be regularly imported from XLSX files into a database for further processing or analysis.## Components:
- ### File Upload API Endpoint: The backend provides an API endpoint for clients to upload XLSX files. This endpoint should handle file uploads securely and efficiently.
- ### XLSX Parsing Module: This module is responsible for parsing the uploaded XLSX files and extracting data from them. It may utilize libraries like xlsx in Node.js to parse the XLSX files and extract data.
- ### Data Transformation: Once the data is extracted from the XLSX files, it may need to be transformed or normalized before inserting it into the database. For example, data types may need to be converted, and any necessary validations or cleaning may need to be performed.
- ### Database Interaction: The backend interacts with the local MySQL database to store the parsed data. It establishes connections to the database, creates necessary tables if they don't exist, and inserts the extracted data into the appropriate tables.
## Workflow:
- ### File Upload: Clients upload XLSX files to the backend through the provided API endpoint.
- ### Parsing: The backend receives the uploaded files and triggers the XLSX parsing module to extract data from them.
- ### Data Transformation: The extracted data undergoes any necessary transformation or normalization processes to ensure compatibility with the database schema.
-### Database Interaction: The transformed data is inserted into the MySQL database tables. If any errors occur during the insertion process, appropriate error handling mechanisms are implemented to handle them gracefully.
## Environment Variables
```
DATABASE_URL="mysql://root:userName@localhost:3306/mydb"```
## Run Locally
Clone the project
```bash
git clone https://github.com/kaleabteweld/xlsx-import-backend
```Go to the project directory
```bash
cd xlsx-import-backend
``````
npm install
```
or```
yarn install
```then run [check prisma/migrations]:
```
npx prisma update```
then run:
```
npm run dev
```or
```
yarn dev
```