plane icon indicating copy to clipboard operation
plane copied to clipboard

[feature]: Developer Environment Setup Guide

Open Flavsditz opened this issue 1 year ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Summary

A guide that takes every want-to-be contributor through the process of setting up the necessary environment, making a small change (add a console log) and see it running on the browser.

Why should this be worked on?

I would like to contribute to this project. I have previously set up the Docker environment and that works great but after a couple of tries I still can't make the local environment work well along with the Docker deployment of the infrastructure. Creating a docker-build and using this by changing the docker-compose file is a process that takes too long and doesn't allow for much iteration

I believe to allow for the biggest number of contributors one should have a clearly described process. I would be happy to give it a test run and improve the docs, but I would need a base to start from

Flavsditz avatar Jun 26 '23 20:06 Flavsditz

# for windows maybe we should use
# git clone [email protected]:makeplane/plane.git --config core.autocrlf=input
# because docker compose up can be failed with "#!/bin/sh not found" in repalce-env-vars.sh
git clone [email protected]:makeplane/plane.git
cd plane
./setup.sh
docker compose up -d
yarn install
yarn dev

Hi :) Did you have problems with this?

redzumi avatar Jun 27 '23 07:06 redzumi

Hey @redzumi! Unfortunately I did :/ Running yarn dev runs the front-end but it doesn't communicate with the docker environment properly so that all its tries to contact the backend fails and I couldn't even get pass the login page.

Was this suppose to work together with docker? Maybe I have to check configurations there, but in that case I can make it more clear on the documentation

Flavsditz avatar Jun 27 '23 12:06 Flavsditz

@Flavsditz In my case yeah, I run docker compose (docker compose up), that start all backend services (like redis, database, api) and frontend (at http://localhost:80). After that I can run dev server (yarn dev) and my dev frontend will be available (at http://localhost:3000) Maybe you have any errors in docker logs (and backend or database not start)? And api for frontend not available

redzumi avatar Jun 27 '23 12:06 redzumi

It seems it doesn't hit Docker at all... that is why I assumed it wasn't the case.

Looking in console/network of chrome I see a bunch of connection errors:

GET http://localhost:8000/api/users/me/ net::ERR_CONNECTION_REFUSED
POST http://localhost:8000/api/sign-in/ net::ERR_CONNECTION_REFUSED
image

It tries to connect on port 8000, but this is not being exposed on the docker images from the backend... could that be the issue here?

Flavsditz avatar Jun 27 '23 13:06 Flavsditz

Hmm, what if you run this? NEXT_PUBLIC_API_BASE_URL=http://localhost yarn dev

redzumi avatar Jun 27 '23 13:06 redzumi

Indeed that seems to do the trick!!!

I see what you did there, but I think this should be included on the docs. Should I make a MR for it?

Flavsditz avatar Jun 27 '23 13:06 Flavsditz

I don't know how much correct is this, hehe

How we see, trouble is in default value of NEXT_PUBLIC_ API_BASE_URL (http://localhost:8080) Value changes in ./start.sh (replaces default with in run-time value), but its only for docker

And question: should we change this value manualy for yarn dev script? Maybe @aaryan610 have some ideas? Or any guides to local development?

redzumi avatar Jun 27 '23 14:06 redzumi

Sorry for following up late on this issue. We’ve now updated our docs and contribution guidelines extensively. Please open this thread if you are still experiencing any difficulties setting up Plane.

vihar avatar Jun 29 '24 11:06 vihar