Thank you for considering contributing to LegalHuB! Whether you’re fixing a bug, building a new feature, or improving documentation — your support is appreciated.
We aim to make the contribution process smooth and beginner-friendly.
- 📦 Project Overview
- 🛠️ Code of Conduct
- 📌 Prerequisites
- 🧑💻 Local Development Setup
- 🌱 How to Contribute
- 📁 Folder Structure
- 📚 Style Guide
- ✅ Checklist Before Submitting PR
- 📬 Contact
- 🔒 Reporting Security Issues
- 🙏 Thank You
LegalHuB is a full-stack legal platform where users can:
- Understand legal terms with AI
- Access legal rights and articles
- Download state-specific legal forms
- Apply for legal services via official sites
- Use smart search across all legal content
We adhere to the Contributor Covenant.
Please be respectful, constructive, and inclusive in all your interactions.
Before contributing, please ensure you have:
- Node.js (v14 or later)
- MongoDB (local or Atlas)
- Git & GitHub account
- Your own
.envfile (see below)
Click on the top-right "Fork" button on GitHub to create your own copy.
git clone https://github.com/YOUR-USERNAME/LegalHuB.git
cd LegalHuBnpm install- Copy the sample .env file and edit it with your credentials:
cp .env.sample .env- Update the .env file with your MongoDB URI, secret keys, and Mistral API key.
⚙️ Setting Up Mistral API Key
- To enable Mistral AI-powered features in LegalHuB, follow the steps below:
- Go to the Mistral AI Platform and create an account (if you haven't already).
- Navigate to API Keys and generate a new key.
- Add the following entry to your .env file:
MISTRAL_API_KEY=your_mistral_api_key_herenpm start # Production mode
npm run dev # Development mode- The app will be available at: http://localhost:8000
git checkout -b feature/your-feature-name- Use descriptive names like fix/login-redirect, feature/smart-search-improve, etc.
- Add your code in the correct folder under /src
- Follow the existing file structure
- Stick to the project's logic, style, and folder conventions
LegalHuB uses Prettier for code formatting.
- A .prettierrc config is already set
- You can install a Prettier plugin for your editor (recommended: VS Code Prettier Extension)
- Please format your files before committing
- You can manually format files using:
npx prettier --write .- ✨ Tip: No npm run format script is available — use the npx command above.
If you're adding backend features, consider writing or updating test cases in tests/.
Run test suite using:
npm test(You can use Supertest or [Jest] if tests already exist.)
Add modified files to the staging area:
git add .Please write clear and concise commit messages:
git commit -m "fix: resolve login redirect on expired session"
git commit -m "feat: add search across form descriptions"- Use prefixes like:
- feat: → new feature
- fix: → bug fix
- docs: → documentation only changes
- refactor: → code refactoring
- test: → adding or updating tests
Push to your fork:
git push origin feature/your-feature-nameThen:
-
Go to your forked repository on GitHub
-
Click on "Compare & pull request"
-
Add a meaningful title and description
-
Link related issues (e.g., Fixes #14)
-
Submit the PR 🚀
LegalHuB /
__tests__
├── article.test.js
├── document.test.js
├── healthCheck.test.js
├── lawyer.test.js
├── rights.test.js
└── user.test.js
.github
├── ISSUE_TEMPLATE
├── bug_report.yml
├── config.yml
├── documentation_issue.yml
└── feature_request.yml
├── workflows
├── auto-comment-on-issue.yml
├── autocomment-iss-close.yml
├── autocomment-pr-merge.yml
├── autocomment-pr-raise.yml
├── automerge.yml
├── ci_cd.yml
├── close-stale.yml
├── detect-duplicate-issue.yml
└── labeler.yml
├── labeler.yml
└── PULL_REQUEST_TEMPLATE.md
init
├── documents.data.js
├── index.documents.js
├── index.rights.js
└── rights.data.js
src
├── controllers
├── article.controller.js
├── dictionary.controller.js
├── document.controller.js
├── healthCheck.js
├── lawyer.controller.js
├── page.controller.js
├── rights.controller.js
├── search.controller.js
└── user.controller.js
├── db
└── index.js
├── middlewares
├── auth.middleware.js
└── multer.middleware.js
├── models
├── article.model.js
├── document.model.js
├── rights.model.js
└── user.model.js
├── public
├── css
├── login.css
└── style.css
├── js
└── login.js
└── pic
├── 8271787.jpg
├── about_banner.jpg
├── banner.jpg
├── logo.png
├── logo1.png
└── profile.jpg
├── routes
├── article.routes.js
├── dictionary.routes.js
├── document.routes.js
├── healthCheck_route.js
├── lawyer.routes.js
├── page.routes.js
├── rights.routes.js
└── user.routes.js
├── uploads
├── .gitkeep
└── sample.pdf
├── utils
├── apiError.js
├── apiResponse.js
├── asyncHandler.js
└── cloudinary.js
├── views
├── includes
├── flash.ejs
├── footer.ejs
└── navbar.ejs
├── layouts
└── boilerplate.ejs
├── pages
├── about.ejs
├── article-details.ejs
├── article-form.ejs
├── articles.ejs
├── dictionary.ejs
├── documents.ejs
├── down_doc.ejs
├── edit-article.ejs
├── error.ejs
├── fundamental.ejs
├── index.ejs
├── lawyer-profile.ejs
├── lawyers.ejs
├── new.ejs
├── nopage.ejs
├── privacy.ejs
├── right-details.ejs
├── show.ejs
└── terms.ejs
└── users
├── login.ejs
├── profile.ejs
└── updateUser.ejs
├── app.js
├── constants.js
├── index.js
└── readme.md
test
├── globalSetup.js
├── globalTeardown.js
└── jest.setup.js
.env.sample
.gitignore
.prettierignore
.prettierrc
CODE_OF_CONDUCT.md
LEARN.md
LICENSE
package-lock.json
package.json
README.md
-
Use consistent naming (camelCase for variables, PascalCase for components)
-
Follow project conventions and avoid large, unrelated changes in one PR
-
Leave comments for complex logic
Before submitting, make sure:
[ ] Your code compiles without errors
[ ] You’ve formatted your code with Prettier
[ ] You’ve tested your changes (if applicable)
[ ] You’ve added comments where needed
[ ] Your PR is focused and not too large (split into multiple PRs if needed)
We use the following labels to help new contributors:
- good first issue
- enhancement
- bug
- documentation
Feel free to pick one and start! No need to ask before working, but opening an issue before large changes is appreciated.
If you discover a security vulnerability in LegalHuB:
- Please do not open a public issue.
- Instead, email dipexplorerid23@gmail.com with details.
- We’ll review and respond ASAP.
If you're stuck:
- Open a GitHub Discussion
- Create an Issue
- Or email me at dipexplorerid23@gmail.com
Your contributions make LegalHuB better for everyone. Let’s build accessible legal tech together!