Skip to content

An HTTP server for a single page application in JavaScript and related tools.

License

Notifications You must be signed in to change notification settings

vault-thirteen/SPA

Repository files navigation

SPA

An HTTP server for a single page application in JavaScript and related tools.

For more information about each component see each component's ReadMe file located in an appropriate sub-folder of the ReadMe folder.

Components

  • SPA Server
  • An example of a page loader and router written in JavaScript
  • Complementary reference files (CSS style sheet, etc.)
  • CRC32 hash tool for JSON files
  • Indexer
  • Reverse Proxy Server
  • Other components (external)

Components' ReadMe Files

  • SPA Server – ReadMe
  • CRC32 hash tool for JSON files – ReadMe
  • Indexer – ReadMe
  • Reverse Proxy Server – ReadMe
  • External components:

Structural Diagram

Structural Diagram

Installation

  1. Create a new separate folder which will be used as a root folder for your installation.

  2. Copy following scripts from the scripts folder into this root folder:

    • create-certificates.bat
    • move-certificates.bat
    • setup.bat
    • start.bat
    • stop.bat
  3. Modify the setup script to your needs:

    • Set the domain name in the Main_Address variable;
    • Tweak cache settings using following variables if you do not like the default values:
      • SFRODB_Common_Cache_Volume_Max or SFRODB_Icon_Cache_Volume_Max
      • SFRODB_Common_Item_Volume_Max or SFRODB_Icon_Item_Volume_Max
      • SFRODB_Item_TTL
    • Customize the indexer settings:
      • SPA_Indexer_TopNewsCount
    • All other settings should not be touched as they are there for a reason.
  4. Run the setup script and ensure than no errors occur. It may happen that Go language changes in future and this script stops working. The reasons are stated inside the setup script as comments.

  5. Get the SSL/TLS certificates. This can be done in several different ways.

    • You may have them stored somewhere already. Then copy them into the SPA\Proxy\cert folder.
    • You may want to cd to the SPA\Proxy folder and run the create-certificates.bat script from there.
    • You may want to create certificates in the root folder and move them by running create-certificates.bat and then move-certificates.bat from the root folder.
  6. Fill all the data folders with your own content. It is not included with this bundle, as it is only a framework. Available data folders:

    • SFRODB\icon-db\data
    • SFRODB\jpeg-db\data
    • SFRODB\json-db\data
  7. Run the start.bat script to start all the servers.

  8. Run the stop.bat script to stop all the servers.

Notes

  • If you would like to use this product on a distributed platform (i.e. on separate network machines), all the configurations and the setup script should be changed accordingly.

  • Server addresses, including host names and port numbers, and numerous other settings are hard-coded not only in the setup.bat script, but also in the front-end loader script (loader.js), a start web page (index.html) and some other places. So, do not touch anything unless you are sure about what you are doing.

  • This product serves static content which must be re-indexed after each change. This means that after each change of the content in your data folders, a new indexation must be run for each category of the modified content. This is the key difference between this framework and most other website engines available in the network. Also note that each re-indexation must be followed by a cache cleaning. For more information see the documentation of external components.

About

An HTTP server for a single page application in JavaScript and related tools.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •