Giter Club home page Giter Club logo

bookstore's Introduction

Bookstore

Bookstore is a demo application for Rhetos development platform.

You can use it as a prototype for a new Rhetos application. Aside from the project structure, please note the following key components that most Rhetos applications should contain:

  1. The build script Build.ps1, that does everything needed to produce the application binaries from the source:
    1. It checks for installed prerequisites (MSBuild, NuGet, database connection string, ...).
    2. Automatically downloads the Rhetos server binaries. This help us to avoid committing any binaries into the source repository. The download is optimized to occur only on the first build or when changing the version of the Rhetos server (defined in Build.ps1).
    3. Runs MSBuild to build all application components (new custom DSL concepts, and an external algorithm implemented in a separate dll).
    4. Runs DeployPackages to generate a working application in dist\BookstoreRhetosServer subfolder.
  2. The NuGet specification file src\Bookstore.nuspec. It specifies the list of application components that will be deployed to the Rhetos server. More info at Creating a Rhetos package
  3. The test script Test.ps1. It builds and runs the automated unit tests and the integration tests.

See docs\Build process diagram.vsdx for an overview of build & testing.

Build

To build this application from source, run .\Build.ps1 in PowerShell console.

  • If the build fails, see the error description to setup any missing prerequisites.
  • If the build fails with a ConnectionString error, follow the instructions in "Database setup" chapter at the Development Environment Setup.

The build output is a web application in dist\BookstoreRhetosServer subfolder.

  • To setup the IIS web application follow the instructions in "IIS setup" chapter at Development Environment Setup, using dist\BookstoreRhetosServer for Rhetos server folder.

Unit testing

Automated tests are executed by running .\Test.ps1 in PowerShell console.

There are two kinds of tests in this project:

  1. Standard unit tests (test\Bookstore.Algorithms.Test, part of Bookstore.sln) that test the algorithm implemented in external assembly.
    • These tests are very fast and independent of the deployment environment.
  2. Integration tests (test\Bookstore.ServerDom.Test\Bookstore.ServerDom.Test.sln) that test the generated applications together with the database.
    • These tests can test full business processes, including the business logic that is implemented in the database, but are slower and need a database to run (the database connection is set up earlier during the Build).

There are some important considerations for the integration tests that we apply to keep their complexity under control:

  • Each test should insert its own data and not rely on pre-existing data in the database, or on the data inserted by other tests.
  • Each test should clear its data when finished. This is done automatically by RhetosTestContainer, see that the constructor parameter commitChanges is false by default, which means that the SQL transaction will be rolled back at the end of the using block.
  • The tests should not be affected by the existing data in the database. They can be executed on an empty database (after the application is deployed to it), or on database with some user-entered data.

Contributions

Before creating a pull request, please run tools\Build\CleanBuildTest.ps1 in PowerShell console, to make sure there are not any errors when running a clean full build without cached output binaries.

bookstore's People

Contributors

bantolov avatar

Watchers

James Cloos 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.