|
| 1 | +# JavaGameBox |
| 2 | + |
| 3 | +JavaGameBox is a simple game platform that allows users to play classic games. It includes features like user authentication, score tracking, and a leaderboard system. |
| 4 | + |
| 5 | +## Project Structure |
| 6 | + |
| 7 | +The project is organized as follows: |
| 8 | +- `src/main/java/ru/ivannovr`: Contains the main application code. |
| 9 | + - `games`: Logic for individual games. |
| 10 | + - `gui`: Graphical user interface components. |
| 11 | + - `utils`: Utility classes, including database management. |
| 12 | +- `src/main/resources`: Contains resources like icons and configuration files. |
| 13 | +- `pom.xml`: Maven configuration file for dependency management and project building. |
| 14 | + |
| 15 | +## Building the Project |
| 16 | + |
| 17 | +To build the project, you need to have Maven installed. You can download Maven from the [official website](https://maven.apache.org/download.cgi). |
| 18 | + |
| 19 | +Once Maven is installed, navigate to the project root directory and run: |
| 20 | + |
| 21 | +```mvn clean package``` |
| 22 | + |
| 23 | +This command compiles the code, runs tests, and packages the application into a JAR file located in the `target` directory. |
| 24 | + |
| 25 | +## Running the Project |
| 26 | + |
| 27 | +To run the project, you need Java installed. You can download Java from the [official website](https://www.java.com/en/download/). |
| 28 | + |
| 29 | +Additionally, the project requires PostgreSQL to be installed and running. You can download PostgreSQL from the [official website](https://www.postgresql.org/download/). |
| 30 | + |
| 31 | +Before launching the application, set up the database: |
| 32 | +1. Create a new database in PostgreSQL. |
| 33 | +2. Update the database URL, username, and password in the command-line arguments when running the JAR file. |
| 34 | + |
| 35 | +Run the application with the following command: |
| 36 | + |
| 37 | +```java -jar target/JavaGameBox-1.0.jar --db-url=<database_url> --db-user=<database_user> --db-password=<database_password>``` |
| 38 | + |
| 39 | +Replace `<database_url>`, `<database_user>`, and `<database_password>` with your actual PostgreSQL connection details. |
| 40 | + |
| 41 | +## Additional Information |
| 42 | + |
| 43 | +- The project uses Maven for dependency management (see `pom.xml` for details). |
| 44 | +- Logging is handled by Log4j, with configuration defined in `src/main/resources/log4j2.xml`. |
| 45 | +- The GUI is built using Swing. |
| 46 | +- Each game is implemented using object-oriented principles, extending an `AbstractGame` class. |
| 47 | + |
| 48 | +For more details, refer to the source code and comments. |
0 commit comments