An example project using ASP.NET Core and Angular, representing a contact list with CRUD functionality using a REST API.
Frontend: Angular
, Bootstrap
Backend/API: ASP.NET Core
, Entity Framework Core
Database: SQLite
-
angularapp
- Angular project root foldersrc
app
contactlist
add
- Component containing the "Add Contact" viewedit
- Component containing the "Edit Contact" viewindex
- Component containin the main view; lists the basic information of all contacts in the databaseview
- Component containing the "Contact Details" viewcontact.ts
- Interface describing a contact from the databasecontact.service.ts
- Service for sending requests to the API through HTTPcontactlist-routing.module.ts
- Routing configuration; binds paths to specific components
-
webapi
- ASP.NET project root folderControllers
ContactsController.cs
- REST API controller, handling database queries
Migrations
- Folder for the generated Migrations from the database contextModels
Contact.cs
- Database model of the Contact table
ContactsDatabaseContext.cs
- Database structure description for database generation
-
Generate a new database file using NuGet
Update-Database
or Place an existing database file in thewebapi
folder -
Open a terminal window/tab
-
Navigate to the
webapi
folder from project root -
Run the commands:
dotnet restore dotnet build dotnet watch run
-
Open a second terminal window/tab
-
Navigate to the
angularapp
folder from project root -
Run the commands:
npm install npm run build npm run start
-
Go to
localhost:4200
in your internet browser