Code Generator Tool for Anguar
Angular 10/9/8 + .Core WebApi
For running the code.
Hardware Requirements
-
1.6 GHz or faster processor.
-
1 GB of RAM (1.5 GB if running on a virtual machine)
-
50 MB of available hard disk space.
-
5400 RPM hard disk drive.
For .net Core and MsSql service Software Requirements
-
Visual studio Code for compiling and building Angular Code and core ,net code.
-
Sql Server 2012 or above for DB
Software Requirements for Php Rest Api
-
Visual studio Code for compiling and building Angular Code.
-
Any PHP editors or Notepad++.
For running PHP on Server
The PHP is the default scripting language implemented with the Apache or any other web server installed at the server where the php should be executed.
If your server supports PHP, then you do not need to do anything. Just create your .php files, put them in your web directory and the server will automatically parse them for you.
Software Requirements For Asp.net Web Api
-
Visual studio Code for compiling and building Angular Code.
-
Visual Studio 2015 or above for building and running the web api.
-
Sql Server 2012 or above for DB
Two folders
-
Application folder : Contains the exe for doing the code generation and the required dlls etc.
-
Help folder : Contains the help document.
-
Open the application folder
-
Click on the AngularCodezenClient.exe as shown in the below image

New project :
To create a new project click on the File-->New.
The below form will appear.
The select the required Angulr version and the service
Provide the Database connection string to connect to the DB. If the DB is MySql you need to provide the database name also.

It will fetch the database schema and populate tables with the felds.

After setting the required properties we can save the project for future use. The file will be save in json format.
Click on File->Save

File-->Open
We can open the saved project file by click on File->open
File-->Set Download Path
And after completing the code generation the generated copied to the given destination folder.
Click on Done to save them.

After setting the properties for the forms and the field (tables and fields), need to check for any errors.
The basic rules it checks for is
-
Each and every table should contain only on primary key.
-
Every form should be in a valid Menu.
-
If any of the filed is set as required it should have a Validation message.
-
If thare are Tabs for a form all the fields should be set with forms.
-
If the fileds control type is Combo box it should be set with either Dynamic or Static look should be set.
Once all the rules are set the validation will be success or else the errors will be displayed and needs to be corrected.
Process-->Generate Code
After the validation is successfull click on the Process-->Generate Code. The code will be generated and copied to the destination folder( which was set in the set theame path).

To exclude the tables from generating the code. Select the tables to be excluded. And click on the apply changes. The selected tables will not be used in the code generation. When doing so the previous changes will be lost.

Manage Tabs
Tabs are used to show alternative views of the same group of information in a page. Select the table the tabs need to be added and click on "Add New Tab" and provide the required tab name.

Static lookup service is used for filling the combo boxes with static array of data. Like for filling a combobox with Gender we can create a static lookup with list of Male and Female types. Key is the one which is displayed to the user and the value is for storing to DB etc.
-
Click on the "Add New Lookup Service".Given the service name and click ok.
-
Then select the lookup service from the list box and click on "Add New Lookup".
-
Provide the key and value information.

Manage Dynamic Look Up
Dynamic lookup service is used for filling the combo boxes with data from a table. Need to provide Table from which the data needs to be fetched. Key the filed which is shown in the UI and Value is the one which is stored to DB etc.
-
Click on "Add New Lookup Service".Give the required service name.
-
Click on "Edit".
-
Select the table name from which the data needs to be fetched.
-
Select the key and value fields.Click on "Done" to save the information


-
The generate code will contain the following structure.
-
Angular : contains the Typescript code.
-
NetCore contains the core .net webapi project.
-
The Readme text file contains the instructions to follow.

Setting Net Core WebApi
o Open the CoreWebApi Solution (\NetCore\CoreWebApi) in the visual studio code.
o In the appsettings.json file change the DBConnectionString to point to your database.
o In the Integrated Terminal Use the command "dotnet run" to run the project.
-
The generate code will contain the following structure.
-
Angular : contains the Typescript code.
-
WebApi contains the core .net webapi project.
-
DB.Sql : Contains the stored procedures
-
The Readme text file contains the instructions to follow.

Open the Dd.Sql file from the downloaded zip file. And execute the SPs in the Database using the query window.
-
Open the WebApi Solution (\WebApi\WebApi\WebApplication1) in the visual studio 2015 or above.
-
Open the Package Manager Console from Tools->Nuget Pacakage Manager-> Package Manager Console

-
Run the following command to update the required nuget packages.
-
Update-Package Microsoft.AspNet.WebApi -reinstall

In the web.config file you can change the database connection string if needed by changing myConnectionString

Generated Code contents for Php Rest Api
-
The generate code will contain the following structure.
-
Angular : contains the Typescript code.
-
Php contains theRest api scripts.
-
The Readme text file contains the instructions to follow.
-
Open the database.php form the generated files.
-
Replace the "hostName" in line number 4 with your Mysql hostname. If there is a port number include in it.
-
Replace "DBName" in line five with the your mysql db name.
-
Replace "UserName" with the username to connect to your DB.
-
Replace the "Password" in line number 7 with the password to connect to the DB.

-
Save the database.php file.
-
Upload all the files to webserver or any where you want to rum them.
Generated Code contents for .Net Core Web Api with MongoDB
The generate code will contain the following structure.
-
Angular : contains the Typescript code.
-
NetCore contains the core .net webapi project.
-
The Readme text file contains the instructions to follow.
-
Open the project in the visual studio code.
-
Open the appsettings.json file form the generated files.
-
Replace the "ConnectionString" and "DatabaseName" with your mongoDB.

And run the project by Selecting Run-> Start Debugging.

Generated Code contents for .NodeJs ExpressJs With MongoDB
The generate code will contain the following structure.
-
Angular : contains the Typescript code.
-
NodeExpressMongo contains the NodeJs With MongoDB.
-
The Readme text file contains the instructions to follow.
Setting .NodeJs ExpressJs Rest Api and Running
-
Open the project in visual studio code.
-
Open the main.js from the config folder
-
Replace the database with your databse name.

And open the termilan and run "npm installl" command


After installing the node_modules
Run the command "npm start"
-
Open the project in Visual studio code by pointing to Angular\Theame folder.
-
Open the Integrated terminal from View->Integrated Terminal.

-
Run the following command to install required the ngModules. Will install all the required packages.
-
npm install --save-dev @angular-devkit/build-angular
-
will install all the required NgModules.

Open the file environment.ts from src->environments-> environment.ts.
o Change the "apiHost" path to point to your hosted url. "http://localhost:4200/api" to your url.
'In the Integrated Terminal Use ng serve –open to run the project.
Run the Angular project
In the Integrated Terminal Use ng serve –open to run the project.