HeckarNews
HeckarNews copied to clipboard
Idiot's guide for how to run on vercel?
I am dumb but I forked the repo and ran it in vercel and get errors. Can you post a screenshot of what I should put in vercel config? thanks!
waw, thanks for submitting an issue. glad someone actually interest in this.
you can checkout to deployment
branch. there are some config that vercel needs there. the branch that we are going to deploy is this branch not the master branch.
you are not going to deploy all the repo from the root, instead you must deploy this one by one (or use monorepo if possible). so,
for website (the front-end):
-
during importing the project, select the root to be website
-
the environment variable to be set is only for algolia if you set up Algolia already, but that doesnt matter, you can leave it if you want. env variable
-
after you have deploy, set the production branch to deployment then you must redeploy the project (add commit then push or something for vercel so that vercel will redeploy it)
for the rest-api (the server, backend):
-
you can checkout to deployement branch first and change
productionWebsiteUrl
insiderest-api/config.js
to match with your deployed website url previously -
inside
rest-api/index.js
you must update the mongo string URI to match with yours. don't forget to push your changes. -
then you can deploy this as previously, create new project, then set the root to rest-api.
-
for env var, this two is a must. so you must setup your mongodb first to be able to use this.
-
then you can set the production branch to deployment as what we did previously.
after both (front/back-end) has been deployed:
- edit your
PRODUCTION_API_URL
insidewebsite/next.config.js
to match with your backend (api) url that has been deployed recently. Then push that commit to production branch so vercel will re deploy your project again
surely there is big possibilities that you will find problem I guess, as life never run flawlessly :D. lmk.
Oh cool, thanks so much for replying! I spent like 4 hours searching through HN clones and yours was the only one that was actually a clone -- all the others were missing core bits. Thanks so much for putting it up. Going through this tonight.
sure. glad I can be useful for other after 20+ years of having a life. haha
Also please put an eth account on your page if you are happy to do so, when I am rich I can come back round and pay you something, eta 6 months
haha, surely. when I've eth wallet then I'll put that (I don't have any crypto currently :( ). just don't forget to come back when you are rich then i'll setup mine B).
try metamask.io !
@xu9099 I forgot to let you know that I think authentication won't work if you host your front-end and the api on vercel domain since the cross origin will not work.
that's just the limitation by the guy who make internet though. I see currently you able to deploy the front-end but still using my api for the requested data (you still request to forum-api.krehwell.com). that leads to the authentication never work so far for your deployment.
cross origin will work on the same owned domain only.
Also please put an eth account on your page if you are happy to do so, when I am rich I can come back round and pay you something, eta 6 months
I want to do that too, Monero, PayPal can be.
I want to do that too, Monero, PayPal can be.
@s3689 @x9099 my PayPal should be: PayPal.Me/krehwell
ok, i took note
I want to do that too, Monero, PayPal can be.
@s3689 @x9099 my PayPal should be: PayPal.Me/krehwell
treat you to a cup of coffee ☕️, have you received PayPal?
treat you to a cup of coffee ☕️, have you received PayPal?
hey yup, great, thank you stranger of the internet!
treat you to a cup of coffee ☕️, have you received PayPal?
hey yup, great, thank you stranger of the internet!
it's nothing