Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤔 Development environment without a raspberry pi? #53

Open
johnrlive opened this issue Nov 25, 2017 · 3 comments
Open

🤔 Development environment without a raspberry pi? #53

johnrlive opened this issue Nov 25, 2017 · 3 comments

Comments

@johnrlive
Copy link

Is there a way to test code locally on Mac with docker? (Without a raspberry pi?)

@StreakyCobra
Copy link
Owner

Hi John,

Thanks for your interest in raposfly :-)

Yes it is possible, and also even without docker because it would not be really practical for developing otherwise! I'll document this as soon as I get some free time, but I put a short note on how it can be achieved bellow.

I don't know if you plan to contribute to this project, but there are a few things that I should fix before starting to accept contributions. We may want to set up a service or a business around this project in the future, so better to define these things clearly from the beginning, better safe than sorry :-)

  • Discuss with the friend who started up the idea what license we really want (for now I put GPL3 randomly, as I'm the only one who worked on this project I can still change it easily).

  • Define a CLA for avoiding IP issues and make re-licensing possible if needed.

  • Write a CONTRIBUTING.md explaining how to contribute, and also what contributors should expect from me. For instance I really agree with Jeff Geerling's post on why he closes PR, excerpt:

      I don't cater to everyone. I usually cater to myself. And for 98% of my
      OSS projects, I'm actually using them, live, in production (often for
      dozens or hundreds of projects). So I'm generally happy with them as
      they are. I will not add something that increases my maintenance burden
      unless it's very compelling functionality or an obvious bugfix. I can't
      maintain a system I don't fully understand, so I like keeping things
      lighter and cutting off edge cases rather than adding technical debt I
      don't have time to pay off.
    

    But at people takes time to write PR, I prefer to be explicit about this kind of behaviour beforhand.


Notes on how to try it locally (not verified though):

  • With docker:

    • Remove all armhf/ in the Dockerfiles, so that FROM armrf/python:3.5 become FROM python:3.5 for instance.
    • Make raposfly.shop to point to localhost. On linux it may be done with raposfly.shop 127.0.0.1 in /etc/hosts, dunno about mac though.
    • Run the project with docker-compose up and wait.
    • Go to http://raposfly.shop
  • Without docker:

    • Open a terminal:
      • cd services/backend
      • python -m venv venv
      • source ./venv/bin/activate
      • pip install -r requirements.txt
      • python manage.py migrate
      • python manage.py collectsuperuser
      • python manage.py runserver
    • Open anothe terminal:
      • cd services/frontend
      • npm install
      • npm run dev
    • Last command should have open the interface in your browser, otherwise try manually http://localhost:8080/

@sah-anshu
Copy link

I am facing this error! pl help

node:7524) UnhandledPromiseRejectionWarning: Error: Exited with code 3
at ChildProcess.cp.once.code (/home/raposfly/services/frontend/node_modules/opn/index.js:84:13)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:557:12)
(node:7524) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7524) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not hadled will terminate the Node.js process with a non-zero exit code.

@StreakyCobra
Copy link
Owner

@sah-anshu

First, your error is totally unrelated to this issue. Please open a new one for new problems.

Second, I don't have any context at all of what you are doing (running on raspberry pi or computer? Running through docker or not? How did you started the services? What were you doing when getting this error? etc…)

So no, sorry, I'm not able/going to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants