Documentation Menu
The Spark application structure is setup to give a consistant, organized project structure for your web application.
Because Spark provides a defined structure for you, there are no suprises when starting work on new or existing project.
However, you are still free to create classes wherever you’d like if you choose to.
The Application
directory contains the core code of you application.
The Database
directory contains your DatabaseContext
and Migrations
for EF Core.
The Events
directory contains your event and listener classes. Events are used to alert other parts of your app that a given action has occurred. This provides great flexibility and decoupling.
The Jobs
directory contains queueable jobs for your application. Jobs can be scheduled or added to a background queue.
The Mail
directory contains your mailable classes. Mailables are C# classes that represent a specific type of e-mail that you can send.
The Models
directory contains your efcore model classes. Each database table for your application has a corresponding Model class that efcore will use to interact with that table.
The Services
directory contains your services that can be Dependency Injected on startup. Services are typically used to abstract away business logic or database calls.
The Startup
directory contains Registration classes. These classes are where Sparks core services, auth, custom services, events, or jobs are registered to the DI container. Scheduled jobs can also be registered here.
The Assets
directory contains your Javascript and CSS assets.
The Pages
directory contains your Razor Components or Razor Pages, depending if your using Blazor or Razor Pages as your frontend. You can also register Minimal API routes here.
The Storage
directory contains your application logs if the Spark logger is setup to log to files. It also contains mail logs if your mailer is setup to log to files.
The wwwroot
directory contains your compiled CSS, images, and other frontend public dependancies.
The Test
directory contains an XUnit project for your unit and integration tests. This directory is opened as it’s own project in your apps solution.