It was relatively complicated to get a local dev environment up and running so I was asked to dockerize it. I've updated the README on the repo but the important bits:

  1. Install docker-compose and deps if you don't already have it installed
  2. git clone git@github.com:stackernews/stacker.news.git sn && cd sn
  3. docker-compose up --build

You should then be able to access the site at localhost:3000 and any changes you make will hot reload. If you want to login locally or use lnd you'll need to modify .env.sample appropriately. If you have trouble please open an issue so I can help and update the README for everyone else.

13 sats \ 14 replies \ @g4ala 20 Oct

I'd really like to help with the dev, but I've never codded JS before, mostly because I've never had the need. I've some C experience (not much) and I'm beyond the basics with Python (I'd class myself as reasonably competent). I've also built a website and CMS using PHP, HTML and CSS.

If you think that I'd be able to make a contribution, I'd like to try. Aside from W3Schools (which is one of my 'go-to's), are there any sites that you'd recommend, for learning JS? If you'd prefer to use only experienced coders, just say as much, I'll not be offended: I much prefer honesty, over B.S.

reply
1 sats \ 13 replies \ @k00b OP 20 Oct

It’s hard to tell what your potential is without knowing more about you. But if there’s something you want to do, why not try and see how far you can get? Experience doesn’t matter here - just the quality of the result.

reply
13 sats \ 12 replies \ @g4ala 20 Oct

Cool, thank you. I'll set up a dev machine and get to it.

reply
12 sats \ 11 replies \ @relc 20 Oct

best plan ever setting up a dev machine!

reply
2 sats \ 10 replies \ @g4ala 20 Oct

For sure! Experience has taught me that, least ways.

reply
1 sats \ 9 replies \ @relc 20 Oct

i ran this docker on my live docker vm machine and was like uuups docker space low. so i rememberd my docker ubuntu dev machine a old imac hardware from 2014. 40W but alwas ready to serve.

reply
2 sats \ 8 replies \ @g4ala 21 Oct

I've much to learn, as I've only ever run a local webserver for website dev. Yes, older HW can still be of value (although I've a bunch of 32 bit machines that I feel I need to dump; I just hate doing so). I'll reconfigure my Lenovo E73 (SFF) which I got off of ebay, some time back. It's very nice: Quad Core i5 4th Gen, 16 GB Ram, 500 MB HDD. By today's standards, it's not going to make a splash, but it's more than good enough for my projects.

Any info or tips you have, would be cool.

reply
1 sats \ 7 replies \ @relc 21 Oct

top hardware. long time i went with raspberrys. it was fun to learn gpio and do some python. then stuff always took ages. low capacity bigger projects. i would run 4 vm on your hardware for developing purpose no problem. 32 bit can be used for kids with emmabuntus.org - i have kept all my hardware - somtimes i need spare parts. even old ide cable make a perfect match with arduino projects. yes that needs a lot of space.

reply
2 sats \ 6 replies \ @g4ala 21 Oct

Humm, site just went down - I hope we didn't break it!!

Sorry, now you've lost me; I said I'd much to learn :) "4 vm"?? My VM experience amounts to no more than the Oracle VM VirtualBox running on a Linux Deb based OS. I don't usually bother with a VM, I just fresh install a basic Linux Deb OS and take it from there, adding whatever services I need, for the project in hand.

reply
1 sats \ 5 replies \ @relc 21 Oct

i have two ways to go. your way of course and i run a windows 10 hyperv machine the demo never expires somehow. on the hyperv i spin up linux distros and go from there. i like the easy system snapshot in hyperv. it takes a long time if you mess up a linux bare metal setup to get going again. with the hyperv i can return to the last working snapshot easy. also i like having the 1 core small server possibility to run like very small tasks. i think there are a million ways to have fun.

reply
2 sats \ 4 replies \ @g4ala 21 Oct

Ah, I see what you're driving at. I use the 'Snapshot' feature with OVM, as and when I upgrade MyNode, so that I can roll back if needs be. Good call, ty. I'll set up my dev environment in that way.

reply
12 sats \ 3 replies \ @relc 21 Oct

its all about the snapshots lel

reply
2 sats \ 2 replies \ @g4ala 21 Oct

Btw, have you used Proxmox? Would that be a better option than OVM?

reply
1 sats \ 1 replies \ @relc 21 Oct

I have not tried those. But Proxmox looks worth a try. Active project and kernel based vm. Give it a try its your denvelopment machine. Let me know when tested.

reply
2 sats \ 0 replies \ @g4ala 21 Oct

Yeah, I'll have at it. I did try Proxmox a while back, but it seemed overkill for what I needed at that time, also it seemed to be a steep learning curve, so I reverted to what I know. Thanks for your time and advice. Peace.

