AI driven full stack application for cosmetic ingredients recognition
C#
0
79 commits
updated Oct 13, 2026
A full-stack web application for cosmetic ingredient safety analysis, with personalisation based on the user's dermatological conditions.
SafeBeauty lets a user enter a cosmetic product — either by scanning its barcode or by pasting the ingredient list — and returns each ingredient with a colour-coded safety rating drawn from EU regulatory data, a plain-language summary of the whole product, and, for signed-in users, personalised warnings tied to their declared skin conditions.
This project was developed as an MSc Software Engineering dissertation at the University of Westminster.
Live demo: https://natashatoul.github.io/SafeBeauty/
The frontend is hosted on GitHub Pages and the backend API on Azure App Service (free tier). The first request after a period of inactivity may take up to a minute while the backend restarts (a cold start); subsequent requests respond normally.
Frontend
Backend
External services
facebook/bart-large-mnli (zero-shot classification of unknown ingredients) and meta-llama/Llama-3.1-8B-Instruct (plain-language summaries)Reference data (in backend/SafeBeauty.API/SeedData)
condition_rules.csv — condition rules derived by hand from published clinical dermatology sourcesSafeBeauty/
├── backend/
│ ├── SafeBeauty.API/ ASP.NET Core Web API
│ │ ├── Controllers/ HTTP endpoints
│ │ ├── Services/ analysis pipeline, AI layer, validators
│ │ ├── Models/ domain entities, parsers, enums
│ │ ├── Data/ DbContext and data seeding
│ │ └── SeedData/ regulatory CSV / TXT source files
│ └── SafeBeauty.API.Tests/ xUnit test suite
├── frontend/ React (Vite) single-page application
│ └── src/
└── evaluation/ AI classifier evaluation
From the repository root:
cd backend/SafeBeauty.API
Configure the required settings. The committed appsettings.json contains placeholders only — provide your own values, ideally through a git-ignored appsettings.Development.json or user secrets:
HuggingFace:ApiKey — your Hugging Face access tokenJwt:Key — any signing key of at least 32 charactersEmailSettings — SMTP credentials, only needed for email verificationThen run:
dotnet run
The API starts on http://localhost:5166. On first start it creates the SQLite database and seeds it from the files in SeedData/, so the initial launch takes a little longer.
In a second terminal, from the repository root:
cd frontend
npm install
npm run dev
The app is served at the URL printed by Vite (default http://localhost:5173). Vite proxies /api requests to the backend on http://localhost:5166, so both must be running.
Backend (xUnit):
cd backend
dotnet test
Frontend (Vitest):
cd frontend
npm run test:vitest
| Area | File |
|---|---|
| Analysis pipeline (orchestrator) | backend/SafeBeauty.API/Services/IngredientAnalysisService.cs |
| Unknown-ingredient classifier | backend/SafeBeauty.API/Services/HuggingFaceService.cs |
| Plain-language summary | backend/SafeBeauty.API/Services/AiSummaryService.cs |
| Ingredient parsing | backend/SafeBeauty.API/Models/Models/IngredientListParser.cs |
| Ingredient normalisation | backend/SafeBeauty.API/Models/Models/IngredientNormalizer.cs |
| Data seeding | backend/SafeBeauty.API/Data/DataSeeder.cs |
| Barcode validation | backend/SafeBeauty.API/Services/BarcodeValidator.cs |
AI driven full stack application for cosmetic ingredients recognition
C#
0
79 commits
updated Oct 13, 2026
A full-stack web application for cosmetic ingredient safety analysis, with personalisation based on the user's dermatological conditions.
SafeBeauty lets a user enter a cosmetic product — either by scanning its barcode or by pasting the ingredient list — and returns each ingredient with a colour-coded safety rating drawn from EU regulatory data, a plain-language summary of the whole product, and, for signed-in users, personalised warnings tied to their declared skin conditions.
This project was developed as an MSc Software Engineering dissertation at the University of Westminster.
Live demo: https://natashatoul.github.io/SafeBeauty/
The frontend is hosted on GitHub Pages and the backend API on Azure App Service (free tier). The first request after a period of inactivity may take up to a minute while the backend restarts (a cold start); subsequent requests respond normally.
Frontend
Backend
External services
facebook/bart-large-mnli (zero-shot classification of unknown ingredients) and meta-llama/Llama-3.1-8B-Instruct (plain-language summaries)Reference data (in backend/SafeBeauty.API/SeedData)
condition_rules.csv — condition rules derived by hand from published clinical dermatology sourcesSafeBeauty/
├── backend/
│ ├── SafeBeauty.API/ ASP.NET Core Web API
│ │ ├── Controllers/ HTTP endpoints
│ │ ├── Services/ analysis pipeline, AI layer, validators
│ │ ├── Models/ domain entities, parsers, enums
│ │ ├── Data/ DbContext and data seeding
│ │ └── SeedData/ regulatory CSV / TXT source files
│ └── SafeBeauty.API.Tests/ xUnit test suite
├── frontend/ React (Vite) single-page application
│ └── src/
└── evaluation/ AI classifier evaluation
From the repository root:
cd backend/SafeBeauty.API
Configure the required settings. The committed appsettings.json contains placeholders only — provide your own values, ideally through a git-ignored appsettings.Development.json or user secrets:
HuggingFace:ApiKey — your Hugging Face access tokenJwt:Key — any signing key of at least 32 charactersEmailSettings — SMTP credentials, only needed for email verificationThen run:
dotnet run
The API starts on http://localhost:5166. On first start it creates the SQLite database and seeds it from the files in SeedData/, so the initial launch takes a little longer.
In a second terminal, from the repository root:
cd frontend
npm install
npm run dev
The app is served at the URL printed by Vite (default http://localhost:5173). Vite proxies /api requests to the backend on http://localhost:5166, so both must be running.
Backend (xUnit):
cd backend
dotnet test
Frontend (Vitest):
cd frontend
npm run test:vitest
| Area | File |
|---|---|
| Analysis pipeline (orchestrator) | backend/SafeBeauty.API/Services/IngredientAnalysisService.cs |
| Unknown-ingredient classifier | backend/SafeBeauty.API/Services/HuggingFaceService.cs |
| Plain-language summary | backend/SafeBeauty.API/Services/AiSummaryService.cs |
| Ingredient parsing | backend/SafeBeauty.API/Models/Models/IngredientListParser.cs |
| Ingredient normalisation | backend/SafeBeauty.API/Models/Models/IngredientNormalizer.cs |
| Data seeding | backend/SafeBeauty.API/Data/DataSeeder.cs |
| Barcode validation | backend/SafeBeauty.API/Services/BarcodeValidator.cs |