GithubHelp home page GithubHelp logo

capesean / codegenerator Goto Github PK

View Code? Open in Web Editor NEW
11.0 7.0 2.0 9.46 MB

Generate EF6 WebApi with an AngularJS font-end

License: MIT License

C# 18.72% CSS 12.89% HTML 7.90% TypeScript 6.59% JavaScript 53.07% SCSS 0.49% Less 0.32% ASP.NET 0.01%
webapi typescript codegenerator entity-framework angularjs asp-net

codegenerator's Introduction

LATEST FOR VERSION see: https://github.com/capesean/codegenerator3

codegenerator

Generate code for an Entity Framework 6 / WebApi, with an AngularJS font-end, using Bootstrap 3 or 4.

Online demo!

A demo of this system is available online at: http://codegenerator.sitedemo.co.za/

You can log into the demo, create your own projects, with entities, fields, relationships, lookups, etc. Then you can view the code that gets generated. It can generate:

  • Model: tied into the EF6 DbContext, so EF will generate & update your tables automatically!
  • DTO: The WebApi will use the DTO to safely export & import data.
  • Controller: A fully fledged WebApi controller with methods like Search/Query, Get, Insert, Update, Delete, Sort, etc.
  • DbContext: codegenerator will link your entities into the DbContext, as well as use the Fluent API for field definitions where attributes are not enough (e.g. decimal precision)
  • SettingsDTO: your enums and general application settings get sent to the AngularJs client on login using a Settings DTO.
  • BundleConfig: codegenerator will automatically add the necessary files to the bundles, so you just have to rebuild after adding an entity, and your project will include the relevant javascript files!
  • Enums: Create enums via codegenerator, which can be used as fields in your tables/entities.
  • AppRouter: Your entities will get added to the AngularJs router, using $stateProvider.
  • ApiResource: each entity gets added as an $resource factory in your app, so you can easily access the API by just injecting the appropriate resource.
  • List Html: codegenerator will produce a search page for the records in your table.
  • List TypeScript: you'll also get the TypeScript file that has the controller for the List Html page.
  • Edit Html: codegenerator will produce an edit page for adding/editing/deleting a record in your database.
  • Edit TypeScript: you'll also get the TypeScript file with the controller for the Edit page.

That just begins to scratch the surface! You can also have lookups, relationships, hierarchies, sort orders, Min/Max lengths on fields, define unique constraints, primary keys, search fields, field behavious (read only/edit-when-new/etc), Code Replacements (which can modify the generated code, so your customised changes are retained), and much more!

If it's running on your own machine, you can deploy the code to your project at the click of a button!

Blog post

There's a (slightly) old blogpost here, that describes the system in a bit more detail: http://capesean.co.za/blog/angularjs-typescipt-webapi-entity-framework-code-generation/

Latest 'project shell'

Note that, to run properly as a project/website, the generated code requires a 'project shell' with the surrounding controllers, stylesheets, directives, packages, etc.

The codegenerator project itself mostly contains these files, as it's (generated by the tool itself)[http://knowyourmeme.com/memes/we-need-to-go-deeper].

However, I don't keep codegenerator's project files fully up to date (I'm not sure how many people are interested in it?), so I just use codegenerator to generate the code to use in other, up-to-date 'project shells'.

If you're interested in using this tool, get in touch with me, and I can provide you with the latest shell. I'm constantly adding new features (like the 'Use Selector Directive' on the Relationships). That feature doesn't exist in the CodeGenerator shell, but I now use it extensively in other projects.

So if you're interested, get in touch via Github or (Twitter)[https://twitter.com/capesean]. I'd love to know that someone else is interested in using this highly-productive tool!

codegenerator's People

Contributors

capesean avatar

Stargazers

Yasin ATEŞ avatar  avatar  avatar  avatar Abdulaziz Alrashed avatar John Lúgaro avatar Ernesto Ruiz avatar Cristi Pufu avatar Halil İbrahim Kalkan avatar Ricardo Andreatto avatar Jeff West avatar

Watchers

Ken Villines avatar  avatar James Cloos avatar  avatar John Lúgaro avatar Keith Blows avatar Ricardo Andreatto avatar

codegenerator's Issues

Database

Been having a look through. Amazing work you have here.

Is there a database to host the entities etc?

Ray

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.