Giter VIP home page Giter VIP logo

gamelist-backend-v2's Introduction

Game List V2 (Java Spring Backend)

Game List is a social game-tracking app that allows users to easily search, filter, and track their video game collections, enabling them to share their gaming status and interact with others through comments, likes, and following. The V2 frontend made in React.js can be accessed here.


Tech StackDatabase ERDGetting StartedAuthors

Tech Stack

Database ERD

Database ERD

Getting Started

Prerequisites:

  1. Clone the repository
git clone https://github.com/Yzma/gamelist-backend-v2.git
  1. Navigate to the project directory
cd gamelist-backend-v2
  1. Fill out all variables in .env file.
DOCKER_POSTGRES_USER=
DOCKER_POSTGRES_PASSWORD=
DOCKER_POSTGRES_DB_DEV=
DOCKER_POSTGRES_DB_TEST=
DOCKER_POSTGRES_NAME=
  1. Make sure to fill out all 3 application yaml files in src/main/resources: application.yml, application-development.yml, and application-test.yml. Setup database urls that avoid conflicts with other applications. Also fill application.yml file with jwt token secret key.
# src/main/resources/application-dev.yml
spring:
  datasource:
    username: postgres
    password: postgres
    url: jdbc:postgresql://localhost:5332/game_list_dev
    driver-class-name: org.postgresql.Driver
  flyway:
    enabled: true
    baseline-on-migrate: true
  jpa:
    hibernate:
      ddl-auto: update
      naming:
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect
    show-sql: true
    database: postgresql
  sql:
    init:
      mode: never

logging:
  level:
    org.hibernate.sql: DEBUG
    flyway: DEBUG
server:
  port: 8080
# src/main/resources/application-test.yml
application:
  title: GameList
  version: 1.0.0

spring:
  datasource:
    url: jdbc:postgresql://localhost:5333/game_list_test
    username: postgres
    password: postgres
    driver-class-name: org.postgresql.Driver
  jpa:
    hibernate:
      ddl-auto: create-drop
      naming:
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
    properties:
      active: test
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect
    show-sql: true
    database: postgresql
  sql:
    init:
      mode: never
# src/main/resources/application.yml
application:
  title: GameList
  version: 1.0.0

security:
  jwt:
    secret-key: [JWT_SECRET_HERE]
spring:
  profiles:
    active: dev

management:
  endpoints:
    web:
      exposure:
        include: "*"
  1. Fill out the docker-compose.yml file, it should look something like this:
version: '3.8'

services:
  dev_db:
    image: postgres:15-alpine
    ports:
      - "5332:5432"
    environment:
      - POSTGRES_USER=${DOCKER_POSTGRES_USER}
      - POSTGRES_PASSWORD=${DOCKER_POSTGRES_PASSWORD}
      - POSTGRES_DB=${DOCKER_POSTGRES_DB_DEV}

  test_db:
    image: postgres:15-alpine
    ports:
      - "5333:5432"
    environment:
      - POSTGRES_USER=${DOCKER_POSTGRES_USER}
      - POSTGRES_PASSWORD=${DOCKER_POSTGRES_PASSWORD}
      - POSTGRES_DB=${DOCKER_POSTGRES_DB_TEST}
  1. Download Docker Desktop App from the official website: https://www.docker.com/products/docker-desktop/. And run the following command in your terminal
docker-compose up
  1. Now open your favorite IDE and run the application. We used IntelliJ

Authors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.