/GameBackEndAPI-Template

This is a template that can be used with the UE4 GraphQL Plugin in order to make a near complete backend for your videogame. A few steps are involved in setting this up.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

GameBackEndAPI-Template

This is a template that can be used with the UE4 GraphQL Plugin in order to make a near complete backend for your videogame. A few steps are involved in setting this up. It uses the following stack:

REACT-GRAPHQL/APOLLO-PYTHON/DJANGO-POSTGRESQL

Step 1: Setting up your settings files

On both your settings.py and your settings_dev.py, do the following: A: Generate a secret key for your django app image B: Setup your PostgresSQL Database. If you are using CPanel, you must follow a special format where the servername is part of the name of the postgres database image C: SERVER ONLY Set your static root and media root based on your server name image D: ONLY IF YOU HAVE SETUP SMPT Set up your smtp at GRAPHQL_AUTH and at the end of the settings files image image E: ONLY WHEN LAUNCHING TO PRODUCTION Change the settings file from the default one (settings_dev.py) to the server one (settings.py) image

Step 2: Uploading to your Provider (I use CPanel, steps shows below)

A: Setup your PostgreSQL Database on your server (You can follow any online tutorial but MAKE SURE TO WRITE DOWN the database name, and create an account. Then use those credentials in your settings.py (the server settings file) to make this work. Also check the correct port is used. Without this step the backend won't work! image

B: Upload your files and create a python app in the directory you uploaded. Make sure to copy the CMD command for step 2 image C: Go to your terminal and paste the CMD Command. Then type the following:

  • python manage.py makemigrations
  • python manage.py migrate
  • python manage.py collectstatic
  • python manage.py runserver

This will finish your server setup.

C: Lastly check your url www.*MyURL*.com/graphql/ if it is working, success! If not, ask ChatGPT or google it bro