Get Started

To build the Scrapbook101 app on Windows use the following:

Install these components on your development or local server. This server will be your local run/test environment as well as the publish point to push changes live, if you choose to do so.

Visual Studio has different workloads that can be installed. If you are running Scrapbook101 on ASP.NET for Windows, then you need the ASP.NET and web development workload. If you are running Scrapbook101 on ASP.NET Core, then you need the .NET Cross-platform development workload. For more information on workloads, see Selecting Workloads in Visual Studio 2017.

After installing the Cosmos DB Emulator, confirm that you can run Cosmos DB Local Emulator. You should see a screen like the following image.

Alt text

Run local

Running Scrapbook101 locally, you can try out your ideas at no cost or risk.

  1. Clone (https://github.com/travelmarx/scrapbook101.git) or download the Scrapbook101 code and open it as a solution in Visual Studio. The source code in the src folder and these docs in the docs folder.
  2. Open the solution in Visual Studio. For example, open the solution file Scrapbook101.sln.
  3. Customize the code as follows in the web.config file.
    • Enter the correct value for authKey, which you can get from the local emulator home page as show above.
    • Enter a Bing Maps Key for bingMapKey if you have one; if blank, then geocoding is skipped.
    • Set the value for addTestAssets to true to write test assets or false not to write them.
    There are other web.config settings you can change, but the the three above are the enough to get started.
  1. Clone (https://github.com/travelmarx/scrapbook101core.git) or download the Scrapbook101 code and open it as a solution in Visual Studio. The source code in the Scrapbook101core folder.
  2. Open the solution in Visual Studio. For example, open the solution file Scrapbook101core.sln.
  3. Customize the code as follows in the appsettings.json file.
    • Enter the correct value for AuthKey, which you can get from the local emulator home page as show above.
    • Enter a Bing Maps Key for BingMapKey if you have one; if blank, then geocoding is skipped.
    • Set the value for AddTestAssets to true to write test assets or false not to write them.
    There are other appsettings.json settings you can change, but the the three above are the enough to get started.

With the Cosmos DB Local Emulator running, run the solution (Visual Studio F5) and view Scrapbook101 in a browser, e.g. https://localhost:port#/. You should see something ressembling the following screenshot:

Alt text

What happened on startup:

  1. In the document store, a database named Scrapbook101 was created with a collection named Items.
  2. A category document was created and stored in the document store. The category information was read from the file Assets/categories-document.json.
  3. If the configuration option addTestAssets to create test assets was set to `true` in the web.config file, then test items were added to the document store as well. They were read from the file App_data/categories-document.json.
  1. In the document store, a database named Scrapbook101 was created with a collection named Items.
  2. A category document was created and stored in the document store. The category information was read from the file Assets/categories-document.json.
  3. If the configuration option AddTestAssets to create test assets was set to `true` in appsettings.json, then test items were added to the document store as well. They were read from the file Assets/categories-document.json.

Create an item

At this point, you can start working with Scrapbook101 items with CRUD (create, read, update, delete) operations. The home page is https://localhost:port#/ or https://localhost:port#/Item/Index.

To create a new Scrapbook101 item.

  1. On the home page, select Create.
  2. Choose a category in the Category dropdown.
  3. Fill in the Title field.
  4. Select Save or continue to fill in fields.

Run live

After running Scrapbook101 locally, you can take optional next step and run Scrapbook101 as a web service. To do this you need to go live, which means publishing your site live with the following services:

Using Azure Cosmos DB Service you will eventually incur charges, but be sure to take advantage of any limited, free use offers.

There are a couple of other considerations when going live. In the least, you should consider:

These and other topics are discussed in Next Steps and Handling Assets.