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

My friend cannot join the same game with me #4

Open
Kesb1 opened this issue Jul 27, 2022 · 7 comments
Open

My friend cannot join the same game with me #4

Kesb1 opened this issue Jul 27, 2022 · 7 comments

Comments

@Kesb1
Copy link

Kesb1 commented Jul 27, 2022

My friend cannot join the same game with me, I cannot click start.

@Arp-G
Copy link
Owner

Arp-G commented Sep 19, 2022

Could you please explain a bit, what errors your friends get when they try to join?
A screenshot of the error would also help.

You should first create a game and then share the invite link with your friend.

@pcapazzi
Copy link

Hi. Trying to get this to run. Started a clean linode instance of ubuntu 22.04 LTS. Ran an apt update and apt upgrade and rebooted. Installed docker and docker-compose. Added my ID and assigned myself to the docker group. Cloned the github and executed the job. Took a little while but it's running. From the front end when I try to create a game it says something went wrong with creating a user session. I've tried this on both a laptop and my phone with the same results.

Seriously... looks great at the start... hoping to get this working. Thanks!

@Arp-G
Copy link
Owner

Arp-G commented Oct 14, 2022

Hi @pcapazzi thanks for trying out the project, I will try to help you to get it running.

From the error, it seems the front end is not able to talk to the backend server properly.

The steps given in the README file are actually for running the app locally, to run it on a server environment we need to do some additional stuff.

When you hit docker-compose up the app runs two servers a backend phoenix web server at port 4000 and a front-end react js server at port 3000. Make sure you expose both these ports on your Linode instance.

Next, it requires a few environment variables to run properly

  • Go to the file pictionary-app/src/helpers/api.js
    and replace the lines

    export const SITE_URL = process.env.REACT_APP_SITE_URL || 'http://localhost:4000';
    export const HOST_URL = process.env.REACT_APP_HOST_URL || 'http://localhost:3000';
    

    with your Linode server URLs, for example, if your server domain name is 'abc.com'

    export const SITE_URL = https://abc.com:4000;
    export const HOST_URL = https://abc.com:3000;
    
  • Go to the file lib/pictionary_web/endpoint.ex and on line 51 make sure you add your servers domain name to the list, for example
    origins: ["http://localhost:3000", "http://localhost:5000", https://abc.com:3000]

  • After this try running docker-compose down && docker-compose build --no-cache && docker-compose up

This is not the most ideal way of doing it, but it should get you running, we can hop on a call if you face issues and need further assistance regarding this.

@pcapazzi
Copy link

pcapazzi commented Oct 14, 2022 via email

@pcapazzi
Copy link

pcapazzi commented Oct 14, 2022 via email

@pcapazzi
Copy link

pcapazzi commented Oct 14, 2022 via email

@Arp-G
Copy link
Owner

Arp-G commented Oct 15, 2022

Glad to know it worked for you.

How long did it take you to put this together?

It took me 3 months to build it from scratch(backend + frontend), and I only worked on it on weekends. It was a side project, mainly to explore interesting stuff in elixir and revise React js and in the process build something fun.

How many packages are involved?

The backend is pretty lean, not many dependencies

On the frontend, I have used a few external packages but not too many (around 20)


The changes you made to the ports on docker compose makes sense to me, if that works for you go ahead with it.

The docker and docker-compose files I added were actually meant for running locally and starting the server in development mode. Using this docker setup for productions should be fine for small-scale usage, I will try to come up with a proper deployment setup for production and an updated readme for this project when I get some time.

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

No branches or pull requests

3 participants