Spotkick creates a Spotify playlist featuring your favourite musicians who are playing in your area.
- Songkick: For Artist or Area event data.
- Spotify: For user's Followed Artists & creation of the Playlist.
To run the application you'll need the following config in appsettings.json
or appsettings.*.json
:
Required for running locally. Not required for running with Docker.
- Launch the SQL Server Configuration Manager.
- Select the SQL Server 2005 Network Configuration tab. There should be a Protocols for SQLExpress option, and one of the protocols should be TCP IP.
- Enable the TCP IP protocol if it is not enabled.
- The default port for SQL Server Express may not be 1433**. To find the port it is listening on, right-click on the TCP IP protocol and scroll all the way down to the IP All heading. Make sure to restart SQL Express before trying to connect.
** You'll need the port number (dynamically assigned) in order to view the contents in Rider
Spotkick uses Entity Framework.
You can generate a migration (diffs the current model compared with the DB schema):
cd src\Spotkick
dotnet ef migrations add <MigrationScriptName>
If you generate a migration script, the application runs them at startup, but you can manually run them using the CLI:
dotnet ef database update <GeneratedDate>_<MigrationScriptName>
You can use your IDE e.g. click the Play button in VS, VSCode or Rider.
Alternatively you can use the .NET Core CLI:
cd src\Spotkick
dotnet run
Or use Docker (Ensure the Docker Daemon is running first on your machine):
docker-compose up
The application is available at http://localhost:6253 and the API is available using swagger at http://localhost:6253/swagger
When using Docker, the application is available at http://localhost:6254
You can use your IDE e.g. click the Play button in VS, VSCode or Rider.
Alternatively you can use the .NET Core CLI:
cd test\Spotkick.Test
dotnet test
The test framework contains the following scopes of test that are C# & .NET Core:
- Unit tests (in-memory SUT & mocks/stubs of internal services)
- Integration tests (in-memory SUT with mocks of external services)
- UI tests (locally running SUT, driven by Selenium)
- API tests (locally running SUT, driven by HTTP Client)
- Accessibility tests (Roadmap Item)
The test framework also offers the following test scopes via tools than can be run inside docker containers (docker-compose.test.yml -f docker-compose.test.yml up
):
- Performance tests:
- Locust (http://localhost:8089) can be used for Load/Stress/Performance testing. A default test script is included.
- Security tests:
- OWASP Zap (http://localhost:8090) can be used for DAST (Dynamic Application Security Testing) - (Automation as a Roadmap Item)
- Static Analysis:
- SonarQube (http://localhost:9000) can be used for more in-depth static analysis and security metrics than the SonarLint nuget package in-project
- Continuous Integration:
- Jenkins (http://localhost:8088) can be configured to provide a pipeline that, among other things, runs tests on-push
SonarLint is installed in the project but if you want deeper insights afforded by the SonarQube UI:
- Install SonarScanner
dotnet tool install --global dotnet-sonarscanner
- Set up a project
- Navigate to http://localhost:9000
- Sign in with
admin:admin
and reset password - Create a new project and generate an Auth key
- Run SonarScanner to publish analysis to SonarQube
dotnet sonarscanner begin /k:"<projectKey>" /d:sonar.login="<token>" dotnet build dotnet sonarscanner end /d:sonar.login="<token>"
- Review the project you created at
http://localhost:9000/dashboard?id=<projectKey>
- Review
locust\locustfile.py
- Navigate to http://localhost:8089
- Set the number of Users and the Hatch Rate
- Click
Start Swarming