Skip to content

----------Team of four developers, backend Spring Boot application----------⭐⭐⭐If you only have time to check 1 repo, let it be this one! ⭐⭐⭐

Notifications You must be signed in to change notification settings

gerzson-pszota/Tribes

Repository files navigation

486d3894-cf72-490e-bcaf-f16c81e65dab

3b9a9cd5-a21a-4a84-8052-d3c9fab1042d

e774fc77-9426-45a5-bcd3-eab1eedca667

avus-tribes-backend

Dependencies

  • Java Development Kit - JDK 17
  • Spring Boot Data JPA
  • Spring Security
  • Spring Web
  • Flyway
  • Javax Mail
  • Java Dotenv

Development rules:

  • Do not use Lombok
  • Do not define getters/setters which are not explicitly used
  • Make everything configurable (e.g. via values in .env and application.properties), i.e. no constant value should be hard-coded. The database credentials are already pre-configured this way. See MATERIALS#Dotenv
    • For example, all error messages should be stored in /java/main/resources/messages.properties
    • i18n-ed messages will then be in:
      • /java/main/resources/messages_sk.properties
      • /java/main/resources/messages_cz.properties
      • /java/main/resources/messages_hu.properties
  • Place contents into classes according to this order:
    • Final fields
    • Fields
    • Default constructor
    • Constructors with parameters
    • Getters & Setters
    • Public methods
    • Private methods
  • Use Data Transfer Objects (Dto's) for request/response data (e.g. create a dtos package (do not put this package into the models package) and ResponseDto and RequestDto abstract classes.
  • Naming
    • Entities/Models
      • Use camelCase for Java properties and snake_case for the corresponding database column names. For example private String activationToken in the User model should be mapped to the activation_token column in the users table
    • Database:
      • Use plurals for database tables, e.g. users, posts, likes (and singular for the corresponding models names, i.e. User, Post, Like)
      • Use @GeneratedValue(strategy = GenerationType.IDENTITY) for auto-incremented fields
    • Tests: use descriptive (test) method names in snake_case (to improve readability):
      • : can_create_model()
      • : is_empty_is_false_for_receipt_with_items()
      • : can_add_permissions_to_users()
      • Have a look at this article You are naming your tests wrong for details on how to name your tests
    • Endpoints: use all lowercase letters and '-' for spaces
      • : /user/vouchers
      • : /forgot-password
    • Create descriptive branch names, e.g. feature-user-registration
  • All error handling should be done via exceptions (and @ControllerAdvice)
  • Use the object wrapper for primitive types, e.g. Long instead of long
  • Use this keyword only to avoid variable name conflicts
  • Use the code formatting feature in Intellij (CTRL+ALT+L / ⌥⌘L)
  • Have at least 90% test coverage regarding services (unit test) and controllers (integration tests)
  • Use Google Java Style Guide
    • Have a look here on how to configure the google java style guides in IntelliJ
    • Make sure to use braces {} with if, else, for, do and while statements, even when the body is empty or contains only a single statement.

Processes:

  • Push only when all tests and style checks have passed
  • Make sure there are no unresolved conflicts esp. in other than .java files
  • see CONTRIBUTING

Useful links

Contributing:

Commit messages:

Git cheat sheet

https://docs.google.com/spreadsheets/d/1Y6ylJLSbkUqLzn9kN_rQSgDlssRpR-ZFresF46apFWY/edit?usp=sharing

Git Workflow

See CONTRIBUTING

Material Review

See MATERIALS

Game logic parameters

Building time Building cost HP Effect
Level 1 Level n Level 1 Level n Level n Level n
Townhall 5:00 n * 1:00 200 gold n * 200 gold n * 200 can build level n buildings
Farm 1:00 n * 1:00 100 gold n * 100 gold n * 100 +(n * 5) + 5 food / minute
Mine 1:00 n * 1:00 100 gold n * 100 gold n * 100 +(n * 5) + 5 gold / minute
Academy 3:00 n * 1:00 150 gold n * 100 gold n * 150 can build level n troops
Troop 0:30 n * 0:30 25 gold n * 25 gold n * 20 -(n * 5) food / minute
+(n * 10) attack
+(n * 5) defense

About

----------Team of four developers, backend Spring Boot application----------⭐⭐⭐If you only have time to check 1 repo, let it be this one! ⭐⭐⭐

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published