/Django-GamerUp

Django rest framework api for gaming forum GamerUp

Primary LanguagePython

About the Project

Welcome to the backend for the GamerUp gaming forum! This project is built using Django Rest Framework and implements JWT token-based authentication. We also offer the ability to register via third-party services.

The project features a well-organized file structure and substantial unit test coverage. The code undergoes rigorous checks using the automated flake8 linter, and the testing and deployment processes are fully automated via GitHub Actions, ensuring continuous integration and delivery (CI/CD).

Additionally, Dockerfile and docker-compose are configured for the project, making it easy to launch and test the application in isolated containers.

The React repo: https://github.com/RedColdHearted/React-GamerUp

Installation and Launch

Requirements

  • Python 3.11+
  • Git

Installation Steps

  1. Clone the repository:
git clone https://github.com/RedColdHearted/Django-GamerUp-api.git
  1. Navigate to the project directory:
cd Django-GamerUp-api
  1. Create a virtual environment:
python3 -m venv venv
  1. Activate the virtual environment:

On Windows:

venv/Scripts/activate

On Linux:

source venv/bin/activate
  1. Install the necessary dependencies:
pip install -r requirements.txt
  1. If using PostgreSQL, specify the secrets in the .env file:
SECRET_KEY='django_secret_key'
# Mode of operation: dev|production
DJANGO_ENV='dev' 

EMAIL_HOST_USER='google_mail_for_sending_emails'
EMAIL_HOST_PASSWORD='application_password'

# For PostgreSQL connection
DB_ENGINE=django.db.backends.postgresql
DB_NAME='db_name'
DB_USER='db_user'
DB_PASSWORD='db_password'
DB_HOST='your_host'
DB_PORT='5432'
  1. Initialize and set up the database:
python manage.py makemigrations accounts; python manage.py makemigrations posts
python manage.py migrate
  1. Launch the application:
python manage.py runserver

Now the application is accessible at http://127.0.0.1:8000/.

CI/CD Configuration

The following tools are used to ensure continuous integration and delivery:

  • GitHub Actions: To automate testing and building.
  • Docker: To containerize the application for easier deployment.
  • Railway: A platform for deploying and hosting the application.

The repository is configured such that on each push to the main branch, tests are automatically triggered along with the linters. If successful, the deployment to Railway is performed.

Support

If you have any questions or suggestions, please create an issue in the Issues Section.