Skip to content

Latest commit

 

History

History
113 lines (81 loc) · 6.66 KB

CONTRIBUTING.md

File metadata and controls

113 lines (81 loc) · 6.66 KB

Contributing to Novu

Thank you for showing an interest in contributing to Novu! All kinds of contribution are valuable to us. In this guide we will cover how you can quickly onboard and make your first contribution.

Submitting an issue

Before submitting a new issue, please search the issues and discussion tabs maybe an issue or discussion already exists and might inform you of workarounds, or you can give new information.

While we want to fix all the issues, before fixing a bug we need to be able to reproduce and confirm it. Please provide us with a minimal reproduction scenario using a repository or Gist. Having a live, reproducible scenario gives us the information without asking questions back & forth with additional questions like:

  • 3rd-party libraries and their versions, mainly providers, but not exclusively
  • a use-case that fails

Without said minimal reproduction, we won't be able to investigate all issues, and the issue might not be resolved.

You can open a new issues with this new issue form.

Projects structure and Architecture

The Novu Architecture

https://user-images.githubusercontent.com/8872447/168135722-2643eac4-8fcd-4de6-909b-02118faa1dc8.jpeg To learn more about the novu mental mode visit our documentation site on this link.

Project Structure

Novu uses a monorepo approach to manage our multiple packages and their associated code. https://s3.us-west-2.amazonaws.com/secure.notion-static.com/4245671a-ce3f-47df-93f2-dace8692f899/Mono-repo_Structure_%283%29.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45EIPT3X45%2F20220529%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20220529T121252Z&X-Amz-Expires=86400&X-Amz-Signature=4f9df38e3a3c19bafb8bcb98220cef81fa973d7c3a8fc3cb5311d1a1c2745357&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Mono-repo%2520Structure%2520%283%29.jpg%22&x-id=GetObject Read more about our monorepo structure here.

Run Novu locally

Requirements

  • Node.js version v14.19.3
  • MongoDB
  • Redis
  • (Optional) pnpm v6 - Needed if you want to install new packages
  • (Optional) localstack (required only in S3 related mopdules) Need help installing the requirments? Read more here

Setup the project

After installing the required services on your machine you can clone and setup your forked version of the project.

  • Fork Novu's repository. Clone or download your fork to your local machine.
  • Run initial setup command npm run setup:project to install and build all dependencies
  • Run the project locally using: npm run start

The npm run start will start all of the services in parallel including the API's and web clients. If you only want to run parts of the platform, you can use the following run commands from the root project:

  • start:dev - Synonym to npm run start
  • start:web - Only starts the web management platform
  • start:ws - Only starts the WebSocket service for notification center updates
  • start:widget - Starts the widget wrapper project that hosts the notification center inside an iframe
  • start:api - Run the API in watch mode
  • start:dal - Run the Data Access Layer package in watch mode
  • start:shared - Starts the watch mode for the shared client and API library
  • start:node - Runs the @novu/node package in watch mode
  • start:notification-center - Runs and build the React package for the Novu notification center

Running tests

After making some changes, you can run the tests for the different package using the appropriate CLI commands.

API

To run the api tests you can simply run the following command:

npm run start:e2e:api

The test will run a new instance of Novu against the test db and run the tests against it. The test db will be removed after tests has finished running.

Web

To run the front end tests for the web project using cypress you will need to install localstack in order for all the tests to pass. Run the tests using:

cd apps/web && npm run cypress:run

To open the cypress management windows to debug tests run:

cd apps/web && npm run cypress:open

Testing providers

To run tests against the providers folder you can use the "npm run test:providers" command.

Missing a Feature?

If a feature is missing you can request a new one by submitting an issue to our GitHub Repository. If you would like to implement it, an issue with your proposal must be submitted first, to be sure that we can use it. Please consider:

Coding guides

To ensure consistency throughout the source code, keep these rules in mind as you are working:

  • All features or bug fixes must be tested by one or more specs (unit-tests).
  • We use Eslint default rule guide, with minor changes. An automated formatter is available using prettier.

Need help? Questions and suggestions

Questions, suggestions and thoughts are most welcome. Feel free to open a Github Discussion. We can also be reached in our Discord Channel.

Ways to contribute

  • Try the Novu API and platform and give feedback
  • Add new providers
  • Help with open issues
  • Share your thoughts and suggestions with us
  • Help create tutorials and blog posts
  • Request a feature
  • Report a bug
  • Improve documentation - fix incomplete or missing docs, bad wording, examples or explanations.

Missing a provider?

If you are in need of a provider we do not yet have, you can request a new one by submitting an issue. Or you can build a new one by following our create a provider guide.