Skip to content

Commit

Permalink
Merge pull request #56 from tsevasa/restructure
Browse files Browse the repository at this point in the history
Updated Navigation guide
  • Loading branch information
Naviary2 authored Jul 11, 2024
2 parents 67f8d78 + cb10230 commit a770186
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 40 deletions.
2 changes: 1 addition & 1 deletion docs/COPYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Infinite Chess is free software; you can redistribute and/or modify it under the

Infinite Chess is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) for more details.

See [LICENSE](./LICENSE) for a copy of the GNU Affero General Public License.
See [LICENSE](../LICENSE) for a copy of the GNU Affero General Public License.

## Exceptions (free)

Expand Down
61 changes: 22 additions & 39 deletions docs/NAVIGATING.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,49 @@
# Navigating the workspace #

This guide gives you several pointers on how to navigate the project, including where to find the game's code!
This guide gives you several pointers on how to navigate the project. The entire source code of the project is located in [src](../src/).

It is assumed you have already gone through the [Setup](./SETUP.md) process.
It is assumed you have already gone through the [Setup](./SETUP.md) process. Whenever you run `nodemon`, [build.mjs](../build.mjs) automatically deploys and minifies all clientside assets of the project from [src](../src/) to the newly created folder `dist`, and an infinite chess server at `https://localhost:3443` is launched.


## Server ##

## Getting Started ##
[src/server](../src/server/) contains all serverside files of the website.

There has been 3 automatically generated accounts for you to test with-
- Member: Has basic member permissions.
- Patron: Has patron-specific permissions (at the moment this holds no difference between member accounts).
- Owner: Has owner permissions, allowing access to otherwise innaccessible pages, including the game's developmental version.

The password for every one of these accounts is `1`.



## Server.js ##

Everything starts running from [server.js](../server.js)!
Everything starts running from [server.js](../src/server/server.js)!

This configures and starts our http, https, and websocket servers, and it cleans up on closing.

[src/server/game/](../src/server/game/) contains the server-side code for running online play, including the [invites-manager](../src/server/game/invitesmanager.js) and the [game-manager](../src/server/game/gamemanager.js).

Both of these managers run use websockets to broadcast changes out to the clients in real-time.

The websocket server code is located [here](../src/server/wsserver.js).

## [views](../views) ##

This contains all our html documents.
## Client ##

The routers that actually send these htmls to the client are located in [../routes/root.js](../routes/root.js)
[src/client](../src/client/) contains all clientside files of the website.

It has subfolders for all the HTML, CSS, javascript, sound and image files of the website.

[src/client/views](../src/client/views) contains all our html documents.

## Public assets ##
The routers that actually send these htmls to the client are located in [src/server/routes/root.js](../src/server/routes/root.js).

Public items such as css, scripts, audio, images, and more, that are **not** locked behind certain roles, are located in [public](../public).
[src/client/scripts/game/](../src/client/scripts/game/) contains all our javascipt code for running the game in the user's browser.

The play page's minified game code is located in [../public/scripts/game](../public/scripts/game). [app.js](../public/scripts/game/app.js) is loaded separately, and [htmlscript.js](../public/scripts/game/htmlscript.js) is injected directly into the html before serving to the client!

## Accounts ##

There are 3 automatically generated accounts for you to test with-
- `Member`: Has basic member permissions.
- `Patron`: Has patron-specific permissions (at the moment this holds no difference to member accounts).
- `Owner`: Has owner-specific permissions (at the moment this holds no difference to member accounts).

## Protected assets ##
The password for every one of these accounts is `1`.

Items that are private (i.e. only served to users with the `owner` role), are located in [../protected-owner](../protected-owner).

The game's unminified code is located within [protected-owner/scripts/game](./protected-owner/scripts/game). This contains all the javascript code for the developmental version of the game! To access this developmental version in your browser, go to:
```
https://localhost:3443/play/devversion
```
This will forward you to the login page, login with the owner account to access it. The password is `1`.
## Making changes to the repository ##

Every game script includes a basic description at the top. [Ask for help](https://discord.com/channels/1114425729569017918/1115358966642393190) in the discord for greater understanding of how each script works!

Expand All @@ -70,17 +64,6 @@ and under the "Preferences" tab, checking the box next to "Disable cache (while
Now, as long as you have developer tools open whenever you refresh, the game will always hard refresh and load your new code.



## Game ##

[game](../game) contains the server-side code for running online play, including the [invites-manager](../game/invitesmanager.js) and the [game-manager](../game/gamemanager.js).

Both of these managers run use websockets to broadcast changes out to the clients in real-time.

The websocket server code is located [here](../wsserver.js).



# FAQ #

### How do I connect to the web server with other devices in my home network? ###
Expand Down

0 comments on commit a770186

Please sign in to comment.