Skip to content

Commit

Permalink
Version 0.0.2 (26/09/2023)
Browse files Browse the repository at this point in the history
- Full back-end added
  • Loading branch information
GuttiDK committed Sep 26, 2023
1 parent fbb0997 commit 7bf7bb4
Show file tree
Hide file tree
Showing 15 changed files with 204 additions and 15 deletions.
1 change: 1 addition & 0 deletions Pages/Error.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page
@using TheTodoWeb.Pages;
@model ErrorModel
@{
ViewData["Title"] = "Error";
Expand Down
2 changes: 1 addition & 1 deletion Pages/Error.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;

namespace TheTodoRazerApp.Pages
namespace TheTodoWeb.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
Expand Down
6 changes: 4 additions & 2 deletions Pages/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@page
@using TheTodoWeb.Pages;
@model IndexModel
@{
ViewData["Title"] = "Home page";
}

<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
<h1 class="display-4">Welcome to TheTodoRazerApp</h1>
<p>Click to goto ToDoList</p>
<p><a class="btn btn-primary" asp-page="/ToDoList">ToDoList</a></p>
</div>
8 changes: 6 additions & 2 deletions Pages/Index.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using TheTodoService.Interfaces;

namespace TheTodoRazerApp.Pages
namespace TheTodoWeb.Pages
{
public class IndexModel : PageModel
{
private readonly ILogger<IndexModel> _logger;

public IndexModel(ILogger<IndexModel> logger)
private readonly IToDoItemService _toDoItemService;

public IndexModel(ILogger<IndexModel> logger, IToDoItemService toDoItemService)
{
_logger = logger;
_toDoItemService = toDoItemService;
}

public void OnGet()
Expand Down
1 change: 1 addition & 0 deletions Pages/Privacy.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page
@using TheTodoWeb.Pages;
@model PrivacyModel
@{
ViewData["Title"] = "Privacy Policy";
Expand Down
2 changes: 1 addition & 1 deletion Pages/Privacy.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace TheTodoRazerApp.Pages
namespace TheTodoWeb.Pages
{
public class PrivacyModel : PageModel
{
Expand Down
26 changes: 25 additions & 1 deletion Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - TheTodoRazerApp</title>
<title>@ViewData["Title"] - Todo List</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/TheTodoRazerApp.styles.css" asp-append-version="true" />
Expand All @@ -25,6 +25,9 @@
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Privacy</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" data-bs-toggle="offcanvas" href="#offcanvasExample" role="button" aria-controls="offcanvasExample">Create</a>
</li>
</ul>
</div>
</div>
Expand All @@ -33,6 +36,27 @@
<div class="container">
<main role="main" class="pb-3">
@RenderBody()

<div class="offcanvas offcanvas-start" tabindex="-1" id="offcanvasExample" aria-labelledby="offcanvasExampleLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="offcanvasExampleLabel">Offcanvas</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div>
Some text as placeholder. In real life you can have the elements you have chosen. Like, text, images, lists, etc.
</div>
<div class="dropdown mt-3">
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown">
Dropdown button
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
</ul>
</div>
</div>
</div>

</main>
</div>

Expand Down
8 changes: 8 additions & 0 deletions Pages/Shared/_Layout.cshtml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace TheTodoWeb.Pages.Shared
{
public class LayoutModel : PageModel
{
}
}
32 changes: 32 additions & 0 deletions Pages/ToDoList.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@page
@model TheTodoWeb.Pages.ToDoListModel
@{
ViewData["Title"] = "ToDoList";
}

<h3>ToDoList</h3>

<hr />

<table class="table">
<thread>
<tr>
<th>Id</th>
<th>Description</th>
<th>Created Time</th>
<th>IsCompleted</th>
<th>Priory</th>
</tr>
</thread>
<tbody>
@foreach (var item in Model.ToDoItems)
{
<tr>
<td>@item.Id</td>
<td>@item.TaskDescription</td>
<td>@item.CreatedTime</td>
<td>@item.IsCompleted</td>
<td>@item.Priority</td>
</tr>
}
</table>
24 changes: 24 additions & 0 deletions Pages/ToDoList.cshtml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using TheTodoService.DataTransferObjects;
using TheTodoService.Interfaces;

namespace TheTodoWeb.Pages
{
public class ToDoListModel : PageModel
{
private readonly IToDoItemService _toDoItemService;

public List<ToDoItemDto> ToDoItems = new();

public ToDoListModel(IToDoItemService toDoItemService)
{
_toDoItemService = toDoItemService;
}

public async Task OnGet()
{
ToDoItems = await _toDoItemService.GetAllAsync();
}
}
}
19 changes: 19 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
using Microsoft.EntityFrameworkCore;
using TheTodoRepository.Domain;
using TheTodoRepository.Interfaces;
using TheTodoRepository.Repositories;
using TheTodoService.Interfaces;
using TheTodoService.Services;

var builder = WebApplication.CreateBuilder(args);


builder.Services.AddScoped<MappingService, MappingService>();

builder.Services.AddScoped<IToDoItemRepository, ToDoItemRepository>();
builder.Services.AddScoped<IToDoItemService, ToDoItemService>();

// Add services to the container.
builder.Services.AddRazorPages();

builder.Services.AddDbContext<ToDoListContext>(options =>
{
options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"));
});


var app = builder.Build();

// Configure the HTTP request pipeline.
Expand Down
69 changes: 68 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,68 @@
# TheTodoRazerApp
# TodoWork

## Description

Todo work is a website where you can create tasks with title, description and priorities. You can complet task and se how much time used on taskes and uncomplet task. You have to be a user on the website to use its features.

## The Maker
Made by Christian C. Høttges

Last updated: 26-09-2023

# How to Use

1. Clone the repository to your local machine.
2. Open the solution in Visual Studio.
3. Run the application.

**Requirements:**

* <a href="https://code.visualstudio.com/" target="_blank">Visual Studio IDE</a> (recommend Code) to compile.
* <a href="https://www.microsoft.com/en-us/sql-server/sql-server-downloads" target="_blank">Microsoft SQL</a> (recommend Express) to run the database for testing.

**Technologies:**
* <a href="https://learn.microsoft.com/en-us/dotnet/csharp/" target="_blank">C#</a> (back-end)
* <a href="https://www.javascript.com/" target="_blank">JavaScript</a>
* <a href="https://html.com/" target="_blank">Html</a> (front-end)
* <a href="https://www.w3schools.com/css/" target="_blank">CSS</a>
* <a href="" target="_blank">Bootstrap</a> (front-end styling)
* <a href="https://www.microsoft.com/en-us/sql-server/sql-server-downloads" target="_blank">SQL</a> (data storage)


# Features

- **Front-end templete**: Allows users to only see the templete.
- **Full back-end**: Allows users use execute all the features of the application thru the repository and services.
- **Repository pattern**: Allows users to use the repository pattern to get data from the database.
- **Service pattern**: Allows users to use the service pattern to get data from the repository.

# Updates

**Version 0.0.2** (26/09/2023) - Current version
- Full backend with database.
- Added repository pattern and service pattern.
- Added front-end handling of data from repository and service layer.

**Version 0.0.1** (21/09/2023)
- Initial pre-release of The Todo List Application.
- Features include Front-end templete.

### Upcoming features

- Initial pre-release of Front-end
- Creating, deleting, editing and completing tasks.

### Tags
- <a href="https://github.com/GuttiDK/TheTodoRazerApp/releases/tag/version-0.0.2">Full backend - v0.0.2</a>
- <a href="https://github.com/GuttiDK/TheTodoRazerApp/releases/tag/version-0.0.1">Structure - v0.0.1</a>

# Bugs & Known Bugs and Bug Reporting
We are constantly working to improve this application. If you encounter any bugs or errors, please report them to us.


## Contact Info
**Phone number:** +45 28 78 34 14
**Email:** [GuttiDK@gmail.com](mailto:GuttiDK@gmail.com)

## License
This project is licensed under the MIT license. See the `LICENSE` file for further details.
12 changes: 9 additions & 3 deletions TheTodoRazerApp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34031.279
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheTodoWeb", "TheTodoWeb.csproj", "{1FE21387-102E-439E-86D7-F1EAAA29D6A9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TheTodoWeb", "TheTodoWeb.csproj", "{1FE21387-102E-439E-86D7-F1EAAA29D6A9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheTodoService", "..\TheTodoRazerAppService\TheTodoService.csproj", "{F8D5F1C2-106D-4226-A962-25FD7E648FD7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TheTodoService", "..\TheTodoRazerAppService\TheTodoService.csproj", "{F8D5F1C2-106D-4226-A962-25FD7E648FD7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheTodoRepository", "..\TheTodoRazerAppRepository\TheTodoRepository.csproj", "{F55EB363-0FD8-46F6-9945-E7301F5AEDFF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TheTodoRepository", "..\TheTodoRazerAppRepository\TheTodoRepository.csproj", "{F55EB363-0FD8-46F6-9945-E7301F5AEDFF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0C947857-75CD-4DCA-8051-27D0D51BB943}"
ProjectSection(SolutionItems) = preProject
LICENSE.txt = LICENSE.txt
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
6 changes: 2 additions & 4 deletions TheTodoWeb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\TheTodoRazerAppRepository\TheTodoRepository.csproj" />
<ProjectReference Include="..\TheTodoRazerAppService\TheTodoService.csproj" />
</ItemGroup>

Expand Down
3 changes: 3 additions & 0 deletions appsettings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ConnectionStrings": {
"DefaultConnection": "Server=dESktoP-V8\\SQLEXPRESS;Database=TheTodoRazerApp;Trusted_Connection=True;TrustServerCertificate=True;"
},
"Logging": {
"LogLevel": {
"Default": "Information",
Expand Down

0 comments on commit 7bf7bb4

Please sign in to comment.