reply
12 sats \ 4 replies \ @spraveenitpro 20 Oct

This is great! I am getting the below error, any idea what could be happening:

Direct Link

reply
1 sats \ 1 replies \ @relc 20 Oct

can you try: git clone https://github.com/stackernews/stacker.news.git sn && cd sn

reply
2 sats \ 0 replies \ @k00b OP 21 Oct

Whether it’s http or ssh won’t matter. It’s something with the environment not getting picked up.

reply
1 sats \ 0 replies \ @k00b OP 20 Oct

Can you try enclosing all the bracketed variables in quotes. e.g.

1GITHUB_SECRET="<YOUR GITHUB SECRET>"

and see if that works?

reply
1 sats \ 0 replies \ @k00b OP 20 Oct

Thanks! What OS are you running?

reply
12 sats \ 12 replies \ @relc 20 Oct

i get: Error: Invalid prisma.queryRaw() invocation:

error: Error validating datasource db: the URL must start with the protocol postgresql:// or postgres://. --> schema.prisma:6 | 5 | provider = "postgresql" 6 | url = env("DATABASE_URL") |

Validation Error Count: 1

maybe i need to fix the db path somewhere?

reply
2 sats \ 11 replies \ @k00b OP 20 Oct

You used docker and got this error?

reply
2 sats \ 10 replies \ @relc 20 Oct

on two different ubuntu docker hosts. but most of the time i am the problem. it try getting db connection right.

i ran: git clone https://github.com/stackernews/stacker.news.git sn && cd sn maybe that is the issue.

reply
2 sats \ 9 replies \ @k00b OP 20 Oct

Okay, I'm trying to compose them fresh again and see if maybe something got mangled. But your error suggests, the web app isn't picking up the .env.sample file.

reply
12 sats \ 8 replies \ @relc 20 Oct

cool. i am more a tester. reading up code is fun but takes me a long time. let me know i can debug here. i was in the sn app shell and nano checked the .env.sample it was fine.

5ccxxxxxxx42 sn_app "docker-entrypoint.s…" 18 minutes ago Up 18 minutes 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp app 402xxxxxxxxb9a postgres "docker-entrypoint.s…" 18 minutes ago Up 18 minutes 0.0.0.0:5431->5432/tcp, :::5431->5432/tcp

reply
2 sats \ 7 replies \ @k00b OP 20 Oct

Doing it clean again on Mac worked for me.

Can you change the references of .env.sample in docker-compose.yml to ./.env.sample and tell me if that works? I suspect there's some implementation difference in docker across OS's but it might also be silently failing while parsing the file like @spraveenitpro is experiencing.

reply
12 sats \ 0 replies \ @relc 20 Oct

sorry i only edited one line and missed the db one. still testing

reply
1 sats \ 5 replies \ @relc 20 Oct

i still get the same: ######################## yml ############## nano docker-compose.yml GNU nano 4.8 docker-compose.yml version: "3" services: db: container_name: db image: postgres restart: always expose: - "5432" ports: - "5431:5432" env_file: - ./.env.sample app: container_name: app build: ./ depends_on: - db env_file: - ./.env.sample ports: - "3000:3000" volumes: - ./:/app links: - db

