Skip to content

moshfeu/Site

 
 

Repository files navigation

Intro

This repository holds all the files that the site needs in order to run.

AppVeyor AppVeyor tests Codecov

Contents

Technology stack

The technology stack of this site is base on the following frameworks:

Architecture and folder stucture of UI

The architecture is based heavily on Angular:

  • application - where all the is, topmost folder.
    • common - used to store data types that are common to the entire app.
    • content - used for images, mainly favicon.
    • components - this layer handles the UI calls and bindings along with the relevant css and html files.
    • directives - folder for all the directives.
    • services - this layer hold the lower level data handling.
      • layers - where the layers logic is - POI, route, wiki, nakeb, relevant services, etc...
      • routers - handles the routing - currently there are 4 routers - hike, bike, fourbyfour and none.
  • fonts - icomoon generated font for icons instead of images.
  • Environments - used for angular-cli to define production and dev variables.
  • translations - all relevant data related to i18n

Architecture of Server

The architecture is based on layers

  • Contollers - the topmost layer to catch all the requests
  • Services - responsible for orchastrating executors
  • Converters - converters logic between types of geo structures
  • Executers - basic logical building blocks
  • DataAccessInterfaces - a slim layer to decouple business logic from data access
  • DataAccess - database, file system and network request are processed in this layer

Setting Up the Project for Development

In order to be able to build this site you'll need some tools:

  • Install Java runtime - make sure to install 64bit version.
  • Download and install Visual Studio community 2017 or later. Select:
    • ASP.NET and web development
    • .NET cross-platform development
  • Install node.js for windows (6.10+). Use the recommended 64-bit installer on modern Windows versions.
  • Open Visual Studio
  • Follow these steps to update the version of node.js Visual Studio uses
  • If asked, and you don't have any other preference, choose "General" development settings
  • In Visual Studio, File → Open → Project/Solution... and choose the IsraelHiking.sln solution from the Site reposotory location.
  • From Visual Studio's Tools → Extensions and Updates...
    • Go to Online
    • Search for the following and Download them:
      • Web Essentials 2017
    • Exit Visual Studio to complete the installation
    • Find the VSIX Installer window and click Modify, wait for the installation to complete, and close it
    • Open Visual Studio, wait for the installations to complete, and restart when asked
  • Open IsraelHiking.sln. You may use File → Recent Projects and Solutions
  • Compile using Ctrl-Shift-B - Note that it will take time to download all the packages so be patience
  • Place a nonPublic.json at D:\Dropbox\IsraelHikingGithub (or change the appsetting.json nonPublic property to a file containineg the following json)
{
	wikiMediaUserName: "your wikimedia user",
	wikiMediaPassword: "your wikimedia password"
}
  • In Visual Studio, View → Other Windows... → Package Manager Console
    • Select IsraelHiking.DataAccess from the Default project dropdown
    • Type the following commands at the PM> prompt. Most of the commands may take a while. Ignore all WARN messsages.
    npm install -g @angular/cli@latest --loglevel error
    Update-Database
    

Starting a debug session

See the relevant page in our wiki

Setup the server

In order to be able to make the server work a few prerequisits are needed:

  • Windows machine with IIS enabled and a site (Although this site should be able to run on Linux it was never fully tested).
  • Install Java Runtime Environment.
  • Add curl to path.
  • ElasticSearch.cmd and GraphHopper.cmd should be processes that run when the server machine starts and never die - use a watchdog or windows service to make sure they do (we use NSSM. for linux, check the java command inside those files and use a deamon to run them).
  • Place the israelhiking.sqlite file along side the dlls and make sure the user that runs the server has write access to it (IIS user for windows).
  • Create a task to update Graph Hopper and Elastic Search:
    • Open Windows' Task Scheduler
    • Create task
    • Add an action to run UpdateDB.bat after you download a new osm.pbf file.
    • Add a "On a schedule" trigger to run once a day or at the frequency of the map updates.
    • Add a "At startup" trigger.

About

This repository holds the files needed for running the Israel Hiking Map site.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 48.2%
  • TypeScript 40.3%
  • HTML 6.6%
  • CSS 4.0%
  • JavaScript 0.4%
  • PowerShell 0.4%
  • Batchfile 0.1%