diff --git a/.gitignore b/.gitignore index 7f098e0..0313feb 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ yarn-error.log # Visual Studio Code .vscode/ .history/* -.angualar/ +.angular/ # Miscellaneous /.angular/cache .sass-cache/ diff --git a/README.md b/README.md index b6ed2d9..fdf635e 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,41 @@ -# NowchessFrontend +# NowChess Frontend -This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.24. +Angular 20 frontend for the NowChess board UI. -## Development server +## Tech stack -To start a local development server, run: +- Angular standalone components and route-based pages +- HTTP and streaming integration for live game updates +- Asset sprites loaded from `arabian-chess/` + +## Project structure + +- `src/app/pages` page-level containers (`welcome`, `game`) +- `src/app/components` reusable UI pieces (`chess-board`, `chess-piece`) +- `src/app/services` API and stream integration (`GameApiService`) +- `src/app/models` shared API/domain types +- `src/app/core/chess` chess domain utilities (FEN parsing and square lookup) +- `src/environments` environment-specific API base URLs + +## Run locally ```bash -npm install -npm start +npm install +npm start ``` -Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files. +Open `http://localhost:4200`. -## Code scaffolding +Development environment defaults to: -Angular CLI includes powerful code scaffolding tools. To generate a new component, run: +- API: `http://localhost:8080` +- WebSocket: `ws://localhost:8080` + +`src/environments/environment.ts` is production-oriented (`production: true`) and `src/environments/environment.development.ts` is development-oriented (`production: false`). + +## Build and test ```bash -ng generate component component-name +npm run build +npm test ``` - -For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run: - -```bash -ng generate --help -``` - -## Building - -To build the project run: - -```bash -ng build -``` - -This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed. - -## Running unit tests - -To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command: - -```bash -ng test -``` - -## Running end-to-end tests - -For end-to-end (e2e) testing, run: - -```bash -ng e2e -``` - -Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs. - -## Additional Resources - -For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page. diff --git a/angular.json b/angular.json index 4bc07dd..72e5f83 100644 --- a/angular.json +++ b/angular.json @@ -28,7 +28,7 @@ }, { "glob": "**/*", - "input": "ARABIAN CHESS", + "input": "arabian-chess", "output": "/arabian-chess" } ], @@ -90,7 +90,7 @@ }, { "glob": "**/*", - "input": "ARABIAN CHESS", + "input": "arabian-chess", "output": "/arabian-chess" } ], diff --git a/ARABIAN CHESS/license.txt b/arabian-chess/license.txt similarity index 100% rename from ARABIAN CHESS/license.txt rename to arabian-chess/license.txt diff --git a/ARABIAN CHESS/ref/cover.png b/arabian-chess/ref/cover.png similarity index 100% rename from ARABIAN CHESS/ref/cover.png rename to arabian-chess/ref/cover.png diff --git a/ARABIAN CHESS/ref/full_art.png b/arabian-chess/ref/full_art.png similarity index 100% rename from ARABIAN CHESS/ref/full_art.png rename to arabian-chess/ref/full_art.png diff --git a/ARABIAN CHESS/ref/logo.png b/arabian-chess/ref/logo.png similarity index 100% rename from ARABIAN CHESS/ref/logo.png rename to arabian-chess/ref/logo.png diff --git a/ARABIAN CHESS/sheets/board.png b/arabian-chess/sheets/board.png similarity index 100% rename from ARABIAN CHESS/sheets/board.png rename to arabian-chess/sheets/board.png diff --git a/ARABIAN CHESS/sheets/board_centered.png b/arabian-chess/sheets/board_centered.png similarity index 100% rename from ARABIAN CHESS/sheets/board_centered.png rename to arabian-chess/sheets/board_centered.png diff --git a/ARABIAN CHESS/sheets/board_without_bottom.png b/arabian-chess/sheets/board_without_bottom.png similarity index 100% rename from ARABIAN CHESS/sheets/board_without_bottom.png rename to arabian-chess/sheets/board_without_bottom.png diff --git a/ARABIAN CHESS/sheets/nums & letters.png b/arabian-chess/sheets/nums & letters.png similarity index 100% rename from ARABIAN CHESS/sheets/nums & letters.png rename to arabian-chess/sheets/nums & letters.png diff --git a/ARABIAN CHESS/sheets/pieces.png b/arabian-chess/sheets/pieces.png similarity index 100% rename from ARABIAN CHESS/sheets/pieces.png rename to arabian-chess/sheets/pieces.png diff --git a/ARABIAN CHESS/sprites/board/board_bottom.png b/arabian-chess/sprites/board/board_bottom.png similarity index 100% rename from ARABIAN CHESS/sprites/board/board_bottom.png rename to arabian-chess/sprites/board/board_bottom.png diff --git a/ARABIAN CHESS/sprites/board/board_square_black.png b/arabian-chess/sprites/board/board_square_black.png similarity index 100% rename from ARABIAN CHESS/sprites/board/board_square_black.png rename to arabian-chess/sprites/board/board_square_black.png diff --git a/ARABIAN CHESS/sprites/board/board_square_white.png b/arabian-chess/sprites/board/board_square_white.png similarity index 100% rename from ARABIAN CHESS/sprites/board/board_square_white.png rename to arabian-chess/sprites/board/board_square_white.png diff --git a/ARABIAN CHESS/sprites/nums & letters/letter_a.png b/arabian-chess/sprites/nums & letters/letter_a.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/letter_a.png rename to arabian-chess/sprites/nums & letters/letter_a.png diff --git a/ARABIAN CHESS/sprites/nums & letters/letter_b.png b/arabian-chess/sprites/nums & letters/letter_b.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/letter_b.png rename to arabian-chess/sprites/nums & letters/letter_b.png diff --git a/ARABIAN CHESS/sprites/nums & letters/letter_c.png b/arabian-chess/sprites/nums & letters/letter_c.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/letter_c.png rename to arabian-chess/sprites/nums & letters/letter_c.png diff --git a/ARABIAN CHESS/sprites/nums & letters/letter_d.png b/arabian-chess/sprites/nums & letters/letter_d.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/letter_d.png rename to arabian-chess/sprites/nums & letters/letter_d.png diff --git a/ARABIAN CHESS/sprites/nums & letters/letter_e.png b/arabian-chess/sprites/nums & letters/letter_e.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/letter_e.png rename to arabian-chess/sprites/nums & letters/letter_e.png diff --git a/ARABIAN CHESS/sprites/nums & letters/letter_f.png b/arabian-chess/sprites/nums & letters/letter_f.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/letter_f.png rename to arabian-chess/sprites/nums & letters/letter_f.png diff --git a/ARABIAN CHESS/sprites/nums & letters/letter_g.png b/arabian-chess/sprites/nums & letters/letter_g.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/letter_g.png rename to arabian-chess/sprites/nums & letters/letter_g.png diff --git a/ARABIAN CHESS/sprites/nums & letters/letter_h.png b/arabian-chess/sprites/nums & letters/letter_h.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/letter_h.png rename to arabian-chess/sprites/nums & letters/letter_h.png diff --git a/ARABIAN CHESS/sprites/nums & letters/num_0.png b/arabian-chess/sprites/nums & letters/num_0.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/num_0.png rename to arabian-chess/sprites/nums & letters/num_0.png diff --git a/ARABIAN CHESS/sprites/nums & letters/num_1.png b/arabian-chess/sprites/nums & letters/num_1.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/num_1.png rename to arabian-chess/sprites/nums & letters/num_1.png diff --git a/ARABIAN CHESS/sprites/nums & letters/num_2.png b/arabian-chess/sprites/nums & letters/num_2.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/num_2.png rename to arabian-chess/sprites/nums & letters/num_2.png diff --git a/ARABIAN CHESS/sprites/nums & letters/num_3.png b/arabian-chess/sprites/nums & letters/num_3.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/num_3.png rename to arabian-chess/sprites/nums & letters/num_3.png diff --git a/ARABIAN CHESS/sprites/nums & letters/num_4.png b/arabian-chess/sprites/nums & letters/num_4.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/num_4.png rename to arabian-chess/sprites/nums & letters/num_4.png diff --git a/ARABIAN CHESS/sprites/nums & letters/num_5.png b/arabian-chess/sprites/nums & letters/num_5.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/num_5.png rename to arabian-chess/sprites/nums & letters/num_5.png diff --git a/ARABIAN CHESS/sprites/nums & letters/num_6.png b/arabian-chess/sprites/nums & letters/num_6.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/num_6.png rename to arabian-chess/sprites/nums & letters/num_6.png diff --git a/ARABIAN CHESS/sprites/nums & letters/num_7.png b/arabian-chess/sprites/nums & letters/num_7.png similarity index 100% rename from ARABIAN CHESS/sprites/nums & letters/num_7.png rename to arabian-chess/sprites/nums & letters/num_7.png diff --git a/ARABIAN CHESS/sprites/pieces/black_bishop.png b/arabian-chess/sprites/pieces/black_bishop.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/black_bishop.png rename to arabian-chess/sprites/pieces/black_bishop.png diff --git a/ARABIAN CHESS/sprites/pieces/black_king.png b/arabian-chess/sprites/pieces/black_king.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/black_king.png rename to arabian-chess/sprites/pieces/black_king.png diff --git a/ARABIAN CHESS/sprites/pieces/black_knight.png b/arabian-chess/sprites/pieces/black_knight.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/black_knight.png rename to arabian-chess/sprites/pieces/black_knight.png diff --git a/ARABIAN CHESS/sprites/pieces/black_pawn.png b/arabian-chess/sprites/pieces/black_pawn.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/black_pawn.png rename to arabian-chess/sprites/pieces/black_pawn.png diff --git a/ARABIAN CHESS/sprites/pieces/black_queen.png b/arabian-chess/sprites/pieces/black_queen.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/black_queen.png rename to arabian-chess/sprites/pieces/black_queen.png diff --git a/ARABIAN CHESS/sprites/pieces/black_rook.png b/arabian-chess/sprites/pieces/black_rook.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/black_rook.png rename to arabian-chess/sprites/pieces/black_rook.png diff --git a/ARABIAN CHESS/sprites/pieces/white_bishop.png b/arabian-chess/sprites/pieces/white_bishop.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/white_bishop.png rename to arabian-chess/sprites/pieces/white_bishop.png diff --git a/ARABIAN CHESS/sprites/pieces/white_king.png b/arabian-chess/sprites/pieces/white_king.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/white_king.png rename to arabian-chess/sprites/pieces/white_king.png diff --git a/ARABIAN CHESS/sprites/pieces/white_knight.png b/arabian-chess/sprites/pieces/white_knight.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/white_knight.png rename to arabian-chess/sprites/pieces/white_knight.png diff --git a/ARABIAN CHESS/sprites/pieces/white_pawn.png b/arabian-chess/sprites/pieces/white_pawn.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/white_pawn.png rename to arabian-chess/sprites/pieces/white_pawn.png diff --git a/ARABIAN CHESS/sprites/pieces/white_queen.png b/arabian-chess/sprites/pieces/white_queen.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/white_queen.png rename to arabian-chess/sprites/pieces/white_queen.png diff --git a/ARABIAN CHESS/sprites/pieces/white_rook.png b/arabian-chess/sprites/pieces/white_rook.png similarity index 100% rename from ARABIAN CHESS/sprites/pieces/white_rook.png rename to arabian-chess/sprites/pieces/white_rook.png diff --git a/src/environments/environment.development.ts b/src/environments/environment.development.ts index 9d9bece..5ad9ba5 100644 --- a/src/environments/environment.development.ts +++ b/src/environments/environment.development.ts @@ -1,4 +1,5 @@ export const environment = { + production: false, apiBaseUrl: 'http://localhost:8080', wsBaseUrl: 'ws://localhost:8080' }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 9d9bece..ac31fb7 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -1,4 +1,5 @@ export const environment = { + production: true, apiBaseUrl: 'http://localhost:8080', wsBaseUrl: 'ws://localhost:8080' };