I’m trying to set up a local development environment for Corteza without using Docker and would appreciate any guidance. Could anyone help me with the following:
Software to Install:
Which essential software (e.g., Go, Node.js, etc.) do I need to install, and what are the recommended versions?
Database Setup:
What database is required, and how should I configure it for a local development setup (e.g., PostgreSQL version, configuration steps)?
Environment Configuration:
What environment variables or configuration files need to be updated/created to run Corteza without Docker?
Build and Run Commands:
What commands do I need to use for building and running Corteza locally?
Are there any make commands or custom scripts that would help streamline the process?
General Development Workflow:
Could you share a basic development workflow for contributing or testing features in Corteza when not using Docker?
Any advice, documentation, or examples would be really helpful! Thanks in advance.
If you have any questions regarding environment variables, please refer to the documentation or the .env.example file.
Server Setup
After configuring the server, run make watch to start it.
Client Setup
To build the Corteza libraries, link them to the web apps, and install the necessary packages, run make dev at the root of the corteza project.
Next, navigate to the web apps’ public directory, create a config.js file, and copy the contents from config.example.js. Then, update window.CortezaAPI to point to your server’s API location.
Once the configuration is complete, run yarn serve on any of the web apps to launch it.
And voila , you have Corteza up and running locally.
Thanks for the detailed response! So far, so good. However, when I start the server, I’m encountering the following errors:
13:06:40.444 ERROR could not preload application index HTML {"error": "open webapp/public/admin/index.html: The system cannot find the path specified."}
13:06:40.445 ERROR could not preload application index HTML {"error": "open webapp/public/compose/index.html: The system cannot find the path specified."}
13:06:40.445 ERROR could not preload application index HTML {"error": "open webapp/public/workflow/index.html: The system cannot find the path specified."}
13:06:40.445 ERROR could not preload application index HTML {"error": "open webapp/public/reporter/index.html: The system cannot find the path specified."}
13:06:40.445 ERROR could not preload application index HTML {"error": "open webapp/public/index.html: The system cannot find the path specified."}
It seems like the application is trying to load the HTML files for the web apps (e.g., admin, compose, workflow, etc.), but it can’t find the necessary files in the webapp/public/ directory.
Do you have any idea how I can fix this? Is there something I might have missed in the setup process for the web apps?
You can ignore that error—it’s relevant only when you’re deploying Corteza.
Is the server running?
To run the web apps locally (admin webapp) for example, navigate to client/web/admin, configure config.js, and then run the admin web app with yarn serve
Thanks for the clarification! I am running the server, but when I run the client, the i18n does not work. Additionally, when I log in to the admin panel, I get a blank page, and I see this error:
WebSocket connection to 'ws://localhost:3000/websocket' failed.
Any idea what might be causing this or how I can fix it?
WebSocket connection failing with Nginx
If the WebSocket connection is failing to establish, you might need to enable Nginx WebSocket proxying.
You can find detailed instructions and further examples in the Nginx documentation.
Inside your nginx.conf file (by default, it is located inside the /etc/nginx directory), add the following lines to the server configuration section;
location /api/websocket {
proxy_pass http://server:80;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}