How bola-edward/surveybasket works
SurveyBasket is an ASP.NET Core API for managing polls and issuing JWT authentication with refresh-token rotation and revocation. The main workflows enter through the poll or authentication controllers, delegate to services, and persist state through Entity Framework/ASP.NET Identity. Poll endpoints support listing, retrieval, creation, updates, soft deletion, and publish toggling. The excerpts show these workflows, but do not establish a direct mapping-configuration call path or the full database deployment details.
Main entry points: AuthService.cs Auth service · PollsController.cs Poll endpoints · AuthController.cs Auth endpoints · ApplicationDbContext.cs Application context
Components 21
API endpoints
- Poll endpoints
SurveyBasket.API/Controllers/PollsController.cs - Auth endpoints
SurveyBasket.API/Controllers/AuthController.cs - Poll contracts
SurveyBasket.API/Contracts/Poll/Requests/PollRequest.cs - Poll response
SurveyBasket.API/Contracts/Poll/Responses/PollResponse.cs - Poll validation
SurveyBasket.API/Contracts/Poll/Validators/PollRequestValidator.cs - Auth requests
SurveyBasket.API/Contracts/Authentication/Requests/LoginRequest.cs - Refresh request
SurveyBasket.API/Contracts/Authentication/Requests/RefreshTokenRequest.cs - Auth response
SurveyBasket.API/Contracts/Authentication/Responses/AuthResponse.cs
Poll management
- Poll service
SurveyBasket.API/Services/Implementations/PollService.cs - Poll service contract
SurveyBasket.API/Services/Interfaces/IPollService.cs - Poll entity
SurveyBasket.API/Entities/Poll.cs - Poll mapping config
SurveyBasket.API/Mapping/PollMappingConfig.cs
Authentication
- Auth service
SurveyBasket.API/Services/Implementations/AuthService.cs - Auth service contract
SurveyBasket.API/Services/Interfaces/IAuthService.cs - JWT provider
SurveyBasket.API/Authentication/JWTProvider.cs - JWT options
SurveyBasket.API/Authentication/JwtOptions.cs - Application user
SurveyBasket.API/Entities/ApplicationUser.cs - Refresh token
SurveyBasket.API/Entities/RefreshToken.cs
Persistence
- Application context
SurveyBasket.API/Persistence/ApplicationDbContext.cs - SQL database
Other components
- API client
Connections 21
- API client → Poll endpoints: calls poll routes
SurveyBasket.API/Controllers/PollsController.cs - API client → Auth endpoints: calls auth routes
SurveyBasket.API/Controllers/AuthController.cs - Poll endpoints → Poll service contract: delegates poll operations
SurveyBasket.API/Controllers/PollsController.cs - Poll service → Poll service contract: implements
SurveyBasket.API/Services/Implementations/PollService.cs - Poll endpoints → Poll contracts: accepts
SurveyBasket.API/Controllers/PollsController.cs - Poll endpoints → Poll entity: maps to
SurveyBasket.API/Controllers/PollsController.cs - Poll endpoints → Poll response: returns
SurveyBasket.API/Controllers/PollsController.cs - Poll validation → Poll contracts: validates
SurveyBasket.API/Contracts/Poll/Validators/PollRequestValidator.cs - Poll service → Application context: reads and saves
SurveyBasket.API/Services/Implementations/PollService.cs - Application context → Poll entity: models
SurveyBasket.API/Persistence/ApplicationDbContext.cs - Application context → SQL database: persists entities
- Auth endpoints → Auth service contract: delegates auth operations
SurveyBasket.API/Controllers/AuthController.cs - Auth service → Auth service contract: implements
SurveyBasket.API/Services/Implementations/AuthService.cs - Auth endpoints → Auth requests: accepts login
SurveyBasket.API/Controllers/AuthController.cs - Auth endpoints → Refresh request: accepts refresh and revoke
SurveyBasket.API/Controllers/AuthController.cs - Auth service → Auth response: returns
SurveyBasket.API/Services/Implementations/AuthService.cs - Auth service → JWT provider: generates and validates tokens
SurveyBasket.API/Services/Implementations/AuthService.cs - Auth service → Application user: authenticates and updates
SurveyBasket.API/Services/Implementations/AuthService.cs - Auth service → Refresh token: rotates and revokes
SurveyBasket.API/Services/Implementations/AuthService.cs - Application user → Refresh token: owns tokens
SurveyBasket.API/Entities/ApplicationUser.cs - JWT provider → JWT options: uses settings
SurveyBasket.API/Authentication/JWTProvider.cs