ResearchConnect is a production-ready, enterprise-grade Full Stack MERN (MongoDB, Express, React, Node) application built from scratch to connect researchers, facilitate collaboration, and streamline academic and scientific research workflows.
Research-Connect/
├── .editorconfig
├── .gitignore
├── LICENSE
├── README.md
├── .vscode/
│ ├── extensions.json
│ └── settings.json
├── Backend/ # Node.js + Express.js + Mongoose
│ ├── .env
│ ├── .env.example
│ ├── package.json
│ └── src/
│ ├── app.js
│ ├── server.js
│ ├── config/
│ │ ├── db.js # MongoDB database client wrapper
│ │ └── env.js # Env validator and exporter
│ ├── controllers/ # Request handlers (MVC)
│ │ └── health.controller.js
│ ├── middleware/ # Security, validation, handlers
│ │ └── errorHandler.js
│ ├── models/ # Mongoose schemas (12 initial collections)
│ │ ├── User.js
│ │ ├── Profile.js
│ │ ├── Publication.js
│ │ ├── Project.js
│ │ ├── Research.js
│ │ ├── Message.js
│ │ ├── Notification.js
│ │ ├── Community.js
│ │ ├── Event.js
│ │ ├── SavedResearch.js
│ │ ├── Follow.js
│ │ └── Collaboration.js
│ ├── routes/ # Express Router mapping (/api/v1)
│ │ ├── index.js
│ │ └── health.routes.js
│ ├── services/ # Business logic layer
│ ├── utils/ # AppError classes & utility scripts
│ │ └── AppError.js
│ ├── validations/ # express-validator schemas
│ └── uploads/ # File storage destination (multer)
│
└── Frontend/ # React.js (Vite) + Tailwind CSS v4
├── .env
├── .env.example
├── .eslintrc.json
├── .prettierrc
├── index.html
├── jsconfig.json # Absolute path alias config (@/*)
├── package.json
├── vite.config.js
└── src/
├── main.jsx # React entry point
├── App.jsx # Routing and Provider root
├── index.css # Tailwind directive configuration
├── assets/ # Static media files
├── components/ # Reusable view components
│ └── common/
│ ├── Button.jsx
│ ├── Card.jsx
│ ├── ErrorBoundary.jsx
│ ├── Input.jsx
│ └── Loading.jsx
├── context/ # React Context Providers (e.g. AuthContext)
├── hooks/ # Custom React hooks (e.g. useAuth)
├── layouts/ # Grid templates (MainLayout, AuthLayout)
│ ├── AuthLayout.jsx
│ └── MainLayout.jsx
├── pages/ # Views / Route destinations
│ ├── Auth/
│ │ ├── Login.jsx
│ │ └── Register.jsx
│ ├── Home/
│ │ └── Home.jsx
│ └── NotFound/
│ └── NotFound.jsx
├── routes/ # Centralized route definitions
│ └── AppRoutes.jsx
├── services/ # API interaction layer (Axios)
│ └── api.js
├── styles/ # Supplemental stylesheets
├── utils/ # Formatting and general utility files
└── constants/ # Constant API links, page URLs
- Node.js (v18.0.0 or higher recommended)
- npm (v9.0.0 or higher recommended)
- MongoDB (Local server or MongoDB Atlas cluster connection string)
Follow these instructions to get the application up and running on your local machine.
git clone <repository-url>
cd Research-Connect- Open a terminal and navigate to the
Backenddirectory:cd Backend - Install dependencies:
npm install
- Set up environment variables:
- Duplicate the
.env.examplefile and name it.env - Fill in your local database connection URI, JWT secret, and port details:
PORT=5000 MONGO_URI=mongodb://localhost:27017/research_connect JWT_SECRET=your_jwt_secret_here_make_it_long CLIENT_URL=http://localhost:5173 NODE_ENV=development
- Duplicate the
- Start the backend server:
- For development (with auto-reload using
nodemon):npm run dev
- For production launch:
npm start
- For development (with auto-reload using
- Open a new terminal and navigate to the
Frontenddirectory:cd ../Frontend - Install dependencies:
npm install
- Set up environment variables:
- Duplicate the
.env.examplefile and name it.env - Configure the target API base URL:
VITE_API_URL=http://localhost:5000/api/v1
- Duplicate the
- Start the Vite development server:
The client application should now be accessible at
npm run dev
http://localhost:5173.
- MVC & Service Decoupling: Controllers handle API routing and HTTP request/response mappings. The Service layer isolates raw business logic from the HTTP requests.
- RESTful API: Standardized JSON responses for consistency and seamless integration:
{ "success": true, "message": "Detailed description of results", "data": {}, "error": null } - Error Handling: A robust global error handler catches and normalizes exceptions (validation issues, MongoDB failures, token expiry) avoiding process crashes.
- Security Headers: Secured via
helmetand standard CORS settings.
- Tailwind CSS v4: Built with
@tailwindcss/viteintegration, completely eliminating verbose configuration scripts. - Path Aliasing: Enables absolute imports using
@/*mapping directly tosrc/*, avoiding brittle relative paths (../../../components). - Client routing: Controlled via
react-router-domwith layout wrappers. - Error Boundaries: Uses React Error Boundary components to contain runtime failures without breaking the entire client experience.
To keep the development workflow structured and clean:
main: Production-ready branch. Direct commits are restricted.development: Main integration branch where tested features are combined.frontend: Feature development branch specifically for the UI.backend: Feature development branch specifically for servers and schemas.