├── backend ├── .vs │ ├── backend │ │ ├── FileContentIndex │ │ │ ├── read.lock │ │ │ ├── 5abb3df0-7788-474f-b8d8-8294849ba414.vsidx │ │ │ ├── 709da6fa-206d-4d71-bc1d-7ee88ee45dcc.vsidx │ │ │ ├── a88236e6-3776-449b-806f-6afe13117d63.vsidx │ │ │ └── b74b1431-114f-4bb5-97dc-505a4873c342.vsidx │ │ ├── v17 │ │ │ ├── .suo │ │ │ ├── .wsuo │ │ │ └── .futdcache.v2 │ │ └── DesignTimeBuild │ │ │ └── .dtbcache.v2 │ ├── server │ │ ├── FileContentIndex │ │ │ ├── read.lock │ │ │ ├── 352ded9e-6022-48da-8df6-fdea0968bd98.vsidx │ │ │ ├── 715e4efa-1d4a-4cfe-a07e-9c587a42fe43.vsidx │ │ │ ├── 95302e9c-f47a-43be-9670-f389dc036be4.vsidx │ │ │ └── bd2029c9-8f84-4008-b573-efcc80815d56.vsidx │ │ └── v17 │ │ │ └── .wsuo │ ├── slnx.sqlite │ ├── ProjectEvaluation │ │ ├── backend.metadata.v5.2 │ │ └── backend.projects.v5.2 │ └── VSWorkspaceState.json ├── obj │ ├── Debug │ │ └── net6.0 │ │ │ ├── backend.csproj.CopyComplete │ │ │ ├── backend.csproj.BuildWithSkipAnalyzers │ │ │ ├── backend.MvcApplicationPartsAssemblyInfo.cache │ │ │ ├── backend.AssemblyInfoInputs.cache │ │ │ ├── backend.genruntimeconfig.cache │ │ │ ├── backend.csproj.CoreCompileInputs.cache │ │ │ ├── apphost.exe │ │ │ ├── backend.dll │ │ │ ├── backend.pdb │ │ │ ├── ref │ │ │ └── backend.dll │ │ │ ├── staticwebassets │ │ │ ├── msbuild.buildMultiTargeting.backend.props │ │ │ ├── msbuild.build.backend.props │ │ │ └── msbuild.buildTransitive.backend.props │ │ │ ├── refint │ │ │ └── backend.dll │ │ │ ├── backend.assets.cache │ │ │ ├── backend.csproj.AssemblyReference.cache │ │ │ ├── .NETCoreApp,Version=v6.0.AssemblyAttributes.cs │ │ │ ├── staticwebassets.build.json │ │ │ ├── backend.MvcApplicationPartsAssemblyInfo.cs │ │ │ ├── backend.GlobalUsings.g.cs │ │ │ ├── backend.GeneratedMSBuildEditorConfig.editorconfig │ │ │ └── backend.AssemblyInfo.cs │ ├── Release │ │ └── net6.0 │ │ │ ├── backend.AssemblyInfoInputs.cache │ │ │ ├── backend.assets.cache │ │ │ ├── backend.csproj.AssemblyReference.cache │ │ │ ├── .NETCoreApp,Version=v6.0.AssemblyAttributes.cs │ │ │ ├── backend.GlobalUsings.g.cs │ │ │ ├── backend.GeneratedMSBuildEditorConfig.editorconfig │ │ │ └── backend.AssemblyInfo.cs │ ├── backend.csproj.nuget.g.targets │ ├── backend.csproj.nuget.g.props │ ├── backend.csproj.nuget.dgspec.json │ └── project.nuget.cache ├── bin │ └── Debug │ │ └── net6.0 │ │ ├── Serilog.dll │ │ ├── backend.dll │ │ ├── backend.exe │ │ ├── backend.pdb │ │ ├── Microsoft.OpenApi.dll │ │ ├── Newtonsoft.Json.dll │ │ ├── Newtonsoft.Json.Bson.dll │ │ ├── System.Data.SqlClient.dll │ │ ├── runtimes │ │ ├── win-x64 │ │ │ └── native │ │ │ │ └── sni.dll │ │ ├── win-x86 │ │ │ └── native │ │ │ │ └── sni.dll │ │ ├── win-arm64 │ │ │ └── native │ │ │ │ └── sni.dll │ │ ├── win │ │ │ └── lib │ │ │ │ └── netcoreapp2.1 │ │ │ │ └── System.Data.SqlClient.dll │ │ └── unix │ │ │ └── lib │ │ │ └── netcoreapp2.1 │ │ │ └── System.Data.SqlClient.dll │ │ ├── Microsoft.AspNetCore.JsonPatch.dll │ │ ├── Microsoft.IdentityModel.Logging.dll │ │ ├── Microsoft.IdentityModel.Tokens.dll │ │ ├── Swashbuckle.AspNetCore.Swagger.dll │ │ ├── Swashbuckle.AspNetCore.SwaggerUI.dll │ │ ├── System.IdentityModel.Tokens.Jwt.dll │ │ ├── Microsoft.IdentityModel.Protocols.dll │ │ ├── Swashbuckle.AspNetCore.SwaggerGen.dll │ │ ├── Microsoft.IdentityModel.Abstractions.dll │ │ ├── Microsoft.IdentityModel.JsonWebTokens.dll │ │ ├── appsettings.Development.json │ │ ├── Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll │ │ ├── Microsoft.AspNetCore.Authentication.JwtBearer.dll │ │ ├── Microsoft.IdentityModel.Protocols.OpenIdConnect.dll │ │ ├── appsettings.json │ │ └── backend.runtimeconfig.json ├── appsettings.Development.json ├── Models │ ├── UserLoginRequest.cs │ ├── OrderItem.cs │ ├── Product.cs │ ├── ProductSize.cs │ ├── Order.cs │ └── User.cs ├── Repositories │ ├── IRepository.cs │ └── IListRepository.cs ├── appsettings.json ├── TypeConverter.cs ├── backend.csproj.user ├── backend.csproj ├── Properties │ └── launchSettings.json ├── backend.sln ├── JwtService.cs ├── Controllers │ ├── OrderController.cs │ ├── OrderItemController.cs │ ├── ProductController.cs │ ├── ProductSizeController.cs │ └── UserController.cs ├── Program.cs └── Startup.cs ├── .gitattributes ├── frontend ├── public │ ├── robots.txt │ ├── favicon.ico │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── index.html ├── src │ ├── assets │ │ ├── icons │ │ │ ├── hero.png │ │ │ ├── hero1.png │ │ │ ├── hero2.png │ │ │ ├── facebook.svg │ │ │ ├── instagram.svg │ │ │ ├── icons.js │ │ │ └── twitter.svg │ │ ├── img │ │ │ └── completed.jpg │ │ └── fonts │ │ │ ├── Montserrat-VariableFont_wght.ttf │ │ │ └── Montserrat-Italic-VariableFont_wght.ttf │ ├── components │ │ ├── wishlist │ │ │ └── _wishlist.scss │ │ ├── auth │ │ │ ├── _auth.scss │ │ │ ├── LoginForm.js │ │ │ └── RegisterForm.js │ │ ├── checkout │ │ │ ├── LogIn.js │ │ │ ├── Payment.js │ │ │ ├── Complete.js │ │ │ ├── _confirm.scss │ │ │ ├── Confirmation.js │ │ │ ├── OrderSummary.js │ │ │ ├── Shipping.js │ │ │ └── _checkout.scss │ │ ├── product │ │ │ ├── _filter.scss │ │ │ ├── ProductItem.js │ │ │ ├── _product.scss │ │ │ └── ProductList.js │ │ ├── admin │ │ │ ├── UsersTable.js │ │ │ ├── _admin.scss │ │ │ ├── OrdersTable.js │ │ │ ├── OrderTable.js │ │ │ ├── OrderItemsTable.js │ │ │ ├── SizesTable.js │ │ │ └── ProductsTable.js │ │ ├── account │ │ │ ├── _account.scss │ │ │ ├── EditProfile.js │ │ │ └── MyOrders.js │ │ ├── layout │ │ │ ├── _footer.scss │ │ │ ├── Footer.js │ │ │ ├── Header.js │ │ │ └── _header.scss │ │ ├── home │ │ │ └── _home.scss │ │ └── cart │ │ │ ├── CartItem.js │ │ │ └── _cart.scss │ ├── pages │ │ ├── Shop.js │ │ ├── Wishlist.js │ │ ├── Home.js │ │ ├── Authentication.js │ │ ├── AdminPanel.js │ │ ├── Account.js │ │ ├── Cart.js │ │ ├── Checkout.js │ │ └── ProductDetail.js │ ├── store │ │ ├── store.js │ │ ├── actions │ │ │ ├── orderActions.js │ │ │ ├── userActions.js │ │ │ ├── sizeActions.js │ │ │ └── productActions.js │ │ └── reducers │ │ │ ├── reducers.js │ │ │ ├── orderSlice.js │ │ │ ├── sizeSlice.js │ │ │ ├── wishlistSlice.js │ │ │ ├── userSlice.js │ │ │ ├── productSlice.js │ │ │ └── cartSlice.js │ ├── utils │ │ ├── api │ │ │ ├── variables.js │ │ │ ├── orderApi.js │ │ │ ├── productApi.js │ │ │ ├── orderItemApi.js │ │ │ ├── sizeApi.js │ │ │ └── userApi.js │ │ └── hooks │ │ │ ├── useWishlist.js │ │ │ ├── useSize.js │ │ │ ├── useUser.js │ │ │ ├── useProduct.js │ │ │ ├── useUtil.js │ │ │ └── useCart.js │ ├── reportWebVitals.js │ ├── index.js │ ├── styles │ │ ├── main.scss │ │ ├── _utilities.scss │ │ └── _global.scss │ └── App.js ├── .gitignore ├── package.json └── README.md └── README.md /backend/.vs/backend/FileContentIndex/read.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/.vs/server/FileContentIndex/read.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.csproj.CopyComplete: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.csproj.BuildWithSkipAnalyzers: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.MvcApplicationPartsAssemblyInfo.cache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 7fb580ac5935226850acbb534b0b7a5d226f25ae 2 | -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.genruntimeconfig.cache: -------------------------------------------------------------------------------- 1 | c3ae1b7ac69b1ac82ffd1d172dea6abf638e1cec 2 | -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 6dd538e82bb119b1909a916c9a6c61f0b3a0b124 2 | -------------------------------------------------------------------------------- /backend/obj/Release/net6.0/backend.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 0ec2ec676054acf07573ee4a5afb30cc45394a47 2 | -------------------------------------------------------------------------------- /frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /backend/.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/slnx.sqlite -------------------------------------------------------------------------------- /backend/.vs/backend/v17/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/backend/v17/.suo -------------------------------------------------------------------------------- /backend/.vs/server/v17/.wsuo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/server/v17/.wsuo -------------------------------------------------------------------------------- /frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/frontend/public/favicon.ico -------------------------------------------------------------------------------- /frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/frontend/public/logo192.png -------------------------------------------------------------------------------- /frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/frontend/public/logo512.png -------------------------------------------------------------------------------- /backend/.vs/backend/v17/.wsuo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/backend/v17/.wsuo -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Serilog.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Serilog.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/backend.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/backend.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/backend.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/backend.exe -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/backend.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/backend.pdb -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/apphost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/obj/Debug/net6.0/apphost.exe -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/obj/Debug/net6.0/backend.dll -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/obj/Debug/net6.0/backend.pdb -------------------------------------------------------------------------------- /frontend/src/assets/icons/hero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/frontend/src/assets/icons/hero.png -------------------------------------------------------------------------------- /frontend/src/assets/icons/hero1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/frontend/src/assets/icons/hero1.png -------------------------------------------------------------------------------- /frontend/src/assets/icons/hero2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/frontend/src/assets/icons/hero2.png -------------------------------------------------------------------------------- /backend/.vs/backend/v17/.futdcache.v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/backend/v17/.futdcache.v2 -------------------------------------------------------------------------------- /frontend/src/assets/img/completed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/frontend/src/assets/img/completed.jpg -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/ref/backend.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/obj/Debug/net6.0/ref/backend.dll -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/staticwebassets/msbuild.buildMultiTargeting.backend.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/refint/backend.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/obj/Debug/net6.0/refint/backend.dll -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/staticwebassets/msbuild.build.backend.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Microsoft.OpenApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Microsoft.OpenApi.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.assets.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/obj/Debug/net6.0/backend.assets.cache -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/staticwebassets/msbuild.buildTransitive.backend.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /backend/.vs/backend/DesignTimeBuild/.dtbcache.v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/backend/DesignTimeBuild/.dtbcache.v2 -------------------------------------------------------------------------------- /backend/obj/Release/net6.0/backend.assets.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/obj/Release/net6.0/backend.assets.cache -------------------------------------------------------------------------------- /backend/.vs/ProjectEvaluation/backend.metadata.v5.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/ProjectEvaluation/backend.metadata.v5.2 -------------------------------------------------------------------------------- /backend/.vs/ProjectEvaluation/backend.projects.v5.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/ProjectEvaluation/backend.projects.v5.2 -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Newtonsoft.Json.Bson.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Newtonsoft.Json.Bson.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/System.Data.SqlClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/System.Data.SqlClient.dll -------------------------------------------------------------------------------- /backend/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/runtimes/win-x64/native/sni.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/runtimes/win-x64/native/sni.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/runtimes/win-x86/native/sni.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/runtimes/win-x86/native/sni.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/runtimes/win-arm64/native/sni.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/runtimes/win-arm64/native/sni.dll -------------------------------------------------------------------------------- /frontend/src/assets/fonts/Montserrat-VariableFont_wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/frontend/src/assets/fonts/Montserrat-VariableFont_wght.ttf -------------------------------------------------------------------------------- /frontend/src/components/wishlist/_wishlist.scss: -------------------------------------------------------------------------------- 1 | .wishlist-control{ 2 | a{ 3 | display: block; 4 | margin-bottom: 2rem; 5 | text-decoration: underline; 6 | } 7 | } -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Microsoft.AspNetCore.JsonPatch.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Microsoft.AspNetCore.JsonPatch.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Microsoft.IdentityModel.Logging.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Microsoft.IdentityModel.Logging.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Microsoft.IdentityModel.Tokens.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Microsoft.IdentityModel.Tokens.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Swashbuckle.AspNetCore.Swagger.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Swashbuckle.AspNetCore.Swagger.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Swashbuckle.AspNetCore.SwaggerUI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Swashbuckle.AspNetCore.SwaggerUI.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/System.IdentityModel.Tokens.Jwt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/System.IdentityModel.Tokens.Jwt.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Microsoft.IdentityModel.Protocols.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Microsoft.IdentityModel.Protocols.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Swashbuckle.AspNetCore.SwaggerGen.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Swashbuckle.AspNetCore.SwaggerGen.dll -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/obj/Debug/net6.0/backend.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Microsoft.IdentityModel.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Microsoft.IdentityModel.Abstractions.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /backend/obj/Release/net6.0/backend.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/obj/Release/net6.0/backend.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /frontend/src/assets/fonts/Montserrat-Italic-VariableFont_wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/frontend/src/assets/fonts/Montserrat-Italic-VariableFont_wght.ttf -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll -------------------------------------------------------------------------------- /backend/Models/UserLoginRequest.cs: -------------------------------------------------------------------------------- 1 | namespace backend.Models 2 | { 3 | public class UserLoginRequest 4 | { 5 | public string Email { get; set; } 6 | public string Password { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Microsoft.AspNetCore.Authentication.JwtBearer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Microsoft.AspNetCore.Authentication.JwtBearer.dll -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll -------------------------------------------------------------------------------- /backend/.vs/server/FileContentIndex/352ded9e-6022-48da-8df6-fdea0968bd98.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/server/FileContentIndex/352ded9e-6022-48da-8df6-fdea0968bd98.vsidx -------------------------------------------------------------------------------- /backend/.vs/server/FileContentIndex/715e4efa-1d4a-4cfe-a07e-9c587a42fe43.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/server/FileContentIndex/715e4efa-1d4a-4cfe-a07e-9c587a42fe43.vsidx -------------------------------------------------------------------------------- /backend/.vs/server/FileContentIndex/95302e9c-f47a-43be-9670-f389dc036be4.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/server/FileContentIndex/95302e9c-f47a-43be-9670-f389dc036be4.vsidx -------------------------------------------------------------------------------- /backend/.vs/server/FileContentIndex/bd2029c9-8f84-4008-b573-efcc80815d56.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/server/FileContentIndex/bd2029c9-8f84-4008-b573-efcc80815d56.vsidx -------------------------------------------------------------------------------- /backend/.vs/backend/FileContentIndex/5abb3df0-7788-474f-b8d8-8294849ba414.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/backend/FileContentIndex/5abb3df0-7788-474f-b8d8-8294849ba414.vsidx -------------------------------------------------------------------------------- /backend/.vs/backend/FileContentIndex/709da6fa-206d-4d71-bc1d-7ee88ee45dcc.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/backend/FileContentIndex/709da6fa-206d-4d71-bc1d-7ee88ee45dcc.vsidx -------------------------------------------------------------------------------- /backend/.vs/backend/FileContentIndex/a88236e6-3776-449b-806f-6afe13117d63.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/backend/FileContentIndex/a88236e6-3776-449b-806f-6afe13117d63.vsidx -------------------------------------------------------------------------------- /backend/.vs/backend/FileContentIndex/b74b1431-114f-4bb5-97dc-505a4873c342.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/.vs/backend/FileContentIndex/b74b1431-114f-4bb5-97dc-505a4873c342.vsidx -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/runtimes/win/lib/netcoreapp2.1/System.Data.SqlClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/runtimes/win/lib/netcoreapp2.1/System.Data.SqlClient.dll -------------------------------------------------------------------------------- /frontend/src/pages/Shop.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ProductGrid from '../components/product/ProductList' 3 | 4 | function Shop() { 5 | return ( 6 | 7 | ) 8 | } 9 | 10 | export default Shop -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/runtimes/unix/lib/netcoreapp2.1/System.Data.SqlClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariangle/ecommerce-app-ms-sql-net-react/HEAD/backend/bin/Debug/net6.0/runtimes/unix/lib/netcoreapp2.1/System.Data.SqlClient.dll -------------------------------------------------------------------------------- /backend/.vs/VSWorkspaceState.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExpandedNodes": [ 3 | "", 4 | "\\Controllers", 5 | "\\Models", 6 | "\\Repositories" 7 | ], 8 | "SelectedNode": "\\JwtService.cs", 9 | "PreviewInSolutionExplorer": false 10 | } -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] 5 | -------------------------------------------------------------------------------- /backend/obj/Release/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] 5 | -------------------------------------------------------------------------------- /frontend/src/store/store.js: -------------------------------------------------------------------------------- 1 | import { configureStore } from '@reduxjs/toolkit'; 2 | import rootReducer from './reducers/reducers'; 3 | 4 | 5 | const store = configureStore({ 6 | reducer: rootReducer, 7 | devTools: process.env.NODE_ENV !== 'production' 8 | }); 9 | 10 | export default store; -------------------------------------------------------------------------------- /backend/Repositories/IRepository.cs: -------------------------------------------------------------------------------- 1 | using backend.Models; 2 | 3 | namespace backend.Repositories 4 | { 5 | public interface IRepository 6 | { 7 | IEnumerable GetAll(); 8 | T GetById(int id); 9 | bool Add(T item); 10 | bool Update(T item); 11 | bool Delete(int id); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /frontend/src/assets/icons/facebook.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/staticwebassets.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": 1, 3 | "Hash": "7/yvsnDRTixX0vVer35KSjS1HzfM4rGxA/gc1emwSdw=", 4 | "Source": "backend", 5 | "BasePath": "_content/backend", 6 | "Mode": "Default", 7 | "ManifestType": "Build", 8 | "ReferencedProjectsConfiguration": [], 9 | "DiscoveryPatterns": [], 10 | "Assets": [] 11 | } -------------------------------------------------------------------------------- /backend/Repositories/IListRepository.cs: -------------------------------------------------------------------------------- 1 | using backend.Models; 2 | 3 | namespace backend.Repositories 4 | { 5 | public interface IListRepository 6 | { 7 | IEnumerable GetAll(); 8 | public List GetById(int id); 9 | T GetObjById(int id); 10 | bool Add(T item); 11 | bool Update(T item); 12 | bool Delete(int id); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /frontend/src/utils/api/variables.js: -------------------------------------------------------------------------------- 1 | export const variables = { 2 | BASE_URL: "https://localhost:7089/api/", 3 | USER_API: "https://localhost:7089/api/user", 4 | PRODUCT_API: "https://localhost:7089/api/product", 5 | ORDER_API: "https://localhost:7089/api/order", 6 | PRODUCTSIZE_API: "https://localhost:7089/api/productsize", 7 | ORDERITEM_API: "https://localhost:7089/api/orderitem", 8 | } -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /backend/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "UserAppCon": "Server=10.56.8.36;Database=DB_2023_49;User Id=STUDENT_49;Password=OPENDB_49;TrustServerCertificate=true" 4 | }, 5 | "Logging": { 6 | "LogLevel": { 7 | "Default": "Information", 8 | "Microsoft.AspNetCore": "Warning" 9 | } 10 | }, 11 | "Jwt": { 12 | "Secret": "your_secret_key_here" 13 | }, 14 | "AllowedHosts": "*" 15 | } 16 | -------------------------------------------------------------------------------- /frontend/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "UserAppCon": "Server=10.56.8.36;Database=DB_2023_49;User Id=STUDENT_49;Password=OPENDB_49;TrustServerCertificate=true" 4 | }, 5 | "Logging": { 6 | "LogLevel": { 7 | "Default": "Information", 8 | "Microsoft.AspNetCore": "Warning" 9 | } 10 | }, 11 | "Jwt": { 12 | "Secret": "your_secret_key_here" 13 | }, 14 | "AllowedHosts": "*" 15 | } 16 | -------------------------------------------------------------------------------- /frontend/src/components/auth/_auth.scss: -------------------------------------------------------------------------------- 1 | .auth{ 2 | max-width: 30rem; 3 | @include flex(center, flex-start, column); 4 | h1{ 5 | margin-bottom: 0rem; 6 | } 7 | a{ 8 | text-decoration: underline; 9 | &.active{ 10 | display: none; 11 | } 12 | } 13 | } 14 | 15 | 16 | .login, .register{ 17 | @include flex(center, center, column); 18 | button{ 19 | margin: 2rem 0 1rem; 20 | width: 100%; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /backend/bin/Debug/net6.0/backend.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "net6.0", 4 | "frameworks": [ 5 | { 6 | "name": "Microsoft.NETCore.App", 7 | "version": "6.0.0" 8 | }, 9 | { 10 | "name": "Microsoft.AspNetCore.App", 11 | "version": "6.0.0" 12 | } 13 | ], 14 | "configProperties": { 15 | "System.GC.Server": true, 16 | "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /frontend/src/store/actions/orderActions.js: -------------------------------------------------------------------------------- 1 | import { createAsyncThunk } from '@reduxjs/toolkit'; 2 | import orderApi from '../../utils/api/orderApi'; 3 | 4 | export const fetchOrders = createAsyncThunk( 5 | 'orders/fetchOrders', 6 | async () => { 7 | const orders = await orderApi.getOrders(); 8 | return orders; 9 | } 10 | ); 11 | 12 | export const fetchOrdersByUserId = createAsyncThunk('products/fetchProductById', async (userId) => { 13 | const orders = await orderApi.getOrdersByUserId(userId); 14 | return orders; 15 | }); -------------------------------------------------------------------------------- /frontend/src/components/checkout/LogIn.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { useUser} from "../../utils/hooks/useUser" 3 | import Login from '../auth/LoginForm'; 4 | 5 | function Account() { 6 | const { currentUser } = useUser(); 7 | 8 | return ( 9 |
10 | {currentUser ? ( 11 |
12 |

You are currently logged in as {currentUser.firstName}.

13 |
14 | ) : ( 15 |
16 | 17 |
18 | )} 19 |
20 | ); 21 | } 22 | 23 | 24 | export default Account -------------------------------------------------------------------------------- /backend/obj/backend.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /backend/Models/OrderItem.cs: -------------------------------------------------------------------------------- 1 | namespace backend.Models 2 | { 3 | public class OrderItem 4 | { 5 | public int OrderItemID { get; set; } 6 | public int Quantity { get; set; } 7 | public int OrderID { get; set; } 8 | public int ProductSizeID { get; set; } 9 | 10 | public OrderItem(int orderItemID, int quantity, int orderID, int productSizeID) 11 | { 12 | OrderItemID = orderItemID; 13 | Quantity = quantity; 14 | OrderID = orderID; 15 | ProductSizeID = productSizeID; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /backend/TypeConverter.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace backend 5 | { 6 | public class TypeConverter : JsonConverter 7 | { 8 | public override Type Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 9 | { 10 | throw new NotImplementedException(); 11 | } 12 | 13 | public override void Write(Utf8JsonWriter writer, Type value, JsonSerializerOptions options) 14 | { 15 | writer.WriteStringValue(value.FullName); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /frontend/src/store/reducers/reducers.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from '@reduxjs/toolkit'; 2 | import cartReducer from './cartSlice'; 3 | import productReducer from './productSlice'; 4 | import sizeReducer from './sizeSlice'; 5 | import userReducer from "./userSlice" 6 | import wishlistReducer from "./wishlistSlice" 7 | import searchReducer from "./wishlistSlice" 8 | 9 | const rootReducer = combineReducers({ 10 | cart: cartReducer, 11 | product: productReducer, 12 | productSize: sizeReducer, 13 | user: userReducer, 14 | wishlist: wishlistReducer, 15 | }); 16 | 17 | export default rootReducer; -------------------------------------------------------------------------------- /frontend/src/components/checkout/Payment.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | 3 | function Payment() { 4 | 5 | return ( 6 |
7 |

PAYMENT OPTIONS

8 |
9 |
10 | 14 |
15 |

You will be redirected to PayPal to complete your payment.

16 |
17 | ) 18 | } 19 | 20 | export default Payment; 21 | -------------------------------------------------------------------------------- /frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /backend/backend.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ApiControllerEmptyScaffolder 5 | root/Common/Api 6 | backend 7 | 8 | 9 | ProjectDebugger 10 | 11 | -------------------------------------------------------------------------------- /backend/Models/Product.cs: -------------------------------------------------------------------------------- 1 | namespace backend.Models 2 | { 3 | public class Product 4 | { 5 | public int ProductID { get; set; } 6 | public string Name { get; set; } 7 | public string Brand { get; set; } 8 | public string Description { get; set; } 9 | public string ImageURL { get; set; } 10 | 11 | public Product(int productID, string name, string brand, string description, string imageURL) 12 | { 13 | ProductID = productID; 14 | Name = name; 15 | Brand = brand; 16 | Description = description; 17 | ImageURL = imageURL; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /backend/Models/ProductSize.cs: -------------------------------------------------------------------------------- 1 | namespace backend.Models 2 | { 3 | public class ProductSize 4 | { 5 | public int ProductSizeID { get; set; } 6 | public int Size { get; set; } 7 | public decimal Price { get; set; } 8 | public int Quantity { get; set; } 9 | public int ProductID { get; set; } 10 | 11 | public ProductSize(int productSizeID, int size, decimal price, int quantity, int productID ) 12 | { 13 | ProductSizeID = productSizeID; 14 | Size = size; 15 | Price = price; 16 | Quantity = quantity; 17 | ProductID = productID; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /frontend/src/assets/icons/instagram.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/components/checkout/Complete.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' 3 | import { icons } from '../../assets/icons/icons' 4 | import { useUser} from "../../utils/hooks/useUser" 5 | import { Link } from 'react-router-dom' 6 | 7 | function Complete() { 8 | const { currentUser } = useUser(); 9 | 10 | return ( 11 |
12 | 13 |

Your order is confirmed!

14 |

Thank you for your order, {currentUser.firstName}.

15 | 16 |
17 | ) 18 | } 19 | 20 | export default Complete -------------------------------------------------------------------------------- /frontend/src/pages/Wishlist.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ProductCard from '../components/product/ProductItem'; 3 | import { useWishlist } from '../utils/hooks/useWishlist' 4 | 5 | function Wishlist() { 6 | const { wishlistItems, clearWishlist} = useWishlist(); 7 | 8 | return ( 9 |
10 |
11 | Clear Wishlist 12 |
13 |
14 | {wishlistItems.map((product, index) => 15 | 16 | )} 17 |
18 |
19 | ) 20 | } 21 | 22 | export default Wishlist -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.MvcApplicationPartsAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Swashbuckle.AspNetCore.SwaggerGen")] 15 | 16 | // Generated by the MSBuild WriteCodeFragment class. 17 | 18 | -------------------------------------------------------------------------------- /frontend/src/store/actions/userActions.js: -------------------------------------------------------------------------------- 1 | import { createAsyncThunk } from "@reduxjs/toolkit"; 2 | import userApi from "../../utils/api/userApi"; 3 | 4 | export const getUsers = createAsyncThunk("user/login", async () => { 5 | const users = await userApi.getUsers(); 6 | return users; 7 | 8 | }); 9 | 10 | export const getUser = createAsyncThunk("user/login", async (userId) => { 11 | const user = await userApi.getUser(userId); 12 | return user; 13 | 14 | }); 15 | 16 | export const login = createAsyncThunk("user/login", async (loginData) => { 17 | console.log("in slice", loginData) 18 | const userId = await userApi.login(loginData); 19 | console.log("in slice userid", userId) 20 | return userId; 21 | 22 | }); -------------------------------------------------------------------------------- /frontend/src/assets/icons/icons.js: -------------------------------------------------------------------------------- 1 | import { faUser, faCircleCheck, faHeart as faHeartRegular, faSave, faCreditCard, faAddressCard, faEdit } from '@fortawesome/free-regular-svg-icons'; 2 | import { faBasketShopping, faSearch, faBars, faEnvelope, faLock, faTimes, faHeart as faHeartSolid, faSlidersH } from '@fortawesome/free-solid-svg-icons'; 3 | 4 | export const icons = { 5 | user: faUser, 6 | heart: faHeartRegular, 7 | heartFull: faHeartSolid, 8 | cart: faBasketShopping, 9 | search: faSearch, 10 | edit: faEdit, 11 | hamburger: faBars, 12 | email: faEnvelope, 13 | lock: faLock, 14 | trash: faTimes, 15 | save: faSave, 16 | creditCard: faCreditCard, 17 | idCard: faAddressCard, 18 | check: faCircleCheck, 19 | filter: faSlidersH 20 | }; -------------------------------------------------------------------------------- /frontend/src/pages/Home.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import hero from "../assets/icons/hero2.png" 3 | 4 | function Home() { 5 | return ( 6 | <> 7 |
8 |
9 | 10 |
11 |
12 |
13 |

LIMITED OFFER

14 |

SAVE 10%

15 |

USE DISCOUNT

16 | 17 |
18 |
19 |
20 |

Just arrived...

21 |

Shop brand...

22 |

News letter...

23 |
24 | 25 | ); 26 | } 27 | 28 | export default Home; -------------------------------------------------------------------------------- /backend/backend.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /backend/Models/Order.cs: -------------------------------------------------------------------------------- 1 | namespace backend.Models 2 | { 3 | public enum OrderStatus 4 | { 5 | Pending, 6 | Processing, 7 | Shipped, 8 | Delivered, 9 | Cancelled, 10 | } 11 | 12 | public class Order 13 | { 14 | public int OrderID { get; set; } 15 | public DateTime DateTime { get; set; } 16 | public decimal TotalPrice { get; set; } 17 | public OrderStatus Status { get; set; } 18 | public int UserID { get; set; } 19 | 20 | public Order(int orderID, DateTime dateTime, decimal totalPrice, OrderStatus status, int userID) 21 | { 22 | OrderID = orderID; 23 | DateTime = dateTime; 24 | TotalPrice = totalPrice; 25 | Status = status; 26 | UserID = userID; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.GlobalUsings.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | global using global::Microsoft.AspNetCore.Builder; 3 | global using global::Microsoft.AspNetCore.Hosting; 4 | global using global::Microsoft.AspNetCore.Http; 5 | global using global::Microsoft.AspNetCore.Routing; 6 | global using global::Microsoft.Extensions.Configuration; 7 | global using global::Microsoft.Extensions.DependencyInjection; 8 | global using global::Microsoft.Extensions.Hosting; 9 | global using global::Microsoft.Extensions.Logging; 10 | global using global::System; 11 | global using global::System.Collections.Generic; 12 | global using global::System.IO; 13 | global using global::System.Linq; 14 | global using global::System.Net.Http; 15 | global using global::System.Net.Http.Json; 16 | global using global::System.Threading; 17 | global using global::System.Threading.Tasks; 18 | -------------------------------------------------------------------------------- /backend/obj/Release/net6.0/backend.GlobalUsings.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | global using global::Microsoft.AspNetCore.Builder; 3 | global using global::Microsoft.AspNetCore.Hosting; 4 | global using global::Microsoft.AspNetCore.Http; 5 | global using global::Microsoft.AspNetCore.Routing; 6 | global using global::Microsoft.Extensions.Configuration; 7 | global using global::Microsoft.Extensions.DependencyInjection; 8 | global using global::Microsoft.Extensions.Hosting; 9 | global using global::Microsoft.Extensions.Logging; 10 | global using global::System; 11 | global using global::System.Collections.Generic; 12 | global using global::System.IO; 13 | global using global::System.Linq; 14 | global using global::System.Net.Http; 15 | global using global::System.Net.Http.Json; 16 | global using global::System.Threading; 17 | global using global::System.Threading.Tasks; 18 | -------------------------------------------------------------------------------- /frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import App from './App'; 4 | import reportWebVitals from './reportWebVitals'; 5 | import { BrowserRouter } from 'react-router-dom'; 6 | import { Provider } from 'react-redux'; 7 | import store from './store/store'; 8 | 9 | global.Buffer = global.Buffer || require('buffer').Buffer; 10 | 11 | const root = ReactDOM.createRoot(document.getElementById('root')); 12 | root.render( 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ); 21 | 22 | // If you want to start measuring performance in your app, pass a function 23 | // to log results (for example: reportWebVitals(console.log)) 24 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 25 | reportWebVitals(); -------------------------------------------------------------------------------- /frontend/src/store/reducers/orderSlice.js: -------------------------------------------------------------------------------- 1 | import { createSlice } from "@reduxjs/toolkit"; 2 | import { fetchOrders } from "../actions/orderActions"; 3 | 4 | const initialState = { 5 | orders: [], 6 | status: 'idle', 7 | error: null 8 | } 9 | 10 | const orderSlice = createSlice({ 11 | name: 'orders', 12 | initialState, 13 | reducers: {}, 14 | extraReducers: (builder) => { 15 | builder 16 | .addCase(fetchOrders.pending, (state, action) => { 17 | state.status = 'loading'; 18 | }) 19 | .addCase(fetchOrders.fulfilled, (state, action) => { 20 | state.status = 'succeeded'; 21 | state.orders = action.payload; 22 | }) 23 | .addCase(fetchOrders.rejected, (state, action) => { 24 | state.status = 'failed'; 25 | state.error = action.error.message; 26 | }); 27 | }, 28 | }); 29 | 30 | 31 | export default orderSlice.reducer; 32 | -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = net6.0 3 | build_property.TargetPlatformMinVersion = 4 | build_property.UsingMicrosoftNETSdkWeb = true 5 | build_property.ProjectTypeGuids = 6 | build_property.InvariantGlobalization = 7 | build_property.PlatformNeutralAssembly = 8 | build_property.EnforceExtendedAnalyzerRules = 9 | build_property._SupportedPlatformList = Linux,macOS,Windows 10 | build_property.RootNamespace = backend 11 | build_property.RootNamespace = backend 12 | build_property.ProjectDir = C:\Users\45313\Documents\GitHub\Ecommerce\backend\ 13 | build_property.RazorLangVersion = 6.0 14 | build_property.SupportLocalizedComponentNames = 15 | build_property.GenerateRazorMetadataSourceChecksumAttributes = 16 | build_property.MSBuildProjectDirectory = C:\Users\45313\Documents\GitHub\Ecommerce\backend 17 | build_property._RazorSourceGeneratorDebug = 18 | -------------------------------------------------------------------------------- /backend/obj/Release/net6.0/backend.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = net6.0 3 | build_property.TargetPlatformMinVersion = 4 | build_property.UsingMicrosoftNETSdkWeb = true 5 | build_property.ProjectTypeGuids = 6 | build_property.InvariantGlobalization = 7 | build_property.PlatformNeutralAssembly = 8 | build_property.EnforceExtendedAnalyzerRules = 9 | build_property._SupportedPlatformList = Linux,macOS,Windows 10 | build_property.RootNamespace = backend 11 | build_property.RootNamespace = backend 12 | build_property.ProjectDir = C:\Users\45313\Documents\GitHub\Ecommerce\backend\ 13 | build_property.RazorLangVersion = 6.0 14 | build_property.SupportLocalizedComponentNames = 15 | build_property.GenerateRazorMetadataSourceChecksumAttributes = 16 | build_property.MSBuildProjectDirectory = C:\Users\45313\Documents\GitHub\Ecommerce\backend 17 | build_property._RazorSourceGeneratorDebug = 18 | -------------------------------------------------------------------------------- /backend/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:16804", 8 | "sslPort": 44394 9 | } 10 | }, 11 | "profiles": { 12 | "backend": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "swagger", 17 | "applicationUrl": "https://localhost:7089;http://localhost:5214", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "IIS Express": { 23 | "commandName": "IISExpress", 24 | "launchBrowser": true, 25 | "launchUrl": "swagger", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /frontend/src/assets/icons/twitter.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/pages/Authentication.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import Register from "../components/auth/RegisterForm"; 3 | import Login from "../components/auth/LoginForm"; 4 | 5 | function Authentication() { 6 | const [activeTab, setActiveTab] = useState('login'); 7 | 8 | return ( 9 |
10 |
11 | {activeTab === 'login' && } 12 | {activeTab === 'signup' && } 13 |
14 | 26 |
27 | ); 28 | } 29 | 30 | export default Authentication; 31 | -------------------------------------------------------------------------------- /frontend/src/styles/main.scss: -------------------------------------------------------------------------------- 1 | $lighter-main: #0b92e6; 2 | $color-dark: #222; 3 | $color-grey: #6d6c6c; 4 | $color-lightgrey: #dbdbdb; 5 | $color-smoke: #f6f6f6; 6 | $color-blue: #0070ba; 7 | 8 | @mixin flex($justify, $align, $direction){ 9 | display: flex; 10 | justify-content: $justify; 11 | align-items: $align; 12 | flex-direction: $direction; 13 | } 14 | 15 | @import "global"; 16 | @import "utilities"; 17 | 18 | // components 19 | @import "../components/layout/header"; 20 | @import "../components/layout/footer"; 21 | @import "../components/checkout/confirm"; 22 | @import "../components/product/filter"; 23 | 24 | // pages 25 | @import "../components/wishlist/wishlist"; 26 | @import "../components/account/account"; 27 | @import "../components/admin/admin"; 28 | @import "../components/auth/auth"; 29 | @import "../components/cart/cart"; 30 | @import "../components/checkout/checkout"; 31 | @import "../components/home/home"; 32 | @import "../components/product/product"; 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /frontend/src/utils/hooks/useWishlist.js: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux'; 2 | import { addToWishlist, clearWishlist, removeFromWishlist } from '../../store/reducers/wishlistSlice'; 3 | 4 | export const useWishlist = () => { 5 | const dispatch = useDispatch(); 6 | const wishlistItems = useSelector(state => state.wishlist && state.wishlist.items); 7 | const wishlistCount = wishlistItems.length; 8 | 9 | const toggleWishlistItemHandler = (product) => { 10 | const itemExists = wishlistItems.find((item) => item.productID === product.productID); 11 | if (!itemExists){ 12 | dispatch(addToWishlist(product)); 13 | } else{ 14 | dispatch(removeFromWishlist(product)); 15 | } 16 | }; 17 | 18 | const clearWishlistItemsHandler = () => { 19 | dispatch(clearWishlist()); 20 | }; 21 | 22 | return { 23 | toggleWishlistItem: toggleWishlistItemHandler, 24 | clearWishlist: clearWishlistItemsHandler, 25 | wishlistCount, 26 | wishlistItems, 27 | }; 28 | }; 29 | -------------------------------------------------------------------------------- /frontend/src/utils/api/orderApi.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | import { variables } from './variables.js'; 3 | 4 | const API_URL = variables.ORDER_API 5 | 6 | const getOrders = async () => { 7 | const response = await axios.get(API_URL); 8 | return response.data; 9 | } 10 | 11 | const getOrdersByUserId = async (userId) => { 12 | const response = await axios.get(`${API_URL}/${userId}`); 13 | return response.data; 14 | } 15 | 16 | const createOrder = async (order) => { 17 | const response = await axios.post(API_URL, order); 18 | return response.data; 19 | } 20 | 21 | const updateOrder = async (orderId, order) => { 22 | const response = await axios.put(`${API_URL}/${orderId}`, order); 23 | return response.data; 24 | } 25 | 26 | const deleteOrder = async (orderId) => { 27 | const response = await axios.delete(`${API_URL}/${orderId}`); 28 | return response.data; 29 | } 30 | 31 | export default { 32 | getOrders, 33 | getOrdersByUserId, 34 | createOrder, 35 | updateOrder, 36 | deleteOrder 37 | }; -------------------------------------------------------------------------------- /frontend/src/utils/api/productApi.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | import { variables } from './variables.js'; 3 | 4 | const API_URL = variables.PRODUCT_API 5 | 6 | const getProducts = async () => { 7 | const response = await axios.get(API_URL); 8 | return response.data; 9 | } 10 | 11 | const getProduct = async (productId) => { 12 | const response = await axios.get(`${API_URL}/${productId}`); 13 | return response.data; 14 | } 15 | 16 | const addProduct = async (product) => { 17 | const response = await axios.post(API_URL, product); 18 | return response.data; 19 | } 20 | 21 | const updateProduct = async (productId, product) => { 22 | const response = await axios.put(`${API_URL}/${productId}`, product); 23 | return response.data; 24 | } 25 | 26 | const deleteProduct = async (productId) => { 27 | const response = await axios.delete(`${API_URL}/${productId}`); 28 | return response.data; 29 | } 30 | 31 | export default { 32 | getProducts, 33 | getProduct, 34 | addProduct, 35 | updateProduct, 36 | deleteProduct 37 | }; -------------------------------------------------------------------------------- /frontend/src/pages/AdminPanel.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import Users from '../components/admin/UsersTable'; 3 | import Orders from '../components/admin/OrdersTable'; 4 | import Products from '../components/admin/ProductsTable'; 5 | 6 | const tabs = ['Products', 'Orders', 'Users',]; 7 | 8 | function AdminPanel() { 9 | const [activeTab, setActiveTab] = useState(0); 10 | 11 | const handleTabClick = (index) => { 12 | setActiveTab(index); 13 | }; 14 | 15 | return ( 16 |
17 |
    18 | {tabs.map((tab, index) => ( 19 |
  • handleTabClick(index)} 23 | > 24 | {tab} 25 |
  • 26 | ))} 27 |
28 | {activeTab === 0 && } 29 | {activeTab === 1 && } 30 | {activeTab === 2 && } 31 |
32 | ); 33 | } 34 | 35 | 36 | 37 | export default AdminPanel -------------------------------------------------------------------------------- /frontend/src/components/product/_filter.scss: -------------------------------------------------------------------------------- 1 | .filter-control{ 2 | @include flex(flex-start, center, row); 3 | width: 100%; 4 | gap: 0.5rem; 5 | margin-bottom: 1rem; 6 | select, input{ 7 | margin-bottom: 0rem; 8 | height: 100%; 9 | padding: 0.5rem; 10 | } 11 | } 12 | 13 | .filter-search{ 14 | .input-wrapper{ 15 | max-width: 500px; 16 | margin: auto; 17 | margin-bottom: 2rem; 18 | } 19 | 20 | } 21 | 22 | .filter-div{ 23 | margin-right: 1rem; 24 | a{ 25 | display: block; 26 | padding: 0.25rem; 27 | margin-top: 0.6rem; 28 | transform: translateY(-2px); 29 | } 30 | label{ 31 | margin-right: 0.5rem; 32 | } 33 | } 34 | 35 | .filter-option{ 36 | width: 100%; 37 | display: flex; 38 | } 39 | 40 | .filter-spec{ 41 | @include flex(flex-start, center, row); 42 | p{ 43 | padding: 0 0.5rem; 44 | } 45 | input{ 46 | width: 100px; 47 | } 48 | } 49 | 50 | input[id=maxPrice], input[id=minPrice] { 51 | width: 80px; 52 | } 53 | -------------------------------------------------------------------------------- /backend/obj/Debug/net6.0/backend.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("backend")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("backend")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("backend")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /frontend/src/utils/hooks/useSize.js: -------------------------------------------------------------------------------- 1 | import { useEffect } from 'react'; 2 | import { useDispatch } from 'react-redux'; 3 | import { deleteSize, addSize, updateSize } from '../../store/actions/sizeActions'; 4 | 5 | export const useSize = () => { 6 | const dispatch = useDispatch(); 7 | 8 | useEffect(() => { 9 | }, []); 10 | 11 | const addSizeHandler = ({ size, price, quantity, productId }, e) => { 12 | dispatch(addSize({ size, price, quantity, productId })) 13 | }; 14 | 15 | const updateSizeHandler = ({ sizeId, size }) => { 16 | dispatch(updateSize({ sizeId, size })); 17 | }; 18 | 19 | const deleteSizeHandler = (sizeId, e) => { 20 | e.preventDefault(); 21 | console.log("sizehook", sizeId ) 22 | if (window.confirm("Are you sure you want to delete this size?")) { 23 | dispatch(deleteSize(sizeId)).then(() => { 24 | alert("Size has been deleted."); 25 | }); 26 | } 27 | }; 28 | 29 | return { 30 | addSize: addSizeHandler, 31 | updateSize: updateSizeHandler, 32 | deleteSize: deleteSizeHandler, 33 | }; 34 | }; 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /backend/obj/Release/net6.0/backend.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("backend")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("backend")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("backend")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /frontend/src/components/admin/UsersTable.js: -------------------------------------------------------------------------------- 1 | import userApi from '../../utils/api/userApi'; 2 | import React, { useEffect, useState } from 'react'; 3 | 4 | function Users() { 5 | const [data, setData] = useState([]); 6 | 7 | useEffect(() => { 8 | const fetchData = async () => { 9 | const users = await userApi.getUsers(); 10 | setData(users); 11 | }; 12 | fetchData(); 13 | }, []); 14 | 15 | return ( 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | {data.map((user, index) => ( 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | ))} 36 | 37 |
UserIDFull NameEmailPhoneAddress
{user.userID}{user.firstName} {user.lastName}{user.email}{user.phone}{user.postalCode} {user.city} {user.address}
38 | ); 39 | } 40 | 41 | export default Users; 42 | -------------------------------------------------------------------------------- /frontend/src/utils/api/orderItemApi.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | import { variables } from './variables.js'; 3 | 4 | const API_URL = variables.ORDERITEM_API 5 | 6 | const getOrderItems = async () => { 7 | const response = await axios.get(`${API_URL}`); 8 | return response.data; 9 | }; 10 | 11 | const getOrderItemsByOrderId = async (orderId) => { 12 | const response = await axios.get(`${API_URL}/${orderId}`); 13 | return response.data; 14 | }; 15 | 16 | const addOrderItem = async (orderItemData) => { 17 | const response = await axios.post(`${API_URL}`, orderItemData); 18 | return response.data; 19 | }; 20 | 21 | const updateOrderItem = async (orderItemId, orderItemIata) => { 22 | const response = await axios.put(`${API_URL}/${orderItemId}`, orderItemIata); 23 | return response.data; 24 | }; 25 | 26 | const deleteOrderItem = async (productSizeId) => { 27 | const response = await axios.delete(`${API_URL}/${productSizeId}`); 28 | return response.data; 29 | }; 30 | 31 | export default { 32 | getOrderItems, 33 | getOrderItemsByOrderId, 34 | addOrderItem, 35 | updateOrderItem, 36 | deleteOrderItem 37 | }; -------------------------------------------------------------------------------- /frontend/src/store/reducers/sizeSlice.js: -------------------------------------------------------------------------------- 1 | import { createSlice } from '@reduxjs/toolkit'; 2 | import { fetchProductSizes, addSize } from '../actions/sizeActions'; 3 | 4 | const initialState = { 5 | productSizes: [], 6 | loading: 'idle', 7 | error: null 8 | }; 9 | 10 | export const productSizeSlice = createSlice({ 11 | name: 'productSizes', 12 | initialState, 13 | reducers: { 14 | }, 15 | extraReducers: (builder) => { 16 | builder 17 | .addCase(fetchProductSizes.pending, (state) => { 18 | state.loading = 'pending'; 19 | }) 20 | .addCase(fetchProductSizes.fulfilled, (state, action) => { 21 | const { productId, productSizes } = action.payload; 22 | if (productId === state.productId) { 23 | state.loading = 'idle'; 24 | state.productSizes = productSizes; 25 | } 26 | }) 27 | .addCase(fetchProductSizes.rejected, (state, action) => { 28 | state.loading = 'idle'; 29 | state.error = action.error.message; 30 | }) 31 | } 32 | }); 33 | 34 | export const { } = productSizeSlice.actions; 35 | 36 | export default productSizeSlice.reducer; 37 | -------------------------------------------------------------------------------- /backend/backend.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33110.190 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "backend", "backend.csproj", "{721300E2-7102-49C2-A30F-070B168BB6CB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {721300E2-7102-49C2-A30F-070B168BB6CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {721300E2-7102-49C2-A30F-070B168BB6CB}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {721300E2-7102-49C2-A30F-070B168BB6CB}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {721300E2-7102-49C2-A30F-070B168BB6CB}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {8D18A7A7-DE14-496B-82FE-86B28E381894} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /backend/Models/User.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | 3 | namespace backend.Models 4 | { 5 | public class User 6 | { 7 | public int UserID { get; } 8 | public string FirstName { get; set; } 9 | public string LastName { get; set; } 10 | public string Email { get; set; } 11 | public string Phone { get; set; } 12 | public string Password { get; set; } 13 | 14 | public string Address { get; set; } 15 | public string City { get; set; } 16 | public string PostalCode { get; set; } 17 | 18 | public User(int userId, string firstName, string lastName, string email, string phone, string password, string address = null, string city = null, string postalCode = null) 19 | { 20 | UserID = userId; 21 | FirstName = firstName; 22 | LastName = lastName; 23 | Email = email; 24 | Phone = phone; 25 | Password = password; 26 | Address = address; 27 | City = city; 28 | PostalCode = postalCode; 29 | } 30 | public bool CheckPassword(string password) 31 | { 32 | return Password == password; // temporary 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /frontend/src/store/reducers/wishlistSlice.js: -------------------------------------------------------------------------------- 1 | import { createSlice } from '@reduxjs/toolkit'; 2 | 3 | const wishlistSlice1 = createSlice({ 4 | name: 'wishlist', 5 | initialState: { 6 | items: localStorage.getItem('wishlist') 7 | ? JSON.parse(localStorage.getItem('wishlist')) 8 | : [], 9 | }, 10 | reducers: { 11 | addToWishlist: (state, action) => { 12 | const product = action.payload; 13 | const itemIndex = state.items.findIndex((item) => item.productID === product.productID); 14 | if (itemIndex === -1) { 15 | state.items.push(product); 16 | } 17 | localStorage.setItem('wishlist', JSON.stringify(state.items)); 18 | }, 19 | removeFromWishlist: (state, action) => { 20 | const product = action.payload; 21 | state.items = state.items.filter((item) => item.productID !== product.productID); 22 | localStorage.setItem('wishlist', JSON.stringify(state.items)); 23 | }, 24 | clearWishlist: (state) => { 25 | state.items = []; 26 | localStorage.removeItem('wishlist'); 27 | }, 28 | }, 29 | }); 30 | 31 | export const { addToWishlist, removeFromWishlist, clearWishlist } = 32 | wishlistSlice1.actions; 33 | 34 | export default wishlistSlice1.reducer; 35 | -------------------------------------------------------------------------------- /frontend/src/components/account/_account.scss: -------------------------------------------------------------------------------- 1 | .account{ 2 | padding: 5rem 0; 3 | gap: 5rem; 4 | @include flex(center, flex-start, row); 5 | @media (max-width: 850px) { 6 | padding: 5rem 1rem; 7 | gap: 2rem; 8 | @include flex(flex-start, center, column); 9 | ul{ 10 | @include flex(center, center, row); 11 | li{ 12 | padding: 1rem 1rem 1rem 0rem; 13 | } 14 | } 15 | } 16 | } 17 | 18 | .account-menu{ 19 | li{ 20 | border-bottom: none; 21 | cursor: pointer; 22 | } 23 | li.active { 24 | font-weight: bold; 25 | } 26 | } 27 | 28 | .profile-info, .profile-container{ 29 | width: 100%; 30 | max-width: 500px; 31 | h2, button{ 32 | margin-top: 1rem; 33 | } 34 | input, textarea, select{ 35 | width: 100%; 36 | } 37 | } 38 | 39 | .my-orders-div{ 40 | margin-bottom: 2rem; 41 | } 42 | 43 | .my-orders-about{ 44 | ul{ 45 | gap: 1rem; 46 | display: flex; 47 | margin-bottom: 0.5rem; 48 | li{ 49 | padding: 1rem 00; 50 | @include flex(center, center, row) 51 | } 52 | } 53 | } 54 | 55 | td p { 56 | display: inline; 57 | } -------------------------------------------------------------------------------- /frontend/src/components/layout/_footer.scss: -------------------------------------------------------------------------------- 1 | 2 | .footer{ 3 | padding: 2rem 1rem 1.5rem; 4 | @include flex(center, flex-start, row); 5 | width: 100%; 6 | max-width: 1080px; 7 | margin: auto; 8 | min-height: 10vh; 9 | border-top: 1px solid $color-lightgrey; 10 | @media (max-width: 700px) { 11 | display: block; 12 | } 13 | } 14 | 15 | .footer-section{ 16 | flex: 1 1 12rem; 17 | margin-right: 2rem; 18 | h3{ 19 | font-size: 0.8rem; 20 | margin-bottom: 0.8rem; 21 | } 22 | ul{ 23 | gap: 5rem; 24 | li{ 25 | padding: 0 0 0.5rem 0; 26 | } 27 | li a{ 28 | font-size: 0.7rem; 29 | } 30 | } 31 | @media (max-width: 850px) { 32 | margin-top: 1rem; 33 | } 34 | 35 | } 36 | 37 | .footer-socials{ 38 | flex: 3 1 30rem; 39 | flex-direction: row; 40 | display: flex; 41 | align-items: flex-start; 42 | justify-content: flex-end; 43 | gap: 1rem; 44 | @media (max-width: 1000px) { 45 | flex: 1 1 20rem; 46 | } 47 | } 48 | 49 | .social-icon-container{ 50 | border: 1px solid $color-grey; 51 | padding: 0.3rem ; 52 | border-radius: 50%; 53 | a{ 54 | @include flex(center, center, row); 55 | img{ 56 | height: 24px; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /frontend/src/components/checkout/_confirm.scss: -------------------------------------------------------------------------------- 1 | .order-summary{ 2 | color: $color-grey; 3 | background: $color-smoke; 4 | border: 1px solid $color-lightgrey; 5 | padding: 1rem; 6 | width: 100%; 7 | margin-top: 1rem; 8 | button{ 9 | border-radius: 0px; 10 | } 11 | .line{ 12 | background: $color-lightgrey; 13 | } 14 | @media (max-width: 850px) { 15 | flex-wrap: wrap-reverse; 16 | margin: 1rem 0 0 0; 17 | max-width: none; 18 | width: 100%; 19 | } 20 | } 21 | 22 | .checkout-right{ 23 | @include flex(flex-start, flex-start, column); 24 | width: 100%; 25 | max-width: 300px; 26 | margin-left: 2rem; 27 | } 28 | 29 | .payment-method{ 30 | width: 100%; 31 | margin-bottom: 1rem; 32 | } 33 | 34 | .discount-code{ 35 | @include flex(space-between, center, row); 36 | gap: 1rem; 37 | width: 100%; 38 | margin-top: 1rem; 39 | button, input{ 40 | border-radius: 0px; 41 | margin: 0; 42 | } 43 | button{ 44 | border: none; 45 | } 46 | } 47 | 48 | 49 | .complete{ 50 | width: 100%; 51 | @include flex(center, center, column); 52 | svg{ 53 | color: $color-blue; 54 | height: 100px; 55 | margin: 4rem 0 1rem; 56 | } 57 | button{ 58 | margin-top: 1rem; 59 | } 60 | } -------------------------------------------------------------------------------- /frontend/src/components/product/ProductItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | import { icons } from '../../assets/icons/icons'; 4 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; 5 | import { useWishlist } from '../../utils/hooks/useWishlist'; 6 | import { formatPrice } from '../../utils/hooks/useUtil'; 7 | 8 | function ProductCard({product, index}) { 9 | const { wishlistItems, toggleWishlistItem } = useWishlist(); 10 | const itemExists = wishlistItems.find((item) => item.productID === product.productID); 11 | 12 | return ( 13 | <> 14 | {product.inStock && 15 |
16 | toggleWishlistItem(product)} 19 | /> 20 |
21 | 22 |
23 |
24 | 25 |

{product.brand}

26 |

{product.name}

27 |

{formatPrice(product.defaultPrice)}

28 | 29 |
30 |
31 | } 32 | 33 | );} 34 | 35 | export default ProductCard; -------------------------------------------------------------------------------- /frontend/src/utils/api/sizeApi.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | import { variables } from './variables.js'; 3 | 4 | const API_URL = variables.PRODUCTSIZE_API 5 | 6 | const getProductSizes = async () => { 7 | const response = await axios.get(`${API_URL}`); 8 | return response.data; 9 | }; 10 | 11 | const getProductSizesByProductId = async (productId) => { 12 | const response = await axios.get(`${API_URL}/${productId}`); 13 | return response.data; 14 | }; 15 | 16 | const getProductSize = async (productSizeId) => { 17 | const response = await axios.get(`${API_URL}/${productSizeId}/size`); 18 | return response.data; 19 | }; 20 | 21 | const addProductSize = async (productSizeData) => { 22 | const response = await axios.post(`${API_URL}`, productSizeData); 23 | return response.data; 24 | }; 25 | 26 | const updateProductSize = async (productSizeId, productSizeData) => { 27 | const response = await axios.put(`${API_URL}/${productSizeId}`, productSizeData); 28 | console.log("in api", response) 29 | return response.data; 30 | }; 31 | 32 | const deleteProductSize = async (productSizeId) => { 33 | const response = await axios.delete(`${API_URL}/${productSizeId}`); 34 | return response.data; 35 | }; 36 | 37 | export default { 38 | getProductSizes, 39 | getProductSizesByProductId, 40 | getProductSize, 41 | addProductSize, 42 | updateProductSize, 43 | deleteProductSize 44 | }; -------------------------------------------------------------------------------- /frontend/src/utils/hooks/useUser.js: -------------------------------------------------------------------------------- 1 | import { useEffect } from "react"; 2 | import { useDispatch, useSelector } from "react-redux"; 3 | import { getUsers, getUser, login } from "../../store/actions/userActions"; 4 | import { selectCurrentUser, selectError, selectIsLoading, selectToken, setUser } from "../../store/reducers/userSlice"; 5 | 6 | export const useUser = () => { 7 | const dispatch = useDispatch(); 8 | const token = useSelector(selectToken); 9 | const currentUser = useSelector(selectCurrentUser); 10 | const isLoading = useSelector(selectIsLoading); 11 | const error = useSelector(selectError); 12 | 13 | const getUsersHandler = async () => { 14 | await dispatch(getUsers()); 15 | }; 16 | 17 | const getUserHandler = async (userId) => { 18 | await dispatch(getUser(userId)); 19 | }; 20 | 21 | const loginHandler = async (loginData) => { 22 | const { payload: userId } = await dispatch(login(loginData)); 23 | const { payload: user } = await dispatch(getUser(userId)); 24 | if (user){ 25 | dispatch(setUser(user)); 26 | } 27 | return user; 28 | }; 29 | 30 | useEffect(() => { 31 | if (token) { 32 | } 33 | }, [token]); 34 | 35 | return { 36 | getUsers: getUsersHandler, 37 | getUser: getUserHandler, 38 | login: loginHandler, 39 | // logout: logoutHandler, 40 | token, 41 | currentUser, 42 | isLoading, 43 | error }; 44 | }; 45 | -------------------------------------------------------------------------------- /frontend/src/components/checkout/Confirmation.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react' 2 | import OrderSummary from './OrderSummary' 3 | import CartItem from "../cart/CartItem"; 4 | import { useUser} from "../../utils/hooks/useUser" 5 | import { useCart } from "../../utils/hooks/useCart" 6 | 7 | 8 | function Confirmation({onPaymentComplete}) { 9 | const { currentUser } = useUser(); 10 | const { discount, applyDiscount } = useCart(); 11 | const [discountCode, setDiscountCode] = useState(''); 12 | 13 | return ( 14 |
15 |
16 |

REVIEW YOUR ORDER

17 |
18 | 19 |
20 |
21 |

SHIPPING ADDRESS

22 |
23 |

{currentUser?.firstName} {currentUser?.lastName}

24 |

{currentUser?.address}

25 |

{currentUser?.postalCode} {currentUser?.city}

26 |

Denmark

27 | { !discount > 0 && 28 |
29 | setDiscountCode(e.target.value)} /> 30 | 31 |
32 | } 33 | 34 |
35 |
36 | ) 37 | } 38 | 39 | export default Confirmation -------------------------------------------------------------------------------- /frontend/src/App.js: -------------------------------------------------------------------------------- 1 | import './styles/main.scss'; 2 | // import components 3 | import Header from './components/layout/Header'; 4 | import Footer from './components/layout/Footer'; 5 | // import pages 6 | import Home from "./pages/Home"; 7 | import Shop from './pages/Shop'; 8 | import ProductPage from './pages/ProductDetail'; 9 | import CartPage from "./pages/Cart" 10 | import CheckoutPage from './pages/Checkout'; 11 | import Admin from "./pages/AdminPanel" 12 | import Account from './pages/Account'; 13 | import Authentication from './pages/Authentication'; 14 | import Wishlist from './pages/Wishlist'; 15 | 16 | import { Routes, Route, useLocation } from 'react-router-dom'; 17 | 18 | 19 | function App() { 20 | const location = useLocation(); 21 | const showHeaderFooter = location.pathname !== '/checkout'; 22 | 23 | return ( 24 | <> 25 | {showHeaderFooter &&
} 26 | 27 | } /> 28 | } /> 29 | } /> 30 | } /> 31 | } /> 32 | } /> 33 | } /> 34 | } /> 35 | } /> 36 | 37 | {showHeaderFooter &&