Developing
An Introduction on Setting Up Your Development Environment (this step is required if you want to contribute to Squidex or write customized extensions for it)
You can find the source code on GitHub: https://github.com/squidex/squidex
Required Tools
To work with the source code you need the following tools.
Docker
We recommend using Docker on your developer machine, it makes life much easier!
Note, we weren't able to run newer versions of Docker on Windows 10 Home. If you don't have a Windows 10 PRO license, we recommend not wasting your money. Get a cheap build server for a few bucks per month instead, or just install MongoDB manually. It only takes around 15 minutes to install.
For the Backend
.NET 5 SDK (for version <= 6.1)
.NET Core 2.2 SDK or .NET Core 3.0 SDK (for older versions of Squidex)
Optionally: RabbitMQ
Optionally: EventStore
Setup
You'll find ready to use Docker configurations for development at https://github.com/squidex/squidex-docker.
Execute the following commands to get a MongoDB installation for development.
For the Frontend
NodeJS (>= 10.0)
Usually, newer versions are better, but the newer versions of NodeJS are renowned for consuming a lot of memory during a build or when running Webpack Dev Server.
IDEs and Editors
You can use any editor you want, but our recommendation is to use:
Visual Studio 2022 Community Edition OR Visual Studio 2019 Community Edition for the backend.
Visual Studio Code for the frontend with the following plugins installed:
How to Run Squidex
To run Squidex, you must run both frontend and backend independently. This might feel redundant and annoying at first (we also had to use some code to run the the Webpack Dev Server automatically when the application started), but it only takes a minute for the Webpack Dev Server to begin. We have decoupled the commands so you can keep the Webpack Dev Server running, even when you have to restart the backend application.
Before you start, ensure that the certificates for the test environment are installed. They can be found under /dev
in the Squidex folder.
Frontend
The frontend is written with Angular and webpack. Therefore you have to run the webpack web dev server. It's a server application that builds the website and watches the file system. Whenever you make a change to a file, the server runs the build process and reloads the website automatically. It only tries to compile the files that have changed and in some cases, can even reload the style sheets without reloading the site.
How to run the Webpack Dev Server?
Installing the dependencies is only needed once or when the project.json
file has changed.
Optionally:
npm rebuild node-sass --force
(Only if you have issues with node-sass)npm test
(Runs the unit tests and listens for changes)npm run test:coverage
(Runs the unit tests and calculates the test coverage).
As the name Webpack Dev Server indicates, it's only used for development. For production we bundle and minimise all typescript, html and sass files and add the bundles to the deployment package. During development, the frontend downloads hundreds of files, this is a completely normal process.
Backend
Ensure that the ASPNETCORE_ENVIRONMENT
environment variable is set to Development
, either through the launchSettings.json
file or through your IDE's settings.
Open https://localhost:5001 to run Squidex.
You can also run and debug the backend with Visual Studio 2019. Here are some recommended steps you should undertake before starting your debug session:
Ensure that you run the
Squidex
project, which means that you use the integrated Kestrel web server (this begins faster than IIS Express).Uncheck the
Launch browser
setting. You just want to keep Squidex open during development (and not constantly close and open the window) to make debugging the frontend with your browser easier.
Last updated