https://brake.azurewebsites.net/
An ASP.NET CORE MVC platform to buy/sell cars
Features & Concepts
MVC
-Model,View,Control is a design pattern commonly used. The organization of files is important (shown in image above)
-Model: contains classes, objects, schemas for database
-View: contains HTML and CSS that renders pages
-Control: contains controllers
How it works:
When a browser sends a request, it is routed to the controller. The controller contains various CRUD operations to handle this request. THe controller will call upon the models to access data and call upon the corresponding view .cshtml file that contains the webpage's render code. THe controller then sends back this information to the browser and a webpage is loaded. Note that the model and view do not directly communicate with each other, the controller is like an intermediary to these two.
Migrations, Entity ORM
THe above is a dbcontext which is a class provided by Entity as a gateway to the DBset which queries the database in runtime.
on the NuGET package manager console:
Add-migration
update-database
These commands perform a migration where the Schema in the SQL server is updated according to the current DbContext. Entity framework helps in automating DB relating activites.
SSMS(SQL Server Management Studio) and Backend DB:
SSMS was very useful during development to inspect the state of both the local SQL server and the SQL server in the Azure Cloud.
Create: Add a new Model/Car/Make to database
Read: Read a new Model/Car/Make from database
Update: edit Model/Car/Make in database
Delete: delete entry from database
All operations other than Read are only available to admin after login
Authentication & AUthorization
login page
logged in page
admin edit privilege
Client and Server side data validation
used data annotations/attributes above properties for type checking
If user does not enter the required fields, the text-danger will render in real time.
Deployment of SQL database and application to Azure
Website: https://brake.azurewebsites.net/