Skip to content

Saad4Dev/SkinAlyze

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkinAlyze Backend

Backend API for SkinAlyze - A skincare and lifestyle tracking application.

Tech Stack

  • Java 17
  • Spring Boot 3.2.1
  • PostgreSQL - Database
  • Flyway - Database migrations
  • Spring Security + JWT - Authentication
  • MapStruct - DTO mapping
  • Lombok - Reduce boilerplate
  • OpenAPI/Swagger - API documentation
  • Testcontainers - Integration testing

Prerequisites

  • Java 17 or higher
  • Maven 3.8+
  • PostgreSQL 15+
  • IntelliJ IDEA (recommended)

Database Setup

  1. Install PostgreSQL
  2. Create database:
CREATE DATABASE skinalyze_db;
  1. Update application.properties with your database credentials:
spring.datasource.url=jdbc:postgresql://localhost:5432/skinalyze_db
spring.datasource.username=your_username
spring.datasource.password=your_password

Running the Application

Using Maven

cd backend
./mvnw spring-boot:run

Using IntelliJ IDEA

  1. Open the project in IntelliJ
  2. Wait for Maven to import dependencies
  3. Run SkinAlyzeApplication.java

The application will start on http://localhost:8080

API Documentation

Once the application is running, access Swagger UI at:

Project Structure

backend/
├── src/
│   ├── main/
│   │   ├── java/com/skinalyze/
│   │   │   ├── auth/              # Authentication & JWT
│   │   │   ├── onboarding/        # User onboarding
│   │   │   ├── dailylog/          # Daily logging (core)
│   │   │   ├── products/          # Product library
│   │   │   ├── analytics/         # Insights & analytics
│   │   │   ├── goals/             # Goals & progress
│   │   │   ├── common/            # Shared utilities
│   │   │   │   ├── config/        # Configuration
│   │   │   │   ├── security/      # Security utilities
│   │   │   │   ├── exception/     # Exception handling
│   │   │   │   └── util/          # Helper utilities
│   │   │   └── SkinAlyzeApplication.java
│   │   └── resources/
│   │       ├── application.properties
│   │       └── db/migration/      # Flyway migrations
│   └── test/
└── pom.xml

API Endpoints (Planned)

Authentication

  • POST /api/v1/auth/register - Register new user
  • POST /api/v1/auth/login - Login
  • POST /api/v1/auth/refresh - Refresh token

Onboarding

  • POST /api/v1/onboarding/profile - Create profile
  • POST /api/v1/onboarding/skin-concerns - Add skin concerns
  • POST /api/v1/onboarding/baseline-routine - Set baseline routine

Daily Logging

  • POST /api/v1/daily-log - Create daily log
  • GET /api/v1/daily-log/{date} - Get log for date
  • GET /api/v1/daily-log/history - Get log history

Products

  • GET /api/v1/products - List user products
  • POST /api/v1/products - Add product
  • GET /api/v1/products/{id}/impact-analysis - Analyze product impact

Analytics

  • GET /api/v1/analytics/weekly-summary - Weekly summary
  • GET /api/v1/analytics/insights - Get insights
  • GET /api/v1/analytics/correlations - Get correlations

Goals

  • GET /api/v1/goals - List goals
  • POST /api/v1/goals - Create goal
  • GET /api/v1/goals/{id}/progress - Track progress

Development

Running Tests

./mvnw test

Building

./mvnw clean package

Code Style

  • Follow Java naming conventions
  • Use Lombok to reduce boilerplate
  • Keep services focused and testable
  • Write meaningful tests

Environment Variables

For production, set these environment variables:

DB_URL=jdbc:postgresql://your-db-host:5432/skinalyze_db
DB_USERNAME=your_username
DB_PASSWORD=your_password
JWT_SECRET=your-secure-secret-key

Next Steps

  1. Implement authentication module
  2. Create entity classes
  3. Build repositories
  4. Implement services
  5. Create REST controllers
  6. Add comprehensive tests
  7. Implement analytics engine

License

Proprietary - All rights reserved

SkinAlyze

Contributors

  • Saad Shaikh
  • Huzaifa

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 87.8%
  • TypeScript 12.2%