Backend API for SkinAlyze - A skincare and lifestyle tracking application.
- 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
- Java 17 or higher
- Maven 3.8+
- PostgreSQL 15+
- IntelliJ IDEA (recommended)
- Install PostgreSQL
- Create database:
CREATE DATABASE skinalyze_db;- Update
application.propertieswith your database credentials:
spring.datasource.url=jdbc:postgresql://localhost:5432/skinalyze_db
spring.datasource.username=your_username
spring.datasource.password=your_passwordcd backend
./mvnw spring-boot:run- Open the project in IntelliJ
- Wait for Maven to import dependencies
- Run
SkinAlyzeApplication.java
The application will start on http://localhost:8080
Once the application is running, access Swagger UI at:
- Swagger UI: http://localhost:8080/swagger-ui.html
- API Docs: http://localhost:8080/api-docs
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
POST /api/v1/auth/register- Register new userPOST /api/v1/auth/login- LoginPOST /api/v1/auth/refresh- Refresh token
POST /api/v1/onboarding/profile- Create profilePOST /api/v1/onboarding/skin-concerns- Add skin concernsPOST /api/v1/onboarding/baseline-routine- Set baseline routine
POST /api/v1/daily-log- Create daily logGET /api/v1/daily-log/{date}- Get log for dateGET /api/v1/daily-log/history- Get log history
GET /api/v1/products- List user productsPOST /api/v1/products- Add productGET /api/v1/products/{id}/impact-analysis- Analyze product impact
GET /api/v1/analytics/weekly-summary- Weekly summaryGET /api/v1/analytics/insights- Get insightsGET /api/v1/analytics/correlations- Get correlations
GET /api/v1/goals- List goalsPOST /api/v1/goals- Create goalGET /api/v1/goals/{id}/progress- Track progress
./mvnw test./mvnw clean package- Follow Java naming conventions
- Use Lombok to reduce boilerplate
- Keep services focused and testable
- Write meaningful tests
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- Implement authentication module
- Create entity classes
- Build repositories
- Implement services
- Create REST controllers
- Add comprehensive tests
- Implement analytics engine
Proprietary - All rights reserved
- Saad Shaikh
- Huzaifa