Skip to content

rathi-java/purchase-store-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

✅ Purchase Store App

Repository: purchase-store-app A production-ready Full Stack Purchase Store (Angular frontend + .NET backend) used at PerkMinds. This README gives quick setup, structure, and run instructions for a fresh start (clean history) repository.


🌟 What this project contains

  • Frontend: Angular app (UI, Material, Bootstrap, NgBootstrap) — src/app/components/* (user + admin areas)
  • Backend: ASP.NET Core Web API (PurchaseStore.API) — serves endpoints and static product images
  • Database: SQL Server database schema + seed (FoodApp.sql)
  • Image storage: Project expects product images under a served folder (configured to /images/products/)

🧰 Tech Stack

Layer Technology
Frontend Angular (project uses Angular 14 in this repo), Angular Material, ng-bootstrap, RxJS, SCSS
Backend .NET (TargetFramework: net8.0), Entity Framework Core
Database SQL Server (MSSQL)
Dev tools Node.js 16+ (project used Node v16 in dev logs), npm, Angular CLI, dotnet SDK

⚠️ NOTE: This repo was prepared from an existing worktree and configured for a fresh start commit. Adjust Node/.NET versions to match your environment if needed.


📁 Project structure (high level)

RepoRoot/
├─ frontend/ (Angular app root, previously under Intern2025/Angular)
│  ├─ src/
│  │  ├─ app/
│  │  │  ├─ components/
│  │  │  │  ├─ admin/...
│  │  │  │  └─ user/...
│  │  │  └─ services, material.module.ts, ...
│  │  └─ assets/
│  └─ package.json
├─ backend/ (PurchaseStore.API)
│  ├─ PurchaseStore.API.csproj
│  ├─ Program.cs
│  └─ appsettings.json
├─ sql/
│  └─ FoodApp.sql
└─ README.md

✅ Quickstart (fresh local copy)

Follow these steps from a clean folder. These commands assume you have created a GitHub repo (e.g. https://github.com/rathi-java/purchase-store-app.git).

1) Frontend (Angular)

cd frontend
# install deps
npm install
# serve (dev)
ng serve --open
# default dev URL: http://localhost:4200

If you see engine warnings (jwt-decode wants Node >= 18): either upgrade Node to 18+ or keep Node 16 and accept the warning — the app built and served on Node 16 in dev logs.

2) Backend (ASP.NET Core)

cd backend
# restore & build
dotnet restore
dotnet build
# run using launch settings (development)
dotnet run
# or set custom urls and run:
# set ASPNETCORE_URLS="https://localhost:7299;http://localhost:5099"
# dotnet run --no-launch-profile

Open Swagger (if enabled) once the API starts: http://localhost:7173/swagger/index.html (port may vary per launchSettings)

3) Database (SQL Server)

  • Use SQL Server Management Studio or sqlcmd to run the SQL file.
  • Example: import the FoodApp.sql file into your local SQL Server instance.

If you have the SQL file locally inside repo: sql/FoodApp.sql or the uploaded path: /mnt/data/FoodApp.sql (adjust to your environment).

Example (sqlcmd):

sqlcmd -S <SERVER_NAME> -i ./sql/FoodApp.sql

If your connection string uses Integrated Security=True, make sure SQL Server user has access. Update appsettings.json ConnectionStrings:Db_Connection accordingly.


⚙️ Backend config notes

  • appsettings.json contains Jwt settings (Key, Issuer, Audience) and ConnectionStrings:Db_Connection.
  • Logging via Serilog writes to D:\Logs\log-.txt by default — change path if needed.
  • Static images: backend expects to serve product images under /images/products/<filename>; ensure a static files middleware serves that directory or copy images to the wwwroot/images/products folder.

🧩 How to make images accessible

  1. Create folder (example used during dev): X:\Repo\image\products or backend/wwwroot/images/products
  2. Copy product images to the folder
  3. Configure the API to serve static files (in Program.cs add app.UseStaticFiles(); and map folder if required)
  4. Frontend getImageSrc() expects backend URL http://localhost:7173/images/products/<filename>

🔀 Routing & Frontend notes

  • App routing loads UserModule on default path '' and AdminModule on /admin.
  • The user homepage route is /home inside the UserModule (i.e. /home). If you want root / to display the user home instead of redirecting to /home, update UserRoutingModule or the app-level redirect.

🧪 Common dev commands

  • Frontend lint/test/build: ng build / ng test
  • Backend build/run: dotnet build / dotnet run
  • Fresh Git start (if you want to replace history locally): see the project setup script used when initializing this repository.

📌 Tips & gotchas

  • If Angular complains about missing Mat modules, ensure MaterialModule exports the required components or import Material modules in UserModule.
  • If API gives ERR_SSL_PROTOCOL_ERROR on frontend requests, run backend in HTTPS with a trusted dev cert: dotnet dev-certs https --trust and ensure environment.api matches the API origin.
  • If images are stored as Windows absolute paths in DB (e.g. X:\Repo\image\products\pizza1.png), map only filenames to an images folder that the API serves.

👨‍💻 Author

Gourav Rathi — Full Stack Developer GitHub: rathi-java


📄 License

MIT

About

Full Stack Purchase Store built with Angular, .NET Core, and SQL server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors