App's Fair
App's Fair
Objective: The aim of this project is to build a dynamic website to sell software products online,
utilizing ASP.NET and JSP technologies. The platform will allow developers or sellers to upload,
manage, and showcase their software products, while users will have the ability to browse and
purchase these products.
The key objectives are:
1. Design a user-friendly frontend with HTML for managing software listings.
2. Implement server-side processing with ASP.NET (for Windows) and JSP (for Java-based
servers).
3. Employ a relational database (like SQL Server or MySQL) to maintain records such as
product names, versions, prices, descriptions, and stock status.
4. Offer a structured platform for adding, viewing, and buying software products
efficiently.
System architecture:
Fig-2: Visual
App’s Fair Codebase:
Controllers/HomeController.cs:
using Microsoft.AspNetCore.Mvc;
using AppsFair.Models;
using AppsFair.Data;
using Microsoft.AspNetCore.Http;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace AppsFair.Controllers
{
public class HomeController : Controller
{
private readonly AppsFairContext _ctx;
if (!Directory.Exists(folderPath))
Directory.CreateDirectory(folderPath);
_ctx.Products.Add(item);
await _ctx.SaveChangesAsync();
return RedirectToAction("Index");
}
return View(item);
}
return RedirectToAction("Index");
}
return View(product);
}
await _ctx.SaveChangesAsync();
}
return RedirectToAction("Index");
}
}
}
Data/App’s FairContext.cs:
using System.ComponentModel.DataAnnotations.Schema;
namespace AppsFair.Models
{
public class Product
{
public int Id { get; set; }
Models/Product.cs:
using System.ComponentModel.DataAnnotations.Schema; // For [Column] attribute
namespace AppBazar.Models
{
public class Product
{
public int Id { get; set; }
public string? PhotoPath { get; set; }
public string? Name { get; set; }
Views/Home/AddProduct.cshtml:
@{
ViewData["Title"] = "Add Product";
}
<h2>Add Software</h2>
@{
ViewData["Title"] = "Details";
}
<div style="max-width: 900px; margin: 30px auto; padding: 30px; border:1px solid #ccc; border-radius:15px; box-
shadow: 0 4px 20px rgba(0,0,0,0.15); background:white; display:flex; flex-wrap:wrap; gap:30px; align-items:center;">
<div style="margin-top:30px;">
<button style="padding:10px 20px; background:#007bff; color:white; border:none; border-radius:5px;"> 🛒 Add
to Cart</button>
<button style="padding:10px 20px; background:#28a745; color:white; border:none; border-radius:5px; margin-
left:10px;">⚡ Buy Now</button>
</div>
<div style="margin-top:30px;">
<a asp-action="Index" style="text-decoration:none; color:#333;">⬅️Back</a>
</div>
</div>
</div>
Views/Home/Edit.cshtml:
@model AppsFair.Models.Product
<h2>Update Product</h2>
<script>
function toggleMenu(id) {
const menu = document.getElementById("menu-" + id);
menu.style.display = (menu.style.display === "block") ? "none" : "block";
}
App’s_Fair.csproj:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>AppsFair</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.0" />
</ItemGroup>
</Project>
Program.cs:
using AppsFair.Data;
using Microsoft.EntityFrameworkCore;
app.UseAuthorization();
app.Run();
appsettings.json:
{
"ConnectionStrings": {
"AppsFairConnection": "Server=(localdb)\\
mssqllocaldb;Database=AppsFairDb;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
Output:
Summary:
App's Fair is a web-based platform designed for software engineers to list, manage, and sell
software products. Built using ASP.NET Core and JSP, the application integrates a MySQL database
for storing product details such as name, description, price and photo.
Key Features:
1. Product Listing Page: Displays all software products dynamically from the database.
2. Add Product Form: Allows users to upload new software products with images.
3. Edit/Delete Products: Enables modifications or removal of existing entries.
4. Product Details Page: Showcases detailed information about each product.
5. Responsive Frontend: Developed using HTML and styled for modern presentation.
6. Visual Branding: The platform was renamed from App's Fair, ensuring a unique identity
across code, comments and UI.
This project provides a complete, functional structure for managing and showcasing digital software
sales, making it easy to scale with further enhancements like user authentication or payment
integration.