-
Notifications
You must be signed in to change notification settings - Fork 71
Developing and Contributing
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.
If you want to contribute, you can provide a pull request with your changes. We run Github actions to perform some basic Unit tests.
All contributions are very welcome, but in general these are the tasks that need the most attention:
- 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.
- Documentation: The documentation is almost non-existent so far and we would appreciated your feedback and contributions.
- 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.
- 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.
To work with the source code you need the following tools.
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.
Just execute the following commands to get a MongoDB installation for development:
git clone https://github.com/notifo-io/notifo
cd notifo/dependencies
docker-compose up -d
- NodeJS (>= 10.0)
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.
You can use any editor you want, but our recommendation is to use:
- Visual Studio 2019 Community Editionfor the backend.
- Visual Studio 2022 Community Edition for the backend.
-
Visual Studio Code for the frontend with the following plugins installed:
- ESLint
- [Styleling(https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint)
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.
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.
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:
-
npm test
(Runs the unit tests and listens for changes) -
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.
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:
- Recommended: Ensure that you run the
notifo
project, which means that you use the integrated Kestrel web server, which starts faster than IIS Express. - 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.