Skip to content

666mxvbee/SpotifyTasteAnalyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotify Taste Analyzer Backend

This repository contains the backend foundation for a Spotify taste analyzer built with Julia and Genie.

The current stage is an MVP backend skeleton with:

  • a DDD-inspired structure
  • in-memory repositories
  • a mock Spotify provider for development without Spotify Premium
  • a demo analysis flow
  • HTTP endpoints for health checking and demo report retrieval

Current Architecture

The backend is organized into application layers:

  • src/domain contains entities, repository contracts, and domain services
  • src/application contains use cases
  • src/infrastructure contains HTTP routes, Spotify provider implementations, and in-memory repositories
  • src/shared contains dependency wiring
  • src/main.jl is the application entrypoint

Current Endpoints

  • GET /api/health returns backend health information
  • GET /api/spotify/me returns the current user from the configured Spotify provider
  • GET /api/spotify/top-artists returns top artists from the configured Spotify provider
  • GET /api/spotify/top-tracks returns top tracks from the configured Spotify provider
  • POST /api/analysis/demo generates and stores a demo analysis report in memory
  • GET /api/analysis/demo-user returns the stored demo report

Getting Started

From the project root:

julia

Then in the Julia REPL:

import Pkg
Pkg.activate(".")
Pkg.instantiate()

Start the server:

julia .\src\main.jl

Manual API Check

Start the backend locally and open the API on http://localhost:8000.

Useful endpoints during the current MVP stage:

  • GET http://localhost:8000/api/health
  • GET http://localhost:8000/api/spotify/me
  • GET http://localhost:8000/api/spotify/top-artists
  • GET http://localhost:8000/api/spotify/top-tracks
  • POST http://localhost:8000/api/analysis/demo
  • GET http://localhost:8000/api/analysis/demo-user

Notes:

  • GET endpoints can be opened directly in the browser
  • POST endpoints should be called from a REST client such as Postman, Insomnia, or from the future frontend
  • GET /api/analysis/demo-user returns data only after the demo report has been created

Spotify Provider

The backend currently supports a mock Spotify provider:

SPOTIFY_PROVIDER=mock

This keeps the app usable during local development even without Spotify Premium or real API credentials. The future real provider should use the same domain provider contract, so routes and use cases do not need to know whether data comes from mock data or Spotify.

Testing

Julia package tests live in the test/ directory.

The standard entrypoint is:

  • test/runtests.jl

Additional test files should be grouped by layer, usually mirroring src/. For example:

  • test/domain/services_test.jl
  • test/application/use_cases_test.jl
  • test/infrastructure/in_memory/analysis_repository_test.jl
  • test/infrastructure/spotify/mock_provider_test.jl

Run tests from the project root:

julia --project=. -e "import Pkg; Pkg.test()"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages