Welcome to the SkinSight Backend API, built with AdonisJS v6. This backend powers core features such as authentication, user assessment, skincare product recommendations (with ML), education/news content, face/ingredient scanning, and chatbot support.
- Framework: AdonisJS v6
- Language: TypeScript
- Database: MariaDB (Lucid ORM)
- Caching: Redis
- Authentication: Bearer Token (with verification middleware)
- Validation: VineJS with Custom Validators
- Machine Learning: External recommendation module (From ML team)
- Storage: Local file system (profile, scan uploads)
- UV Index API: External Open Source API for UV index data
- Rate Limiting: @adonisjs/limiter
- ChatBot: Custom integration for user queries using N8N
- Load Testing: K6
# Clone the repo
git clone https://github.com/ZumaAkbarID/skinsight-backend.git
# Install dependencies
npm install
# Copy .env config
cp .env.example .env
# Generate app key & run migrations
node ace generate:key
node ace migration:run --seed
# Start dev server
npm run dev
Path | Description |
---|---|
app/controllers |
All route controllers |
app/validators |
Request validators |
app/models |
Lucid ORM models |
start/routes.ts |
Main routes file |
start/kernel.ts |
Middleware config |
helpers/ |
Custom business logic helpers |
public/uploads/ |
File uploads (profile, scans, etc.) |
- Authentication: Required for most routes (
middleware.auth()
) - User Verification: Ensures user has verified OTP (
middleware.verifiedUser()
) - Rate Limiting: Handled via
@adonisjs/limiter
(throttle
) - Caching: Redis used for caching external calls (news, recommendations, etc.)
- Custom Validators: For email uniqueness, password strength, etc.
Method | Endpoint | Description |
---|---|---|
POST | /api/auth/register |
Register user |
POST | /api/auth/login |
Login user |
POST | /api/oauth2/google |
Google login |
Method | Endpoint | Description |
---|---|---|
POST | /api/forgot-password/generate-otp |
Generate OTP for password recovery |
POST | /api/forgot-password/resend-otp |
Resend OTP for password recovery |
POST | /api/forgot-password/verify-otp |
Verify OTP for password recovery |
POST | /api/forgot-password/reset-password |
Reset password |
Method | Endpoint | Description |
---|---|---|
POST | /api/auth/logout |
Logout user |
GET | /api/user/profile |
Get user profile |
PUT | /api/user/profile |
Update user profile |
POST | /api/user/change-password |
Change password |
POST | /api/assessment |
Submit skin assessment |
POST | /api/scan/face |
Upload face scan |
GET | /api/scan/face/history |
View face scan history |
POST | /api/scan/ingredients |
OCR ingredients |
GET | /api/scan/ingredients/history |
OCR history |
GET | /api/scan/ingredients/history/:id |
OCR history detail |
Method | Endpoint | Description |
---|---|---|
GET | /api/product/recommendations |
Get ML-based product recommendations |
GET | /api/product/all |
List + filter products |
GET | /api/product/types-and-brands |
Distinct types + brands |
GET | /api/product/brand/:brand |
Get product types by brand |
GET | /api/product/brand/:brand/:type |
Get products by brand & type |
Method | Endpoint | Description |
---|---|---|
POST | /api/educations |
Get education content |
POST | /api/educations/detail |
Get education detail |
Method | Endpoint | Description |
---|---|---|
GET | /api/news |
Paginated news list |
POST | /api/news/detail |
Get news article detail |
Method | Endpoint | Description |
---|---|---|
POST | /api/chat/send-message |
Chatbot integration |
Method | Endpoint | Description |
---|---|---|
GET | /api/current-uv-index |
External UV index |
GET | /api/ads |
Promotional ads |
Method | Endpoint | Description |
---|---|---|
GET | /profile_pictures/* |
Serve profile picture |
GET | /scan_faces/* |
Serve face scan |
GET | /ingredients_ocr/* |
Serve OCR image |
GET | /brands/* |
Serve brand image |
Cached endpoints:
NewsController
NewsDetailsController
EducationsController
RecommendationsController
UVIndexController
ProductsController
Redis CLI examples:
# See all keys
redis-cli KEYS '*'
# Clear cache for news
redis-cli --scan --pattern "news:*" | xargs redis-cli DEL
PORT=3333
HOST=127.0.0.1
APP_KEY=your_app_key
DB_CONNECTION=pg
REDIS_CONNECTION=local
Name | Role | Github Profile |
---|---|---|
Zuma Gamtenk | Backend | @ZumaAkbarID |
Wahid Gamtenk | Machine Learning | @Hazz-i |
Niken Gamtenk | Mobile Dev | @nikenlis |
Pull requests are welcome. Please ensure code is clean and tested.
MIT © TULALIT Team — SkinSight Project