A MERN stack project for managing files. This project uses Node.js, Express.js, MongoDB, React, and Vite to provide a simple and efficient way to manage files.
Here are some screenshots of the application:
Before running the project, ensure you have the following installed:
- Node.js (version 16 or above)
- npm or yarn
- MongoDB (local or remote database)
git clone https://github.com/mdalmamunDev/file-management-mern.git
cd file-management-mern-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
-
Create a
.envfile in thebackenddirectory and configure the following environment variables:PORT=3000 MONGO_URI=your_mongodb_connection_string
-
Create the
uploadsdirectory inside thebackendfolder:mkdir uploads
-
Start the backend server:
nodemon index.js
The backend server will run on
http://localhost:3000by default.
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Update the
baseUrlin the global context to match your backend server's URL (e.g.,http://localhost:3000). -
Start the frontend development server:
npm run dev
The frontend server will run on
http://localhost:5173by default.
- Ensure the backend server is running (
http://localhost:3000). - Ensure the frontend server is running (
http://localhost:5173). - Open your browser and navigate to
http://localhost:5173to access the application.
-
Backend:
- Use
nodemonfor automatic server restarts during development. - Ensure MongoDB is running locally or provide a valid remote connection string in the
.envfile.
- Use
-
Frontend:
- The project uses React with Vite for fast development builds.
- Make sure the
baseUrlin the global context matches the backend server's URL.
nodemon index.js: Starts the backend server usingnodemon.
npm run dev: Starts the frontend development server.npm run build: Builds the frontend for production.npm run preview: Previews the production build.





