Skip to content

Latest commit

 

History

History
149 lines (100 loc) · 3.59 KB

CONTRIBUTING.md

File metadata and controls

149 lines (100 loc) · 3.59 KB

Contributing

Table of Contents

Getting Started

Thank you for your interest in contributing to DevUnity. This guide outlines the process for setting up the project and submitting contributions. DevUnity is primarily written in TypeScript. The backend is built using Node.js and MongoDB. Prettier is used for code formatting.

How to Contribute

Prerequisites

To contribute, ensure you have the following installed:

  • A stable internet connection
  • A text editor (such as VS Code or Neovim)
  • Git
  • Node.js (version 22.5.1 LTS)
  • MongoDB (or MongoDB Atlas)
  • Docker (if applicable)
  • Firebase (if working on authentication-related features)

Node.js and npm

If using nvm (or nvm-windows on Windows), run:

nvm install 22.5.1
nvm use 22.5.1

Alternatively, download and install Node.js from the official website.

Frontend Setup

Setting Up Environment Variables

  1. Duplicate /frontend/.env.example and rename it to .env.

Installation

  1. Navigate to the /frontend directory and install dependencies:

    npm install
  2. Start the frontend locally:

    npm run dev

Optional Configurations

TinyMCE (for room descriptions)

  1. Create a TinyMCE account and obtain an API key.

  2. Approve the domains http://localhost:5173 and https://devunity.netlify.app.

  3. Add the key to /frontend/.env:

    VITE_TINYMCE_API_SECRET=your-api-key

Judge0.ce & RapidAPI (for code execution)

  1. Create a RapidAPI account.

  2. Subscribe to Judge0.ce.

  3. Obtain the required API keys and add them to /frontend/.env:

    VITE_JUDGE_CE_API_KEY=your-api-key
    VITE_JUDGE_CE_HOST=judge0-ce.p.rapidapi.com
    VITE_JUDGE_CE_BASE_URL=https://judge0-ce.p.rapidapi.com

Backend Setup

Setting Up Environment Variables

  1. Duplicate /backend/.env.example and rename it to .env.

  2. Ensure MongoDB is running locally or update MONGO_URI if using MongoDB Atlas.

  3. Generate a JWT_SECRET using:

    openssl rand -base64 32
  4. (Optional) Configure email service in .env:

    [email protected]
    SMTP_PASS=your-app-password
    SMTP_HOST=smtp.example.com
  5. (Optional) Configure Cloudinary for file uploads:

    CLOUDINARY_NAME=your-cloud-name
    CLOUDINARY_API_KEY=your-api-key
    CLOUDINARY_API_SECRET=your-api-secret

Installation

  1. Navigate to /backend and install dependencies:

    npm install
  2. Start the backend locally:

    npm run dev

Standards and Guidelines

Pull Request Naming Guidelines

DevUnity follows Conventional Commits for pull request titles and commit messages. Use the following prefixes:

  • feat: A new feature
  • impr: Improvement to an existing feature
  • fix: A bug fix
  • style: Code formatting changes (e.g., white space, semi-colons)
  • refactor: Code changes that improve readability or structure without changing behavior
  • chore: Other changes that do not fit the above categories

Questions

For any questions, you can:

Thank you for contributing!