Skip to content

Commit

Permalink
Merge pull request #25 from GravityTwoG/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
GravityTwoG authored Jun 19, 2024
2 parents 38725ce + a7a10cd commit 978052a
Show file tree
Hide file tree
Showing 154 changed files with 4,140 additions and 5,119 deletions.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

Desktop application for management of game saves.

Features:
Backend application with REST API is implemented by my friend https://github.com/Ki-Really/GameSavesStore.

- scan file system for game saves
- periodically sync saves with server
- download your/shared/public saves
## Features

- 🔍 scan file system for game saves
- 🔄 periodically sync saves with server
- ⬇︎ download your/shared/public saves
- 🗃️ extract game state information from files (player level, play time etc)

## Development

Expand Down Expand Up @@ -42,33 +45,32 @@ npm run package
Modules diagram

```sh
npx madge --image graph.svg .\src\renderer.ts
npx madge --image graph.svg .\src\renderer.ts --circular
npx tsuml2 -o out.svg -g ".\src\**\*.ts(x)?"
npx madge --image graph.svg ./src/renderer.ts
npx madge --image graph.svg ./src/renderer.ts --circular
npx tsuml2 -o out.svg -g "./src/**/*.ts(x)?"
```

## Folder structure

We use electron as a framework, so application consists of two parts: **backend** application which runs on nodejs and **client** application which runs in chromium.
We use electron as a framework, so application consists of two parts: **"backend"** application which runs on Node.js and **client** application which runs in chromium.

- src - root of source directory
- @types - global type definitions
- backend - backend application
- backend - "backend" application
- fs - fs utils
- game-state-parameters - parameter values extraction, game state formats converting
- game-state-parameters - parameter values extraction, game state formats convertion
- StatesManager - extracts parameter values, archives game state files, downloads game state from the server
- SyncManager - automatically uploads or downloads game states
- electron-api.ts - IPC handlers (smth like REST controller)
- client - client application
- app - configuration of react application (main layout, routing etc)
- config - configuration of application (list of pages, their corresponding paths, sidebar links)
- contexts - React contexts (API, UI)
- layouts - Reusable layouts of application or pages
- locales - json files with internationalized texts
- pages - pages
- lib - reusable domain/app specific code (components, hooks, other utils)
- api - api layer (work with REST API, electron IPC)
- entities - entity specific components
- shared - reusable domain/app specific code (components, hooks, other utils)
- ui - ui kit. This layer knows nothing about domain or application as a whole.
- api - api layer or data access layer (DAL) (work with REST API, electron IPC)
- preload.ts - Electron preload file
- renderer.ts - Entry point of client application
- main.ts - Entry point of a whole application
Expand Down
2 changes: 1 addition & 1 deletion e2e/auth/register.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ test("register existing user", async () => {

await page.waitForTimeout(1000);

expect(await page.content()).toContain("User already exists");
expect(await page.content()).toContain("Username already exists");
});
35 changes: 35 additions & 0 deletions forge.env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export {}; // Make this a module

declare global {
// This allows TypeScript to pick up the magic constants that's auto-generated by Forge's Vite
// plugin that tells the Electron app where to look for the Vite-bundled app code (depending on
// whether you're running in development or production).
const MAIN_WINDOW_VITE_DEV_SERVER_URL: string;
const MAIN_WINDOW_VITE_NAME: string;

namespace NodeJS {
interface Process {
// Used for hot reload after preload scripts.
viteDevServers: Record<string, import("vite").ViteDevServer>;
}
}

type VitePluginConfig = ConstructorParameters<
typeof import("@electron-forge/plugin-vite").VitePlugin
>[0];

interface VitePluginRuntimeKeys {
VITE_DEV_SERVER_URL: `${string}_VITE_DEV_SERVER_URL`;
VITE_NAME: `${string}_VITE_NAME`;
}
}

declare module "vite" {
interface ConfigEnv<
K extends keyof VitePluginConfig = keyof VitePluginConfig,
> {
root: string;
forgeConfig: VitePluginConfig;
forgeConfigSelf: VitePluginConfig[K][number];
}
}
Loading

0 comments on commit 978052a

Please sign in to comment.