BeautyApp is a comprehensive ASP.NET Core application featuring user authentication, product management, shopping cart functionality, and order processing.
- Features
- Technologies Used
- Setup
- Building and Running
- Project Structure
- Database Integration
- User Roles and Authorization
- Product Filtering
- Order Management
- User authentication (Admin and Customer roles)
- Product management (CRUD operations)
- Shopping cart functionality
- Order processing
- Product filtering
- Access denied page for unauthorized access
- User profile management
- ASP.NET Core MVC
- Entity Framework Core
- SQL Server
- Bootstrap
- Identity
- .NET SDK (version 5.0 or later)
- SQL Server
- Visual Studio (recommended)
git clone https://github.com/yourusername/BeautyApp.git
cd BeautyApp
- Update the connection string in appsettings.json:
"ConnectionStrings": {
"DefaultConnection": "Server=your_server;Database=BeautyApp;User Id=your_user;Password=your_password;"
}
- Create the database and apply migrations: [Not needed if the database doesn't exist in your servers]
dotnet ef database update
To seed the database with initial data, add seed data in the ApplicationDbContext class. This could include default admin users, products, etc.
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
// Your DbSet properties
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
// Seed data here
// Example:
builder.Entity<Product>().HasData(
new Product { Id = 1, Name = "Product1", Price = 10.0 },
new Product { Id = 2, Name = "Product2", Price = 20.0 }
);
}
}
dotnet build
dotnet run
- Open the solution file (BeautyApp.sln).
- Set the project as the startup project.
- Press F5 to build and run the project.
BeautyApp/
├── Controllers/
├── Data/
├── Models/
├── Services/
├── Views/
├── wwwroot/
├── appsettings.json
└── Program.cs
Entity Framework Core handles database integration. Ensure your connection string is updated in appsettings.json and apply migrations using dotnet ef database update.
ASP.NET Core Identity manages authentication with role-based access control for Admin and Customer roles.
Implemented using query parameters and form submissions, allowing dynamic updates to product listings.
Users can place orders, including details like receiver's name, contact number, and address.