Skip to content

fernandotonacoder/music-albums-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music Albums API

Music Albums REST API written in C# / .NET Core, with Dapper and PostgreSQL

🚀 Local Setup

Secrets are stored in User Secrets (outside the repo, never committed).

First Time Setup:

1. Configure application secrets (User Secrets):

# Set your secrets for the main API
cd src/MusicAlbums.Api
dotnet user-secrets set "Database:ConnectionString" "Server=localhost;Port=5433;Database=albums;User ID=dev;Password=yourpass;"
dotnet user-secrets set "Jwt:Key" "your-secret-key-min-32-chars"
dotnet user-secrets set "ApiKey" "your-api-key"

# Set secrets for Identity API
cd ../../tools/Identity.Api
dotnet user-secrets set "Jwt:Secret" "your-secret-key-min-32-chars"

2. Configure database credentials (Docker - Optional):

Docker Compose uses these defaults: dev / changeme / albums on port 5433

If you want different values, copy the example and customize:

cp .env.example .env
# Edit .env with your values

Note: Don't edit docker-compose.yml directly - use .env to override defaults.

Keep ports in sync: If you change POSTGRES_PORT in .env, update your connection string to match:

cd src/MusicAlbums.Api
dotnet user-secrets set "Database:ConnectionString" "Server=localhost;Port=YOUR_NEW_PORT;Database=albums;User ID=dev;Password=changeme;"

Run:

docker-compose up -d  # Start database
cd src/MusicAlbums.Api
dotnet run

🔍 View Your Secrets:

# List all secrets
cd src/MusicAlbums.Api
dotnet user-secrets list

# Open secrets file directly (Windows)
code "$env:APPDATA\Microsoft\UserSecrets\<UserSecretsId>\secrets.json"

# Open secrets file directly (Linux/macOS)
code ~/.microsoft/usersecrets/<UserSecretsId>/secrets.json

Find <UserSecretsId> in MusicAlbums.Api.csproj or Identity.Api.csproj.

About

Music Albums REST API (C#/.NET)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages