Skip to content

This project turns a spreadsheet day-tracking mechanism into an application written in .NET EntityFramework.

Notifications You must be signed in to change notification settings

Recelis/questionnaire.net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

164 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Questionnaire.Net

Tasks

  • - Create app
  • - Look into MVC pattern
  • - Connect to Postgres Database
  • - Design models
  • - CRUD Questionnaire model
  • - CRUD Template model
  • - Setup NUnit tests
  • - CRUD TemplateQuestionLink + Question
  • - CRUD Submission
  • - CRUD Answer
  • - Create User model + add to Questionnaire created_by field.
  • - Locking templates so cannot have answers until it is 'locked'. Cannot modify after locked.
  • - - Cannot make submissions if not locked if only one template
  • - - Submissions are for previous locked template, if latest if unlocked
  • - - cannot create a new template if latest is unlocked
  • - duplicating templates

Future

Electron Project

    • - Setup Electron project
    • - Users can log in
    • - Users can create their own Questionnaires
    • - Users can create their own Templates
    • - Users can add questions to their templates
    • - Users can duplicate their templates
    • - Users can create submissions
    • - Users can add answers to their submissions
    • - Export electron project

Deployments

  • - Setup CI on GitHub Actions
  • - Put Dotnet Project onto Lambda
  • - Connect to Postgres Database online
  • - Connect local running Electron Project to Dotnet Lambda
  • - Setup CD on GitHub Actions

Migrations

Adding a new Migration

dotnet ef migrations add MigrationName

Applying Migrations

Update Entity Framework Core migrations.

dotnet ef database update

Testing Migrations

If you want to just create a test migration without applying it, you can use the --output-dir command.

dotnet ef migrations add TempMigrationPreview --output-dir Migrations/Temp

# To remove unapplied migrations
dotnet ef migrations remove

You have to make sure that your Snapshot also reverted.

to restart from scratch

Only do this if you are not in production.

dotnet ef database drop
dotnet ef database update

Otherwise, you can unapply the latest migration with:

dotnet ef database update <PreviousMigrationName>

# then remove your latest migration
dotnet ef database remove <PreviousMigrationName>

Tutorials This was Built From

https://learn.microsoft.com/en-us/training/modules/build-web-api-aspnet-core/ https://learn.microsoft.com/en-us/aspnet/core/data/ef-mvc/intro?view=aspnetcore-9.0 https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-9.0&tabs=visual-studio-code

Running

Before you start:

dotnet clean # only if you messed up your environment
dotnet restore
dotnet build

To run LifeTracker from root.

dotnet run --project LifeTracker

You can also cd into the LifeTracker project folder and run:

dotnet run

To run the tests, go to LifeTrackerTest.

dotnet test

For running a particular test suit:

dotnet test --filter "AnswerTests"

For running just one test:

dotnet test --filter "FullyQualifiedName=LifeTracker.Tests.Services.AnswerTests.CreateAsync_ShouldAddAnswerToDb"

About

This project turns a spreadsheet day-tracking mechanism into an application written in .NET EntityFramework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages