How junkin3/webnews works
Project Type and Purpose
• This is a full-stack ASP.NET WebForms application (“WebNews”) for publishing and managing news articles.
• The UI is delivered via .aspx pages (e.g., Default.aspx, DangTin.aspx) with C# code-behind, static assets (CSS, JS, SCSS) and client plugins (owlCarousel, easing).
• Data is stored in a SQL Server Express MDF file under App_Data. External integrations include SendGrid for email and BCrypt.Net for password hashing.
File-Structure Insights
• Top-level presentation layer:
• .aspx/.aspx.cs pages
• css/ (compiled CSS from SCSS)
• js/ (custom JS)
• lib/ (third-party client libraries: owlCarousel, easing)
• scss/ (Bootstrap source + custom styles)
• Backend & configuration:
• Web.config, website.publishproj, PublishProfiles (FTP/Web Deploy)
• Bin/ (compiled DLLs & XML docs for SendGrid, BCrypt.Net, JSON, MVC artifacts)
• packages/ (NuGet packages for MVC, Razor, Roslyn, SendGrid, BCrypt, NewtonSoft.Json)
• Data layer:
• App_Data/Database.mdf & SQL scripts (dbo.Tin.data.sql)
• Solution file: WebNews.sln
Key Components
a. Client Browser
• Requests pages, loads static assets, invokes JS plugins.
b. Web Server (IIS) Hosting ASP.NET WebForms
• ASP.NET runtime processes .aspx, invokes C# code-behind.
• MVC assemblies are present but not actively used (no Controllers folder).
c. Business Logic Layer
• Code-behind methods handle authentication (DangNhap.aspx.cs), registration (Dangki.aspx.cs), article CRUD (DangTin.aspx.cs, ChinhSuaTin.aspx.cs), search (TimKiem.aspx.cs).
• Utilities: BCrypt.Net for hashing, SendGrid API for confirmation emails (ConfirmReg.aspx.cs).
d. Data Access Layer
• ADO.NET or built-in SQL client connecting to Database.mdf via connection string in Web.config.
• SQL scripts for schema and initial data.
e. Database
• SQL Server Express MDF in App_Data. Contains Tin (news) table.
f. External Services
• SendGrid REST API for transactional emails.
• Potential file storage for images (referenced via Tin_addImage.data.sql).
Relationships & Data Flow
• Within ASP.NET: Presentation → calls Business Logic (code-behind) → Data Access → SQL Server
• Code-behind may call SendGrid API asynchronously → External Email Service → Client receives confirmation.
• Static assets (CSS/JS) served directly by IIS → Client browser renders UI.
Architectural Patterns & Principles
• 3-Tier architecture (Presentation / Business Logic / Data)
• Separation of concerns:
• UI components (.aspx) vs. server logic (.cs) vs. database
• Security: password hashing (BCrypt), email verification (SendGrid)
• Plug-in architecture on the frontend (owlCarousel, easing)
Essential Elements Checklist
• Callouts for major NuGet packages (SendGrid, BCrypt, MVC assemblies)
• Notes on deployment profiles (FTP/Web Deploy) if relevant