# NeuGames **Repository Path**: PracticalSemesterFinalProjectStudentsinRussia/neu-games ## Basic Information - **Project Name**: NeuGames - **Description**: An application for buying games and computer devices. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-09-24 - **Last Updated**: 2026-09-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # NeuGames An academic store for PC games and gaming hardware, based on the functionality covered in NeuMall Tasks 1-16. NeuGames is a separate Maven project; the original NeuMall project is unchanged. Team: **Manuylov Alexander, Leshchinskaia Olesia, Ivanov Kirill**. ## Quick Start Java 11 or newer is required (JDK 17 or 21 is recommended). In a terminal: ```sh cd /Users/amanuylov/IdeaProjects/NeuGames sh run.sh demo ``` Open http://localhost:8081/neugames/ . To stop the server, press Ctrl+C in the terminal where it is running. If the port is occupied, stop the previous instance or run `PORT=8082 sh run.sh demo` and use port 8082. Demo mode uses a file-based H2 database at `.runtime/neugames`. It creates tables and seed data automatically; the catalog and orders are read from the database. An internet connection is needed to download Maven dependencies on the first run. Product images are included in the project. ## IntelliJ IDEA 1. In IntelliJ IDEA, select File → Open and choose the `NeuGames` directory or its `pom.xml`. Open it as a separate project rather than adding it to NeuMall. 2. Set the Project SDK to JDK 17 or 21 and wait for Maven to load the project. 3. Run the **NeuGames Demo** configuration. If port `8081` is occupied, use **NeuGames Auth Demo**, which runs the same demo mode on port `8082`. If the configurations are unavailable, use Maven → Execute Maven Goal with `compile exec:java`; set `DB_MODE=demo` in the run configuration and use the project directory as the working directory. 4. Open http://localhost:8081/neugames/ (or use port `8082` for the alternate configuration). This setup does not require a separate Tomcat installation. ## MySQL with DataGrip DataGrip connects to MySQL but does not replace the MySQL server. Make sure Test Connection succeeds first. 1. Connect DataGrip to your MySQL server (`localhost`, port `3306`, with your own username and password). 2. Use File → Open to open `database/neugames.sql` from this project. 3. Select your MySQL connection and execute the **entire file**, not just a selected line. The script creates a separate `neugames` database with tables and seed data. It does not delete `mall` or other databases. 4. Refresh the connection tree and select `neugames` under Schemas. 5. Check the data in a SQL console: ```sql USE neugames; SELECT COUNT(*) AS products FROM goods; -- 16 SELECT COUNT(*) AS variants FROM goods_sku; -- 32 SELECT COUNT(*) AS stores FROM shop; -- 3 ``` 6. In IntelliJ IDEA, create a Maven configuration with the goals `compile exec:java` (or use your existing local **NeuGames MySQL** configuration). Under Edit Configurations → Environment variables, set `DB_MODE=mysql`, `DB_USER=root`, and `DB_PASSWORD=your_password`. For a different server, also set `DB_URL=jdbc:mysql://127.0.0.1:3306/neugames?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false`. The local MySQL run configuration containing a password is not committed to Git. 7. Stop the demo server and start the MySQL configuration. A database error will not silently switch the site to demo data. Alternatively, set `user` and `password` in your local `src/main/resources/db.properties` and run `sh run.sh mysql`. Do not commit a file containing a real password. H2 and MySQL are independent: demo orders are not transferred to MySQL automatically. Re-importing the SQL script skips existing rows and does not reset stock levels. ## Features | Task | NeuGames implementation | | --- | --- | | Task 1 | Maven, Java, the MVC framework, and Tomcat | | Task 2 | English interface, catalog, local images, and responsive layout | | Task 3 | Database-backed store list | | Task 4 | Database-backed products and New arrivals sorting | | Task 5 | Keyword-based product search | | Task 6 | Store page and product categories | | Task 7 | Category filtering and paginated catalog (8 products per page) | | Task 8 | Product details, description, and image gallery | | Task 9 | Product variants, prices, stock levels, and selected-SKU images | | Task 10 | Registration, login, protected password storage, and account order history | | Task 11 | Saved shipping addresses: create, edit, delete, and select at checkout | | Task 12 | Personal cart with products, quantities, totals, and demo checkout | | Task 13 | Add a selected SKU to the cart, change its quantity, or remove it | | Task 14 | Paginated order history and an order details page | | Task 15 | Cart selection or Buy now, shipping address, order confirmation, and demo payment | | Task 16 | Login filter for cart, checkout, orders, and addresses, with return to the requested page after login | The catalog contains 12 games, 4 hardware products, 3 stores, 7 categories, and 32 SKUs. Prices and stock levels are sample data. A Gift edition is a demo store offering, not an official expanded edition of a game. Orders are saved in a database transaction, which reduces stock and records the purchase price. Registration and login use PBKDF2 password hashes; plaintext passwords are not stored in the database. A signed-in user's cart is persisted and restored on the next login. Hardware orders can use a saved shipping address. After order confirmation, a demo payment screen appears. No real payments, game keys, or deliveries are provided. ## Project Files - `src/main/java/cn/edu/neusoft/mall/controller/NeuGamesController.java`: page routes. - `src/main/java/edu/neugames/dao/`: database connections and SQL queries. - `src/main/java/edu/neugames/service/ShopService.java`: cart operations, stock checks, and order transactions. - `src/main/webapp/WEB-INF/views/`: JSP pages. - `src/main/webapp/assets/`: CSS, JavaScript, and images. - `database/neugames.sql`: MySQL import script. - `docs/ASSETS.md`: image sources and attribution. - `docs/NeuGames_Introduction.pptx`: introductory presentation in English. ## Testing and Build ```sh DB_MODE=demo ./mvnw -Dmaven.repo.local=.runtime/m2 test package ``` The result is `target/neugames.war` for Tomcat 9. When deploying the WAR separately, configure the database environment variables for the Tomcat process. The embedded server uses the source JSP files, so `run.sh` is simpler for local use. JUnit tests cover the catalog, stock handling, registration, cart, addresses, and product selection at checkout. For an additional browser check, `scripts/verify-browser.mjs` requires Node.js, Chrome, and the `playwright` package (`npm install --no-save playwright`). Then run `node scripts/verify-browser.mjs`. This script creates a demo order and reduces stock, so run it only against the demo database.