Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Software requirements
- IIS - Installation instructions
- SQL Server 2014 or later - Download
- Visual Studio 2019 - Download
- .Net Framework 4.6.1 - Download
- .Net Core 3.0 - Download
- .Net Core Hosting Bundle (Required for hosting on IIS) - Download
- Recommended software
- Cmder - Realy nice terminal for Windows - Download
- First time setup
- Using you favourite terminal, position yourself in the root directory of the repository.
- Run command go go. This will:
- Fetch all nuget dependencies and build the solution.
- Run database migrations, creating the database if it does not exist. It is recommended to run go go whenever you fetch the new code from repository.
- How to run the application
- To run the robot web service backend: run command go run BotsPotsChef and open http://localhost:5000 in you browser.
- To run the robot management deslopt app: run command go run BotsPotsKonzola
- Alternatively, just run the resired project project from Visual Studio.
- Working with database migrations
- Database development (schema, any mandatory hard-coded data and also test data for local development) is kept in source control in the form of database migrations. Database migrations are scripts that gradually evolve database schema and data as the application development progresses.
- In this project, we use Fluent Migrator as a framework for managing and defining our database migrations. Under this model, each migration is a single C# class that know how to upgrade (and possibly downgrade) database schema from previous to next version. Migrations are kept under Migrations folder in DatabaseMigrations project. Each migration class is kept in it's own file.
- Fluent Migrator knows how to run the database migrations that have not yet been run, and applies them in sequential order (based on version number defined in each migration). The framework keeps track of which migrations have been executed in migrations.VersionInfo table in the database.
- Available migration commands
- To run all unapplied database migrations, run command go mig run. This will also create a database if it doesn't already exist.
- To rollback the database to previous version, run go mig rollback -1 (or -2, or -N, depending on how many previous migrations you wish to undo). If some migrations are irreversible, this operation will fail.
- To add a new migration, run command go mig add NameOfMigration. This will add a new migration file under DatabaseMigrations\Migrations folder with our desired naming convention. Go ahead and edit this newly added file to add any migration logic.
- It is impossible to edit migrations after they have been applied. Any changes made to migration scripts will simply be ignored if that migration has already been applied.
- For this reason it very important to not edit any migration files that have already been pushed to the github repository. Even for migrations that have not yet been pushed, editing will not work correctly if you have applied them localy. If you really want to edit a migration you have already applied (but not pushed), you will have to delete the database and recreate it from scratch.
- Available command-line commands
- go go
- go clean
- go build
- go rebuild
- go run
- go run-all
- go run-async
- go watch
- go watch-async
- go mig run
- go mig rerun
- go mig rollback
- go mig drop
- go mig add
- go publish
- Configuring local development machine-specific settings
- If you want to overwrite any setting from appsettings.json or appsettings.{enviornment}.json while running locally on development machine, create a file called appsettings.local.json in src folder (you can just copy the provided appsettings.local.json.template).
- When you run the application under Development environment, any setting that are set in that file will take precedence over the global or environment-specific settings.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement