Skip to content

Developing and Contributing

Sebastian Stehle edited this page Jan 15, 2022 · 3 revisions

As an Open source tool we like contributions. If you want to help to bring notifo forward, this page gives you an introductions about the required tools and processes.


Contribution

How to contribute?

If you want to contribute, you can provide a pull request with your changes. We run Github actions to perform some basic Unit tests.

What to contribute?

All contributions are very welcome, but in general these are the tasks that need the most attention:

  1. Testing and test automation: A lot of code has been moved from other projects where is has been tested extensively. But most tests have not been copied yet. There are also areas that are not testing with automated tests yet and should be improved. UI and integration tests would be great as well.
  2. Documentation: The documentation is almost non-existent so far and we would appreciated your feedback and contributions.
  3. Integrations: A big part of notifo are the integrations to other provides, e.g. messaging like WhatsApp or email services. It is relatively easy to build new integrations and a valuable improvement.
  4. Storage Providers: So far notifo works with MongoDB only, but for all storage implementations interfaces have been introduced. It would be great to be able to use notifo with other databases such as MySQL, Postgres or SQL Server.

Developing

Required tools

To work with the source code you need the following tools.

Docker

We generally recommend to install Docker on your Developer machine. It makes your live much easier.

Personally I was not able to run the newer docker versions on Windows 10 Home. If you do not have a Windows 10 license, I recommend not to invest the money. Get a cheap build server for a few bucks per month or just install MongoDB manually. It takes only around 15 minutes.

For the backend

Setup

Just execute the following commands to get a MongoDB installation for development:

git clone https:/notifo-io/notifo
cd notifo/dependencies
docker-compose up -d

For the frontend

Usually newer versions are better but we have the experience that newer versions of NodeJS are more memory hungry in some situations. You can also use node through nvm - this will allow to work with multiple versions at the same time.

IDE and editors

You can use any editor you want, but our recommendation is to use:

How to run notifo

You have to run both, frontend and backend, independently. The first time it feels redundant and annoying and we also had some code to run the webpack dev server automatically when the application is started. But you will recognize that it takes a minute for the webpack dev server to start. Therefore we decoupled the commands, so that you can keep the webpack dev server running, even when you have to restart the backend application.

Before you start you should also ensure that the certificates for the test environment are installed. They can be found under /dev in the notifo folder.

Frontend

The frontend is written with react and webpack. Therefore you have to run the webpack web dev server. It is a server application that builds the website and watches the file system. Whenever you make a change to a file, the server will run the build process and reload the website automatically. It tries to compile only the files that have changed and can even reload the style sheets without reloading the site in some cases.

How to run the Webpack Dev Server?

cd frontend # Go to the frontend
npm i # Install all dependencies, only needed the first time
npm start

Installing the dependencies is only needed once or when the project.json file has changed.

Optionally:

  1. npm test (Runs the unit tests and listens for changes)
  2. npm run test:coverage (Runs the unit tests and calculates the test coverage).

Btw: As the name webpack dev server indicates, it is only used for development. For production we bundle and minimize all typescript, html and sass files and add the bundles to the deployment package. So don't be worried when the frontend downloads hundred of files during development.

Backend

cd backend
cd src/notifo
dotnet restore # Install all dependencies
dotnet run

Ensure that the ASPNETCORE_ENVIRONMENT environment variable is set to Development, either through a launchSettings.json or through your IDE's settings.

Open https://localhost:5002 to run notifo.

You can also run and debug the backend with Visual Studio 2019. But here are some things you should do before you start your debug session:

  1. Recommended: Ensure that you run the notifo project, which means that you use the integrated Kestrel web server, which starts faster than IIS Express.
  2. Recommended: Uncheck the Launch browser setting. You just want to keep notifo open during development and not close and open the window all the time to make debugging the frontend with your browser easier.