follow these steps & sections in order. simple easy step by step full tutorial

https://hackclub.app/

part 1

  1. follow https://guides.hackclub.app/index.php/Quickstart until you can ssh into your nest account
  2. ssh into your nest account

part 2: set up your repo and code files

  1. clone your project into a new folder folder by doing git clone <https://github.com/link-to-project> ~/projname/ (projname can be any name of ur project)
  2. cd projname to go into that folder (you will work from inside the folder for this whole tutorial)
  3. run npm install to install packages needed

part 3: set up the port and caddy

  1. get an available port via nest get_port. remember this port
  2. edit your code so that it uses the port that you got in the previous step
    1. the easiest way to do this is to use an environment variable to store the port used, but you can also go into server.js manually to change the port used
    2. use nano server.js (or any other file) to edit the file. exit using ctrl+x
  3. create a subdomain for your app by running nest caddy add SUBDOMAIN.USERNAME.hackclub.app --proxy localhost:PORT (replace PORT with the port you got previously, and USERNAME also. you can replace ‘subdomain’ with whatever you want — eg. drawing.orpheus.hackclub.app)
  4. run systemctl --user reload caddy to reload the caddy that u just set up

part 4: set up a service to run your app

so you don’t have to keep the terminal open all the time.

  1. create a new file using nano with nano ~/.config/systemd/user/PROJNAME.service (projname can be whatever you want)
  2. in the file, write this. replace PROJECTNAME in WorkingDirectory with the folder that contains your project & uncomment either ‘node server.js’ or ‘npm start’