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
The backend is organized into application layers:
src/domaincontains entities, repository contracts, and domain servicessrc/applicationcontains use casessrc/infrastructurecontains HTTP routes, Spotify provider implementations, and in-memory repositoriessrc/sharedcontains dependency wiringsrc/main.jlis the application entrypoint
GET /api/healthreturns backend health informationGET /api/spotify/mereturns the current user from the configured Spotify providerGET /api/spotify/top-artistsreturns top artists from the configured Spotify providerGET /api/spotify/top-tracksreturns top tracks from the configured Spotify providerPOST /api/analysis/demogenerates and stores a demo analysis report in memoryGET /api/analysis/demo-userreturns the stored demo report
From the project root:
juliaThen in the Julia REPL:
import Pkg
Pkg.activate(".")
Pkg.instantiate()Start the server:
julia .\src\main.jlStart the backend locally and open the API on http://localhost:8000.
Useful endpoints during the current MVP stage:
GET http://localhost:8000/api/healthGET http://localhost:8000/api/spotify/meGET http://localhost:8000/api/spotify/top-artistsGET http://localhost:8000/api/spotify/top-tracksPOST http://localhost:8000/api/analysis/demoGET http://localhost:8000/api/analysis/demo-user
Notes:
GETendpoints can be opened directly in the browserPOSTendpoints should be called from a REST client such as Postman, Insomnia, or from the future frontendGET /api/analysis/demo-userreturns data only after the demo report has been created
The backend currently supports a mock Spotify provider:
SPOTIFY_PROVIDER=mockThis 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.
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.jltest/application/use_cases_test.jltest/infrastructure/in_memory/analysis_repository_test.jltest/infrastructure/spotify/mock_provider_test.jl
Run tests from the project root:
julia --project=. -e "import Pkg; Pkg.test()"