############ end yml ############# ############## compose shell ################ app | npm WARN @babel/plugin-syntax-jsx@7.14.5 requires a peer of @babel/core@^7.0.0-0 but none is installed. You must ins tall peer dependencies yourself. app | npm WARN babel-plugin-inline-react-svg@2.0.1 requires a peer of @babel/core@^7.0.0 but none is installed. You must i nstall peer dependencies yourself. app | npm WARN bootstrap@4.6.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependenci es yourself. app | npm WARN bootstrap@4.6.0 requires a peer of popper.js@^1.16.1 but none is installed. You must install peer dependenc ies yourself. app | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-x64@11.1.2 (node_modules/@next/swc-darwin-x64): app | npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-x64@11.1.2: wanted {"os":"da rwin","arch":"x64"} (current: {"os":"linux","arch":"x64"}) app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: x64 app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64 app | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents): app | npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch": "any"} (current: {"os":"linux","arch":"x64"}) app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64 app | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-arm64@11.1.2 (node_modules/@next/swc-darwin-arm64): app | npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-arm64@11.1.2: wanted {"os":" darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"}) app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: arm64 app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64 app | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-x64-msvc@11.1.2 (node_modules/@next/swc-win32-x64-ms vc): app | npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-x64-msvc@11.1.2: wanted {"os" :"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"}) app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: win32 app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: x64 app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64 app | app | audited 1100 packages in 16.272s app | app | 173 packages are looking for funding app | run npm fund for details app | app | found 11 vulnerabilities (1 low, 4 moderate, 5 high, 1 critical) app | run npm audit fix to fix them, or npm audit for details app | npm verb exit [ 0, true ] app | npm timing npm Completed in 17968ms app | npm info ok app | Prisma schema loaded from prisma/schema.prisma app | Error: Get config: Schema Parsing P1012 app | app | error: Error validating datasource db: the URL must start with the protocol postgresql:// or postgres://. app | --> schema.prisma:6 app | | app | 5 | provider = "postgresql" app | 6 | url = env("DATABASE_URL") app | | app | app | Validation Error Count: 1 app | app | app | > stackernews@0.1.0 dev /app app | > NODE_OPTIONS='--trace-warnings' next dev app | app | ready - started server on 0.0.0.0:3000, url: http://localhost:3000 app | info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5 app | event - compiled successfully app | event - build page: / app | wait - compiling... app | event - compiled successfully app | event - build page: /api/auth/[...nextauth] app | wait - compiling... app | event - build page: /api/auth/[...nextauth] app | prisma:error app | error: Error validating datasource db: the URL must start with the protocol postgresql:// or postgres://. app | --> schema.prisma:6 app | | app | 5 | provider = "postgresql" app | 6 | url = env("DATABASE_URL") app | | app | app | Validation Error Count: 1 app | event - build page: /next/dist/pages/_error app | event - build page: /next/dist/pages/_error app | event - compiled successfully app | wait - compiling... app | error - ApolloError: app | Invalid prisma.queryRaw() invocation: app | app | app | error: Error validating datasource db: the URL must start with the protocol postgresql:// or postgres://. app | --> schema.prisma:6 app | | app | 5 | provider = "postgresql" app | 6 | url = env("DATABASE_URL") app | | app | app | Validation Error Count: 1 app | at new ApolloError (/app/node_modules/@apollo/client/errors/errors.cjs.js:34:28) app | at /app/node_modules/@apollo/client/core/core.cjs.js:1575:47 app | at both (/app/node_modules/@apollo/client/utilities/utilities.cjs.js:981:53) app | at /app/node_modules/@apollo/client/utilities/utilities.cjs.js:974:72 app | at new Promise (<anonymous>) app | at Object.then (/app/node_modules/@apollo/client/utilities/utilities.cjs.js:974:24) app | at Object.next (/app/node_modules/@apollo/client/utilities/utilities.cjs.js:982:49) app | at notifySubscription (/app/node_modules/zen-observable/lib/Observable.js:135:18) app | at onNotify (/app/node_modules/zen-observable/lib/Observable.js:179:3) app | at SubscriptionObserver.next (/app/node_modules/zen-observable/lib/Observable.js:235:7) { app | graphQLErrors: [ app | Error: app | Invalid prisma.queryRaw() invocation: app |

reply
1 sats \ 4 replies \ @relc 21 Oct

I think i need some more packages in package.json i tried adding babel-core but i think i need more?

reply
12 sats \ 3 replies \ @k00b OP 21 Oct

No, those are just warnings. For some reason docker-compose isn't picking up the .env.sample file. You are running docker-compose aren't you?

reply
1 sats \ 2 replies \ @relc 21 Oct

i run: docker-compose up --build i have: ~/sn$ docker version Client: Docker Engine - Community Version: 20.10.9 API version: 1.41 Go version: go1.16.8 Git commit: c2ea9bc Built: Mon Oct 4 16:08:29 2021 OS/Arch: linux/amd64 Context: default Experimental: true

Server: Docker Engine - Community Engine: Version: 20.10.9 API version: 1.41 (minimum version 1.12) Go version: go1.16.8 Git commit: 79ea9d3 Built: Mon Oct 4 16:06:37 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.11 GitCommit: 5b46e404f6b9f661a205e28d59c982d3634148f8 runc: Version: 1.0.2 GitCommit: v1.0.2-0-g52b36a2 docker-init: Version: 0.19.0 GitCommit: de40ad0

~/sn$ docker-compose version docker-compose version 1.25.0, build unknown docker-py version: 4.1.0 CPython version: 3.8.10 OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020

i am using a different command before compose: git clone https://github.com/stackernews/stacker.news.git sn && cd sn because your command gives me:

:~$ git clone git@github.com:stackernews/stacker.news.git sn && cd sn Cloning into 'sn'... The authenticity of host 'github.com (140.82.121.4)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com,140.82.121.4' (RSA) to the list of known hosts. git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

i run several dockers on this machine for tests. with most containers there is a litte hickup here and there but i really like docker for testing now.

reply
2 sats \ 1 replies \ @k00b OP 21 Oct

It’s not obvious to me what’s going wrong.

reply
2 sats \ 0 replies \ @relc 21 Oct

we will fix it no worrys

reply