Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (46 sloc) 3.18 KB
The main idea it's create a command line application that generate code and html files similar as how ruby on rails works.
Now only support the razor view engine in Nancy
This is a work in progress you can try with this commands:
*In the command line, located in the project folder*
appgen struct
Generate all the folder structure for a Nancy web application (Views,Controllers, shared folders), now the assets with js,img and css are missing,need to add.
appgen generate controller {controllerName} {action1} {action2} {action3}
Generate a controller with the name {controllerName} and with the actions named {action1},{action2},{action3}, also generate the cshtml views.
appgen generate Greetings hello bye
appgen generate model {ModelName} {fieldName:type} {fieldName:type} {fieldName:type}
Generate a model class with the name {ModelName} and the field defined with {fieldName:type}, this will also generate a migration file(in migrations folders) to execute with fluent migrator.
appgen generate model Person Id:integer Name:string BirthDate:datetime status:bool
appgen generate scaffold {ModelName} {fieldName:type} {fieldName:type}
Generate a model class with the name {ModelName} and the field defined with {fieldName:type} and generate a controller with the actions and view to do all the CRUD for the model (Index,New,Edit,Delete)
appgen generate scaffold Person Id:integer Name:string BirthDate:datetime status:bool
appgen migrate db:dbtype conn:"connection string"
Migrate the migrations classes generated or implemented in the migrations folder using FluentMigrator, the parameter db: expect one of the next database types and it's required:
And the conn: parameter, expect the connection string to connect to the database, inside quotations marks.
appgen migrate db:sqlite conn:"data source=localdb.sqlite"
Will execute the migrations for the project and create a localdb.sqlite database file.
when you executed a command, the csproj file of the project will be modified to add the new created files, visual studio maybe will show a message that need to reload the project, after the project reload, you will see the new generated files.
*Mono.TextTemplating for execute the t4 templates (the views,controllers and models are generated by t4 templates), with this the app also will work with mono in linux
*Fluent migrator ( for create the migration classes and to execute the classes to create the database.
*Read a connectionstring from app.config/web.config file for made the migrations
*Improve the scaffold and check how to detect changes or fields add on the model
*Improve the scaffold to add validations and the Simple.Data code to save,update and delete
*The model and the database entities must be in separated class, and the model must inherit from the database entity, in order to apply the migration and modify the entity without affect the model
*I need to add jquery, css and all additional assets to make a complete web app
*Create the database bindings using Simple.Data to complain with de Super Duper Happy Path
Jump to Line
Something went wrong with that request. Please try again.