GithubHelp home page GithubHelp logo

safe-search-3's Introduction

Install pre-requisites

You'll need to install the following pre-requisites in order to build SAFE applications

Azure Services pre-requisites

You'll need to following Azure resources provisioned (these get created automatically by runing dotnet run Azure):

  • An Azure Storage account with:
    • a container called properties.
    • a table called postcodes.
  • An Azure Search instance with:
    • an index created via Management.createIndex.
    • a data source created via Management.createBlobDataSource.
    • an indexer created via Management.createCsvIndexer.
  • Postcodes should be inserted into table storage before properties are imported
    • The fastest way to import these is to use AzCopy 7.3 - (Windows only) then run the following command:

      AzCopy.exe /Source:https://compositionalit.blob.core.windows.net/postcodedata /Dest:https://{YOUR_STORAGE_ACCOUNT}.table.core.windows.net/postcodes2 /DestKey:{YOUR_ACCESS_KEY} /Manifest:postcodes /EntityOperation:InsertOrReplace
    • Alternatively you can use Azure Storage Explorer - (Windows, Mac, Linux) and do the following steps.

Getting started

Before you run the project for the first time only you must install dotnet "local tools" with this command:

dotnet tool restore

Running in Azure (preferred)

Set the names for web app, Azure Search, and storage instances, as well as the path to AzCopy in Build.fs:31-34. Navigate to the folder containing the code (e.g. C:\safe-search-3\) and run the following command to deploy the app to Azure:

dotnet run Azure

The first time you do the deployment it will automatically populate the postcodes and properties (this may take a while).

Running locally

Requirements:

  • This requires an Azure Search instace deployed to Azure
  • Azurite set up locally

You should also set the following config settings either as environment variables or in user secrets

{
    // Azure Search resource name
    "searchName": "my-azure-search",
    // Azure Search access key (Search service > Keys > Primary admin key)
    "searchKey": "MYSECRETKEY",
    // Azure Storage account connection string
    "storageConnectionString": "DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=MYSECRETKEY"
}

To concurrently run the server and the client components in watch mode use the following command:

dotnet run

Then open http://localhost:8080 in your browser.

The build project in root directory contains a couple of different build targets. You can specify them after -- (target name is case-insensitive).

Finally, there are Bundle and Azure targets that you can use to package your app and deploy to Azure, respectively:

dotnet run -- Bundle
dotnet run -- Azure

SAFE Stack Documentation

If you want to know more about the full Azure Stack and all of it's components (including Azure) visit the official SAFE documentation.

You will find more documentation about the used F# components at the following places:

safe-search-3's People

Contributors

isaacabraham avatar martinbryant avatar sww26 avatar akash-mair avatar mattgallagher92 avatar outofscopeia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.