Thank you for considering contributing to Memory Map! We welcome contributions of all kinds, including bug fixes, feature implementations, documentation improvements, and more. This guide will help you get started.
If you encounter a bug or have a question, please open an issue with the following details:
- A clear and descriptive title
- Steps to reproduce the issue
- Expected vs. actual behavior
- Screenshots or logs, if applicable
We’re always looking for ways to improve Memory Map! If you have an idea for a new feature:
- Check the existing issues to see if it’s already being discussed.
- If not, open a new issue and describe:
- The problem your feature solves
- How it would work
- Any alternatives you’ve considered
- Fork the repository and clone your fork.
- Create a new branch for your changes:
git checkout -b feature/your-feature-name
- Make your changes and commit them.
- Push your branch to your fork:
git push origin feature/your-feature-name
- Open a pull request (PR) to the
mainbranch of the original repository.
Make sure you have the following installed:
- Node.js (v20+)
- npm (v8+)
- MongoDB (local or Atlas)
- TypeScript (already included in
devDependencies)
-
Clone the repository:
git clone https://github.com/Open-Source-Chandigarh/memory-map.git cd memory-map/backend -
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.envfile in themaindirectory:PORT=8080 MONGO_URI_PASS=your_mongo_password
- Create a
-
Start the development server:
npm run dev
-
Access the API at
http://localhost:8080.
Here’s an overview of the backend structure:
backend/
├── src/
│ ├── main.ts # Entry point
│ ├── server.ts # Express server setup
│ ├── config/ # Configuration files (e.g., database)
│ ├── controllers/ # Route controllers
│ ├── middlewares/ # Custom middleware
│ ├── models/ # Mongoose schemas and types
│ ├── routes/ # API route definitions
│ ├── setup/ # Initialization scripts
│ ├── utils/ # Utility functions
│ └── uploads/ # Temporary file storage
├── package.json # Project metadata and dependencies
├── tsconfig.json # TypeScript configuration
└── Dockerfile # (Optional) Docker setup
To maintain code quality and consistency, please follow these guidelines:
-
Code Style:
- Use TypeScript for all code.
- Follow the existing code style (e.g., indentation, naming conventions).
- Use
PrettierorESLintfor formatting.
-
Testing:
- Write unit tests for new features or bug fixes.
- Use a testing framework like
Jest(if applicable).
-
Documentation:
- Document your code with clear comments.
- Update the
README.mdor other relevant documentation if your changes affect the project setup or usage.
Use the following format for commit messages:
<type>(<scope>): <subject>
[optional body]
[optional footer(s)]
- feat: A new feature
- fix: A bug fix
- docs: Documentation changes
- style: Code style changes (formatting, no logic changes)
- refactor: Code refactoring (no new features or bug fixes)
- test: Adding or updating tests
- chore: Maintenance tasks (e.g., updating dependencies)
Example:
feat(auth): add JWT authentication to login endpoint
Thank you for contributing to Memory Map! Your help makes this project better for everyone.