Skip to content

Commit

Permalink
Merge pull request #1 from BlazingApple/taylorchasewhite-readme
Browse files Browse the repository at this point in the history
Updated Readme
  • Loading branch information
taylorchasewhite authored Nov 28, 2020
2 parents 67813c4 + e134779 commit ed816ae
Showing 1 changed file with 85 additions and 2 deletions.
87 changes: 85 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,85 @@
# Survey
Survey Components and Service for Blazor WASM Application Consumption
# BlazingApple.Survey :apple:

:fire: A totally copacetic, easy-to-use front-end Blazor Survey package.
This front-end Razor Class Library is intended to be used by Blazor WASM projects, and targets .NET 5.

## About BlazingApples
BlazingApples is an open-source set of packages that aims to speed application development for Blazor WebAssembly organizations.

:zap: Check out the [demo site here](https://blazorsimplesurvey.azurewebsites.net/displaysurvey), [or this blog post on how the components work](https://blazorhelpwebsite.com/ViewBlogPost/44)!

:clap: Special thanks to [ADefWebServer](https://github.com/ADefWebserver/BlazorSimpleSurvey/commits?author=ADefWebserver) for creating the [BlazorSimpleSurvey](https://github.com/ADefWebserver/BlazorSimpleSurvey) demo application which this is based off of.

# Demo :video_camera:

<p align="center">
<img alt="Demo of Copacetic" src="https://github.com/BlazingApple/Survey/blob/main/README/BlazingApplesDemo.gif?raw=true">
</p>

# Installation :wrench:

## 1. Get the required dependencies.

1. On Client Project, right click and get to the NuGet Package Manager ("Manage NuGetPackages").
2. Install `BlazingApple.Survey`
![Survey Administration](https://github.com/BlazingApple/Survey/blob/main/README/InstallBlazingApplePackage.png?raw=true)
3. Add the following to `Program.cs's Main`:
```
builder.Services.AddScoped<DialogService>();
builder.Services.AddScoped<TooltipService>();
builder.Services.AddScoped<NotificationService>();
builder.Services.AddScoped<BlazingApple.SurveyService>();
```

4. In your `index.html` file, add the required Radzen style and script:
```
<link rel="stylesheet" href="_content/Radzen.Blazor/css/default-base.css"> <!-- this adds a lot of styles we don't want -->
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
```

## 2. Set up your server's API controller to receive the requests.
It is recommended to do this with EntityFrameworkCore to create the tables in my database and receive and process the request. This portion of the setup shows how to do this.

1. In your `Server` project, open `ApplicationDbContext`, add the following tables:
```
using BlazingApples.Shared;
...
public DbSet<Survey> Surveys { get; set; }
public DbSet<SurveyAnswer> SurveyAnswers { get; set; }
public DbSet<SurveyItem> SurveyItems { get; set; }
public DbSet<SurveyItemOption> SurveyItemOptions { get; set; }
```
2. Create a `SurveysController.cs` in the `Controllers` directory. Feel free to copy [this controller](#).


# Usage :muscle:

Once the (admittedly rather involved) setup is complete, using the components is straightforward:

1. In a component, add the `<DisplaySurvey></DisplaySurvey>` component to show surveys to a user. If no survey is provided, this component will download all the active surveys from the server and give the user options to take them.
2. Use the `<SurveyAdmin></SurveyAdmin>` component in a page in which you'd like to enable users to create or modify surveys.
3. Step 3

## Credits :white_flower:

- Build with love :blue_heart:, using [Radzen's Component Library](https://razor.radzen.com/) and [ADefWebServer](https://github.com/ADefWebserver/BlazorSimpleSurvey/commits?author=ADefWebserver)'s [BlazorSimpleSurvey](https://github.com/ADefWebserver/BlazorSimpleSurvey) as a starting point.

## Authors :pencil:

1. [Taylor White](https://twitter.com/taychasewhite)

## License :scroll:

![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)

- **[GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)**

## Home Page :camera:
![Survey Administration](https://github.com/BlazingApple/Survey/blob/main/README/SurveyAdmin.png?raw=true)

## Taking Surveys :camera:
![Taking a survey](https://github.com/BlazingApple/Survey/blob/main/README/Taking%20a%20Survey.png?raw=true)

## Monitoring Responses :camera:
![Survey Responses](https://github.com/BlazingApple/Survey/blob/main/README/SurveyResults.png?raw=true)

0 comments on commit ed816ae

Please sign in to comment.