This is a Multilingual File Manager Application built using Node.js, Express, MySQL, and i18next for internationalization. The application provides user registration, login, and file management functionalities with support for multiple languages.
- User registration and login
- File management: create, read, update, delete files
- Multilingual support using i18next
- Input data extraction from request body, query parameters, and headers
multilingual-file-manager/
├── config/
├── controllers/
│ ├── fileController.js
│ └── userController.js
├── locales/
│ ├── en.json
│ └── fr.json
├── migrations/
│ ├── 20240716232651-create-user.js
│ └── 20240716232652-create-file.js
├── models/
│ ├── index.js
│ ├── user.js
│ └── file.js
├── node_modules/
├── seeders/
├── tests/
│ ├── fileController/
│ │ ├── createFile.test.js
│ │ ├── deleteFile.test.js
│ │ ├── getFileById.test.js
│ │ ├── getFiles.test.js
│ │ └── updateFile.test.js
│ └── userController/
│ ├── login.test.js
│ └── register.test.js
├── .gitignore
├── app.js
├── jest.config.js
├── package.json
├── package-lock.json
├── queue.js
├── routes.js
├── worker.js
└── README.md- Node.js (v14 or later)
- MySQL
-
Clone the repository:
git clone https://github.com/longmaker2/multilingual-file-manager.git cd multilingual-file-manager -
Install dependencies:
npm install
-
Configure MySQL database:
- Create a MySQL database.
- Update the database configuration in the
models/index.jsfile.
-
Initialize i18next localization files:
- Add your localization files in the
localesdirectory.
- Add your localization files in the
-
Start the server:
node app.js
-
The server will run on http://localhost:3000.
-
Register a User:
POST /api/users/register
Request Body:
{ "username": "testuser", "email": "testuser@example.com", "password": "password123" } -
Login a User:
POST /api/users/login
Request Body:
{ "email": "testuser@example.com", "password": "password123" }
-
Create a File:
POST /api/files
Request Body:
{ "userId": 1, "name": "testfile.txt", "size": 1024, "type": "txt", "path": "/files/testfile.txt" } -
Get All Files:
GET /api/files
-
Get a File by ID:
GET /api/files/:id
-
Update a File:
PUT /api/files/:id
Request Body:
{ "name": "updatedfile.txt", "size": 2048, "type": "txt", "path": "/files/updatedfile.txt" } -
Delete a File:
DELETE /api/files/:id
-
Run the tests:
npm testor
npm test -- --detectOpenHandles