FashionClothesAndTrends is a comprehensive web application designed to help users discover, purchase, and manage the latest fashion trends. The application offers a wide range of features including browsing clothing items, managing wishlists, applying discount coupons, user authentication, and much more.
- User Authentication and Authorization: Secure login and registration.
- Clothing Items Management: Browse, search, and manage clothing items.
- Wishlist Management: Add items to wishlist and manage them.
- Comments and Reviews: Add and view comments on clothing items.
- Favorites: Mark clothing items as favorites and manage them.
- Likes and Dislikes: Like or dislike comments.
- Order Management: Create and manage orders.
- Order History: View order history.
- Payments: Handle payments and payment intents.
- Notifications: Notify users about discounts on wishlist items.
- Photo Management: Upload and manage photos for clothing items.
- Ratings: Rate clothing items.
-
Backend Architecture: The backend of our application is structured using a Clean Architecture, ensuring a clean separation of concerns and a maintainable codebase.
-
Frontend Framework: Angular, a robust platform for building web applications, is used for the frontend. It allows us to structure our codebase in a modular and maintainable manner.
-
UI Components: For the user interface, we have chosen Angular Material. It's a UI component library that adheres to Material Design principles and offers a wide array of ready-to-use components.
-
Caching: Redis, an open-source in-memory data structure store, is used for caching. It serves as a database, cache, and message broker.
- ASP.NET Core 8: A framework for building web applications and APIs.
- Entity Framework Core 8: An ORM for working with relational databases.
- RESTful API: An architectural style for creating APIs.
- Relational Database: SQL Server: A relational database for data storage.
- Distributed Cache: Redis: A distributed cache for improving performance and scalability.
- Clean Architecture: An architectural approach that ensures separation of concerns and framework independence.
- S.O.L.I.D. Principles: Object-oriented design principles for creating flexible and maintainable systems.
- Unit of Work and Repository Pattern: Patterns for managing transactions and abstracting data access.
- AutoMapper: A library for automatic object mapping.
- SignalR: A library for adding real-time functionality such as notifications.
- Client-side: Angular with Angular Material: A framework and UI component library for building client-side applications.
To run this project, you need to create an appsettings.json file in the WebAPI section with the following structure:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultDockerDbConnection": "Server=sql_server2022,1433;Database=FashionClothesAndTrendsDB;User Id=sa;Password=MyPass@word90_;MultipleActiveResultSets=true;TrustServerCertificate=True",
"DefaultLocalDbConnection": "Server=(localdb)\\MSSQLLocalDB;Database=FashionClothesAndTrendsDB;MultipleActiveResultSets=true",
"Redis": "redis:6379,abortConnect=false",
"RedisLocalDb": "localhost:6379,abortConnect=false"
},
"Token": {
"Key": "<......>",
"Issuer": "https://localhost:5001",
"Audience": "https://localhost:5001"
},
"CloudinarySettings": {
"CloudName": "<.....>",
"ApiKey": "<.....>",
"ApiSecret": "<.....>"
},
"StripeSettings": {
"PublishableKey": "<.....>",
"SecretKey": "<.....>",
"WhSecret": "<.....>"
}
}
Replace "" with your actual data respectively.
The application allows you to choose between running with a local database (localdb
) or fully within Docker using SQL Server.
If you want to use localdb
instead of Docker for the database, follow these steps:
-
Open the
appsettings.json
file in theWebAPI
project. -
Set the connection string for
DefaultLocalDbConnection
example:"ConnectionStrings": { "DefaultLocalDbConnection": "Server=(localdb)\\MSSQLLocalDB;Database=FashionClothesAndTrendsDB;MultipleActiveResultSets=true", "RedisLocalDb": "localhost:6379,abortConnect=false" }
-
Modify the ApplicationServicesExtensions.cs file (or the corresponding file where services are configured). Ensure that the application is using DefaultLocalDbConnection for SQL Server and RedisLocalDb for Redis.
-
Make sure Redis is running locally. You can run Redis using Docker (run the application using docker-compose.yml).
-
After configuring the appsettings.json file and ApplicationServicesExtensions.cs you need to run docker-compose.yml.
-
Open the appsettings.json file in the WebAPI project.
-
Set the connection strings for DefaultDockerDbConnection and Redis example:
"ConnectionStrings": { "DefaultDockerDbConnection": "Server=sql_server2022,1433;Database=FashionClothesAndTrendsDB;User Id=sa;Password=MyPass@word90_;MultipleActiveResultSets=true;TrustServerCertificate=True", "Redis": "redis:6379,abortConnect=false" }
-
For running ASP.NET core with HTTPS inside of docker, you need to generate a self-signed certificate. You can do this by running the following command in your terminal:
dotnet dev-certs https -ep $env:USERPROFILE/.aspnet/https/aspnetapp.pfx -p MyPass@word90_
dotnet dev-certs https --trust
Then open the appsettings.json file in the WebAPI project again and insert these lines:
,
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://+:443",
"Certificate": {
"Path": "/https/aspnetapp.pfx",
"Password": "MyPass@word90_"
}
}
}
}
- Modify the ApplicationServicesExtensions.cs file (or the corresponding file where services are configured) to use DefaultDockerDbConnection for SQL Server and Redis for Redis:
public static IServiceCollection AddApplicationServices(this IServiceCollection services, IConfiguration config)
{
services.AddDbContext<ApplicationDbContext>(options =>
{
options.UseSqlServer(config.GetConnectionString("DefaultDockerDbConnection"));
});
services.AddSingleton<IConnectionMultiplexer>(c =>
{
var redisOptions = ConfigurationOptions.Parse(config.GetConnectionString("Redis"), true);
return ConnectionMultiplexer.Connect(redisOptions);
});
return services;
}
- Run the application using Docker by executing the following command in your terminal:
docker-compose -f docker-compose.debug.yml up --build
This will start all the services, including SQL Server and Redis, in Docker containers.
- Ensure your docker-compose.debug.yml file are properly configured to start the necessary services for SQL Server, Redis, and the WebAPI.
Email: admin@example.com
Password: Pa$$w0rd
Contributions are welcome. Please fork the repository and create a pull request with your changes.
Bohdan Harabadzhyu