Index: resTools_backend/backend/Controllers/ReservationsController.cs
===================================================================
--- resTools_backend/backend/Controllers/ReservationsController.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Controllers/ReservationsController.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,36 @@
+﻿namespace backend.Controllers;
+
+using backend.DTOs;
+using backend.Entities;
+using backend.Helpers;
+using backend.Models;
+using backend.Services;
+using Microsoft.AspNetCore.Mvc;
+using System.Security.Claims;
+
+[ApiController]
+[Route("[controller]")]
+public class ReservationsController : ControllerBase
+{
+    private readonly IReservationService _reservationService = null;
+
+    public ReservationsController(IReservationService reservationService)
+    {
+        _reservationService = reservationService;
+    }
+
+    [HttpPost()]
+    public async Task<IActionResult> CreateReservation([FromBody] CreateReservationRequest req)
+    {
+        await _reservationService.CreateReservation(req);
+        return Ok();
+    }
+
+    [Authorize]
+    [HttpPut("{rid}")]
+    public async Task<IActionResult> ChangeStatus(int rid, [FromQuery] ReservationStatus status)
+    {
+        await _reservationService.ChangeReservationStatus(rid, status);
+        return Ok();
+    }
+}
Index: resTools_backend/backend/Controllers/RestaurantsController.cs
===================================================================
--- resTools_backend/backend/Controllers/RestaurantsController.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Controllers/RestaurantsController.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,39 @@
+﻿namespace backend.Controllers;
+
+using backend.DTOs;
+using backend.Entities;
+using backend.Helpers;
+using backend.Models;
+using backend.Services;
+using Microsoft.AspNetCore.Mvc;
+using System.Security.Claims;
+
+[ApiController]
+[Route("[controller]")]
+public class RestaurantsController : ControllerBase
+{
+    private readonly IRestaurantService _restaurantService = null;
+
+    public RestaurantsController(IRestaurantService restaurantService)
+    {
+        _restaurantService = restaurantService;
+    }
+
+    [Authorize]
+    [HttpPost()]
+    public async Task<IActionResult> CreateRestaurant([FromQuery] string title)
+    {
+        var userId = (int) this.HttpContext.Items["User"];
+        await _restaurantService.CreateRestaurant(title, userId);
+
+
+        return Ok();
+    }
+
+    [HttpGet()]
+    public async Task<RestaurantResponse> GetRestaurant()
+    {
+        var response = await _restaurantService.GetRestaurant();
+        return response;
+    }
+}
Index: resTools_backend/backend/Controllers/UsersController.cs
===================================================================
--- resTools_backend/backend/Controllers/UsersController.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Controllers/UsersController.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,37 @@
+﻿namespace backend.Controllers;
+
+using backend.DTOs;
+using backend.Helpers;
+using backend.Models;
+using backend.Services;
+using Microsoft.AspNetCore.Mvc;
+
+[ApiController]
+[Route("[controller]")]
+public class UsersController : ControllerBase
+{
+    private readonly IUserService _userService = null;
+
+    public UsersController(IUserService userService)
+    {
+        _userService = userService;
+    }
+
+    [HttpPost("login")]
+    public async Task<AuthenticateResponse> Authenticate(AuthenticateRequest model)
+    {
+        var response = await _userService.Authenticate(model);
+
+        if (response == null)
+            throw new Exception("Email or password is incorrect");
+
+        return response;
+    }
+
+    [HttpPost("register")]
+    public async Task<AuthenticateResponse> Register(CreateUserRequest req)
+    {
+        var response = await _userService.Register(req);
+        return response;
+    }
+}
Index: resTools_backend/backend/DTOs/AuthenticateRequest.cs
===================================================================
--- resTools_backend/backend/DTOs/AuthenticateRequest.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/DTOs/AuthenticateRequest.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,12 @@
+namespace backend.Models;
+
+using System.ComponentModel.DataAnnotations;
+
+public class AuthenticateRequest
+{
+    [Required]
+    public string Email { get; set; }
+
+    [Required]
+    public string Password { get; set; }
+}
Index: resTools_backend/backend/DTOs/AuthenticateResponse.cs
===================================================================
--- resTools_backend/backend/DTOs/AuthenticateResponse.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/DTOs/AuthenticateResponse.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,15 @@
+using backend.Entities;
+using Newtonsoft.Json;
+
+namespace backend.Models;
+
+
+public class AuthenticateResponse
+{
+    [JsonProperty]
+    public int Id { get; set; }
+    [JsonProperty]
+    public string Email { get; set; }
+    [JsonProperty]
+    public string Token { get; set; }
+}
Index: resTools_backend/backend/DTOs/CreateReservationRequest.cs
===================================================================
--- resTools_backend/backend/DTOs/CreateReservationRequest.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/DTOs/CreateReservationRequest.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,27 @@
+﻿using backend.Entities;
+using Newtonsoft.Json;
+
+namespace backend.DTOs
+{
+    public class CreateReservationRequest
+    {
+        [JsonRequired]
+        [JsonProperty]
+        public DateTime StartDate { get; set; }
+        [JsonRequired]
+        [JsonProperty]
+        public ReservationPlace ReservationPlace { get; set; }
+        [JsonRequired]
+        [JsonProperty]
+        public ReservationType ReservationType { get; set; }
+        [JsonRequired]
+        [JsonProperty]
+        public int Persons { get; set; }
+        [JsonRequired]
+        [JsonProperty]
+        public string ContactName { get; set; }
+        [JsonRequired]
+        [JsonProperty]
+        public string ContactNumber { get; set; }
+    }
+}
Index: resTools_backend/backend/DTOs/CreateUserRequest.cs
===================================================================
--- resTools_backend/backend/DTOs/CreateUserRequest.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/DTOs/CreateUserRequest.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,13 @@
+﻿using Newtonsoft.Json;
+
+namespace backend.DTOs
+{
+    public class CreateUserRequest
+    {
+        [JsonProperty]
+        public string Email { get; set; }
+
+        [JsonProperty]
+        public string Password { get; set; }
+    }
+}
Index: resTools_backend/backend/DTOs/ReservationResponse.cs
===================================================================
--- resTools_backend/backend/DTOs/ReservationResponse.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/DTOs/ReservationResponse.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,25 @@
+﻿using backend.Entities;
+using Newtonsoft.Json;
+
+namespace backend.DTOs
+{
+    public class ReservationResponse
+    {
+        [JsonProperty]
+        public int Id { get; set; }
+        [JsonProperty]
+        public DateTime StartDate { get; set; }
+        [JsonProperty]
+        public ReservationPlace ReservationPlace { get; set; }
+        [JsonProperty]
+        public ReservationStatus ReservationStatus { get; set; }
+        [JsonProperty]
+        public ReservationType ReservationType { get; set; }
+        [JsonProperty]
+        public int Persons { get; set; }
+        [JsonProperty]
+        public string ContactName { get; set; }
+        [JsonProperty]
+        public string ContactNumber { get; set; }
+    }
+}
Index: resTools_backend/backend/DTOs/RestaurantResponse.cs
===================================================================
--- resTools_backend/backend/DTOs/RestaurantResponse.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/DTOs/RestaurantResponse.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,16 @@
+﻿using Newtonsoft.Json;
+
+namespace backend.DTOs
+{
+    public class RestaurantResponse
+    {
+        [JsonProperty]
+        public int Id { get; set; }
+        [JsonProperty]
+        public int? OwnerId { get; set; }
+        [JsonProperty]
+        public List<ReservationResponse> Reservations { get; set; }
+        [JsonProperty]
+        public string Name { get; set; }
+    }
+}
Index: resTools_backend/backend/Data/DataContext.cs
===================================================================
--- resTools_backend/backend/Data/DataContext.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Data/DataContext.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,86 @@
+﻿using backend.Entities;
+using Microsoft.EntityFrameworkCore;
+
+namespace backend.Data
+{
+    public class DataContext : DbContext
+    {
+        public DataContext(DbContextOptions<DataContext> dbContextOptions) : base(dbContextOptions)
+        {
+        }
+
+        private DbSet<User> users;
+        public DbSet<User> Users
+        {
+            get
+            {
+                if (users == null)
+                {
+                    users = Set<User>();
+                }
+
+                return users;
+            }
+        }
+
+        private DbSet<Restaurant> restaurants;
+        public DbSet<Restaurant> Restoraunts
+        {
+            get
+            {
+                if (restaurants == null)
+                {
+                    restaurants = Set<Restaurant>();
+                }
+
+                return restaurants;
+            }
+        }
+
+        private DbSet<Reservation> reservations;
+        public DbSet<Reservation> Reservations
+        {
+            get
+            { 
+                if (reservations == null)
+                {
+                    reservations = Set<Reservation>();
+                }
+
+                return reservations;
+            }
+        }
+
+
+        protected override void OnModelCreating(ModelBuilder modelBuilder)
+        {
+            //
+            // User
+            // 
+            modelBuilder.Entity<User>().Property(x => x.Id).IsRequired().ValueGeneratedOnAdd();
+            modelBuilder.Entity<User>()
+            .HasOne(p => p.Restaurant)
+            .WithOne(b => b.Owner);
+
+            //
+            // Restoraunt
+            // 
+            modelBuilder.Entity<Restaurant>().Property(x => x.Id).IsRequired().ValueGeneratedOnAdd();
+            modelBuilder.Entity<Restaurant>()
+            .HasOne(p => p.Owner)
+            .WithOne(b => b.Restaurant)
+            .HasForeignKey<Restaurant>(k => k.OwnerFk);
+            modelBuilder.Entity<Restaurant>()
+            .HasMany(p => p.Reservations)
+            .WithOne(b => b.Restaurant);
+
+            //
+            // Reservation
+            // 
+            modelBuilder.Entity<Reservation>().Property(x => x.Id).IsRequired().ValueGeneratedOnAdd();
+            modelBuilder.Entity<Reservation>()
+            .HasOne(p => p.Restaurant)
+            .WithMany(b => b.Reservations);
+        }
+    }
+}
Index: resTools_backend/backend/Entities/Reservation.cs
===================================================================
--- resTools_backend/backend/Entities/Reservation.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Entities/Reservation.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,21 @@
+﻿using Newtonsoft.Json;
+
+namespace backend.Entities
+{
+    public class Reservation
+    {
+        public int Id { get; set; }
+        public DateTime StartDate { get; set; }
+        public int Persons { get; set; }
+        public virtual Restaurant Restaurant { get; set; }
+        public ReservationPlace ReservationPlace { get; set; }
+        public ReservationStatus ReservationStatus { get; set; }
+        public ReservationType ReservationType { get; set; }
+        public string ContactName { get; set; }
+        public string ContactNumber { get; set; }
+    }
+
+    public enum ReservationType { Short, Long, Event }
+    public enum ReservationPlace { Outside, Inside}
+    public enum ReservationStatus { New, Confirmed, Cancelled }
+}
Index: resTools_backend/backend/Entities/Restaurant.cs
===================================================================
--- resTools_backend/backend/Entities/Restaurant.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Entities/Restaurant.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,13 @@
+﻿using Newtonsoft.Json;
+
+namespace backend.Entities
+{
+    public class Restaurant
+    {
+        public int Id { get; set; }
+        public int? OwnerFk { get; set; }
+        public virtual User Owner { get; set; }
+        public virtual ICollection<Reservation> Reservations { get; set; }
+        public string Name { get; set; }
+    }
+}
Index: resTools_backend/backend/Entities/User.cs
===================================================================
--- resTools_backend/backend/Entities/User.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Entities/User.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,12 @@
+using Newtonsoft.Json;
+
+namespace backend.Entities;
+
+public class User
+{
+    public int Id { get; set; }
+    public string Email { get; set; }
+    public string Password { get; set; }
+    [JsonIgnore]
+    public virtual Restaurant Restaurant { get; set; }
+}
Index: resTools_backend/backend/Helpers/AppSettings.cs
===================================================================
--- resTools_backend/backend/Helpers/AppSettings.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Helpers/AppSettings.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,6 @@
+namespace backend.Helpers;
+
+public class AppSettings
+{
+    public string Secret { get; set; }
+}
Index: resTools_backend/backend/Helpers/AuthorizeAttribute.cs
===================================================================
--- resTools_backend/backend/Helpers/AuthorizeAttribute.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Helpers/AuthorizeAttribute.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,19 @@
+namespace backend.Helpers;
+
+using backend.Entities;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.Filters;
+
+[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
+public class AuthorizeAttribute : Attribute, IAuthorizationFilter
+{
+    public void OnAuthorization(AuthorizationFilterContext context)
+    {
+        var user = context.HttpContext.Items["User"];
+        if (user == null)
+        {
+            // not logged in
+            context.Result = new JsonResult(new { message = "Unauthorized" }) { StatusCode = StatusCodes.Status401Unauthorized };
+        }
+    }
+}
Index: resTools_backend/backend/Helpers/JwtMiddleware.cs
===================================================================
--- resTools_backend/backend/Helpers/JwtMiddleware.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Helpers/JwtMiddleware.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,55 @@
+namespace WebApi.Helpers;
+
+using Microsoft.Extensions.Options;
+using Microsoft.IdentityModel.Tokens;
+using System.IdentityModel.Tokens.Jwt;
+using backend.Services;
+using backend.Helpers;
+
+public class JwtMiddleware
+{
+    private readonly RequestDelegate _next;
+    private readonly AppSettings _appSettings;
+
+    public JwtMiddleware(RequestDelegate next, IOptions<AppSettings> appSettings)
+    {
+        _next = next;
+        _appSettings = appSettings.Value;
+    }
+
+    public async Task Invoke(HttpContext context, IUserService userService)
+    {
+        var token = context.Request.Headers["Authorization"].FirstOrDefault()?.Split(" ").Last();
+
+        if (token != null)
+            attachUserToContext(context, userService, token);
+
+        await _next(context);
+    }
+
+    private void attachUserToContext(HttpContext context, IUserService userService, string token)
+    {
+        try
+        {
+            var tokenHandler = new JwtSecurityTokenHandler();
+            var key = System.Text.Encoding.ASCII.GetBytes(_appSettings.Secret);
+            tokenHandler.ValidateToken(token, new TokenValidationParameters
+            {
+                ValidateIssuerSigningKey = true,
+                IssuerSigningKey = new SymmetricSecurityKey(key),
+                ValidateIssuer = false,
+                ValidateAudience = false,
+                ClockSkew = TimeSpan.Zero
+            }, out SecurityToken validatedToken);
+
+            var jwtToken = (JwtSecurityToken)validatedToken;
+            var userId = int.Parse(jwtToken.Claims.First(x => x.Type == "id").Value);
+
+            context.Items["User"] = userId;
+        }
+        catch
+        {
+            // do nothing if jwt validation fails
+        }
+    }
+}
Index: resTools_backend/backend/Migrations/20220409103618_Initial-Architecture.Designer.cs
===================================================================
--- resTools_backend/backend/Migrations/20220409103618_Initial-Architecture.Designer.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Migrations/20220409103618_Initial-Architecture.Designer.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,142 @@
+﻿// <auto-generated />
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using backend.Data;
+
+#nullable disable
+
+namespace backend.Migrations
+{
+    [DbContext(typeof(DataContext))]
+    [Migration("20220409103618_Initial-Architecture")]
+    partial class InitialArchitecture
+    {
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
+        {
+#pragma warning disable 612, 618
+            modelBuilder
+                .HasAnnotation("ProductVersion", "6.0.3")
+                .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+            modelBuilder.Entity("backend.Entities.Reservation", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("ContactName")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("ContactNumber")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int>("ReservationPlace")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("ReservationStatus")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("ReservationType")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("RestaurantId")
+                        .HasColumnType("integer");
+
+                    b.Property<DateTime>("StartDate")
+                        .HasColumnType("timestamp with time zone");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("RestaurantId");
+
+                    b.ToTable("Reservations");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int?>("OwnerFk")
+                        .HasColumnType("integer");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("OwnerFk")
+                        .IsUnique();
+
+                    b.ToTable("Restoraunts");
+                });
+
+            modelBuilder.Entity("backend.Entities.User", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("Password")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("Username")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Users");
+                });
+
+            modelBuilder.Entity("backend.Entities.Reservation", b =>
+                {
+                    b.HasOne("backend.Entities.Restaurant", "Restaurant")
+                        .WithMany("Reservations")
+                        .HasForeignKey("RestaurantId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Restaurant");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.HasOne("backend.Entities.User", "Owner")
+                        .WithOne("Restaurant")
+                        .HasForeignKey("backend.Entities.Restaurant", "OwnerFk");
+
+                    b.Navigation("Owner");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.Navigation("Reservations");
+                });
+
+            modelBuilder.Entity("backend.Entities.User", b =>
+                {
+                    b.Navigation("Restaurant")
+                        .IsRequired();
+                });
+#pragma warning restore 612, 618
+        }
+    }
+}
Index: resTools_backend/backend/Migrations/20220409103618_Initial-Architecture.cs
===================================================================
--- resTools_backend/backend/Migrations/20220409103618_Initial-Architecture.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Migrations/20220409103618_Initial-Architecture.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,95 @@
+﻿using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace backend.Migrations
+{
+    public partial class InitialArchitecture : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.CreateTable(
+                name: "Users",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "integer", nullable: false)
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+                    Username = table.Column<string>(type: "text", nullable: false),
+                    Password = table.Column<string>(type: "text", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Users", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Restoraunts",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "integer", nullable: false)
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+                    OwnerFk = table.Column<int>(type: "integer", nullable: true),
+                    Name = table.Column<string>(type: "text", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Restoraunts", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Restoraunts_Users_OwnerFk",
+                        column: x => x.OwnerFk,
+                        principalTable: "Users",
+                        principalColumn: "Id");
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Reservations",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "integer", nullable: false)
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+                    StartDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
+                    RestaurantId = table.Column<int>(type: "integer", nullable: false),
+                    ReservationPlace = table.Column<int>(type: "integer", nullable: false),
+                    ReservationStatus = table.Column<int>(type: "integer", nullable: false),
+                    ReservationType = table.Column<int>(type: "integer", nullable: false),
+                    ContactName = table.Column<string>(type: "text", nullable: false),
+                    ContactNumber = table.Column<string>(type: "text", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Reservations", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Reservations_Restoraunts_RestaurantId",
+                        column: x => x.RestaurantId,
+                        principalTable: "Restoraunts",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Reservations_RestaurantId",
+                table: "Reservations",
+                column: "RestaurantId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Restoraunts_OwnerFk",
+                table: "Restoraunts",
+                column: "OwnerFk",
+                unique: true);
+        }
+
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "Reservations");
+
+            migrationBuilder.DropTable(
+                name: "Restoraunts");
+
+            migrationBuilder.DropTable(
+                name: "Users");
+        }
+    }
+}
Index: resTools_backend/backend/Migrations/20220411110455_Change-Propname.Designer.cs
===================================================================
--- resTools_backend/backend/Migrations/20220411110455_Change-Propname.Designer.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Migrations/20220411110455_Change-Propname.Designer.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,142 @@
+﻿// <auto-generated />
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using backend.Data;
+
+#nullable disable
+
+namespace backend.Migrations
+{
+    [DbContext(typeof(DataContext))]
+    [Migration("20220411110455_Change-Propname")]
+    partial class ChangePropname
+    {
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
+        {
+#pragma warning disable 612, 618
+            modelBuilder
+                .HasAnnotation("ProductVersion", "6.0.3")
+                .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+            modelBuilder.Entity("backend.Entities.Reservation", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("ContactName")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("ContactNumber")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int>("ReservationPlace")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("ReservationStatus")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("ReservationType")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("RestaurantId")
+                        .HasColumnType("integer");
+
+                    b.Property<DateTime>("StartDate")
+                        .HasColumnType("timestamp with time zone");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("RestaurantId");
+
+                    b.ToTable("Reservations");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int?>("OwnerFk")
+                        .HasColumnType("integer");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("OwnerFk")
+                        .IsUnique();
+
+                    b.ToTable("Restoraunts");
+                });
+
+            modelBuilder.Entity("backend.Entities.User", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("Email")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("Password")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Users");
+                });
+
+            modelBuilder.Entity("backend.Entities.Reservation", b =>
+                {
+                    b.HasOne("backend.Entities.Restaurant", "Restaurant")
+                        .WithMany("Reservations")
+                        .HasForeignKey("RestaurantId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Restaurant");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.HasOne("backend.Entities.User", "Owner")
+                        .WithOne("Restaurant")
+                        .HasForeignKey("backend.Entities.Restaurant", "OwnerFk");
+
+                    b.Navigation("Owner");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.Navigation("Reservations");
+                });
+
+            modelBuilder.Entity("backend.Entities.User", b =>
+                {
+                    b.Navigation("Restaurant")
+                        .IsRequired();
+                });
+#pragma warning restore 612, 618
+        }
+    }
+}
Index: resTools_backend/backend/Migrations/20220411110455_Change-Propname.cs
===================================================================
--- resTools_backend/backend/Migrations/20220411110455_Change-Propname.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Migrations/20220411110455_Change-Propname.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,25 @@
+﻿using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace backend.Migrations
+{
+    public partial class ChangePropname : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.RenameColumn(
+                name: "Username",
+                table: "Users",
+                newName: "Email");
+        }
+
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.RenameColumn(
+                name: "Email",
+                table: "Users",
+                newName: "Username");
+        }
+    }
+}
Index: resTools_backend/backend/Migrations/20220411130410_Add-Persons.Designer.cs
===================================================================
--- resTools_backend/backend/Migrations/20220411130410_Add-Persons.Designer.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Migrations/20220411130410_Add-Persons.Designer.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,145 @@
+﻿// <auto-generated />
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using backend.Data;
+
+#nullable disable
+
+namespace backend.Migrations
+{
+    [DbContext(typeof(DataContext))]
+    [Migration("20220411130410_Add-Persons")]
+    partial class AddPersons
+    {
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
+        {
+#pragma warning disable 612, 618
+            modelBuilder
+                .HasAnnotation("ProductVersion", "6.0.3")
+                .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+            modelBuilder.Entity("backend.Entities.Reservation", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("ContactName")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("ContactNumber")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int>("Persons")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("ReservationPlace")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("ReservationStatus")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("ReservationType")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("RestaurantId")
+                        .HasColumnType("integer");
+
+                    b.Property<DateTime>("StartDate")
+                        .HasColumnType("timestamp with time zone");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("RestaurantId");
+
+                    b.ToTable("Reservations");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int?>("OwnerFk")
+                        .HasColumnType("integer");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("OwnerFk")
+                        .IsUnique();
+
+                    b.ToTable("Restoraunts");
+                });
+
+            modelBuilder.Entity("backend.Entities.User", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("Email")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("Password")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Users");
+                });
+
+            modelBuilder.Entity("backend.Entities.Reservation", b =>
+                {
+                    b.HasOne("backend.Entities.Restaurant", "Restaurant")
+                        .WithMany("Reservations")
+                        .HasForeignKey("RestaurantId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Restaurant");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.HasOne("backend.Entities.User", "Owner")
+                        .WithOne("Restaurant")
+                        .HasForeignKey("backend.Entities.Restaurant", "OwnerFk");
+
+                    b.Navigation("Owner");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.Navigation("Reservations");
+                });
+
+            modelBuilder.Entity("backend.Entities.User", b =>
+                {
+                    b.Navigation("Restaurant")
+                        .IsRequired();
+                });
+#pragma warning restore 612, 618
+        }
+    }
+}
Index: resTools_backend/backend/Migrations/20220411130410_Add-Persons.cs
===================================================================
--- resTools_backend/backend/Migrations/20220411130410_Add-Persons.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Migrations/20220411130410_Add-Persons.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,26 @@
+﻿using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace backend.Migrations
+{
+    public partial class AddPersons : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AddColumn<int>(
+                name: "Persons",
+                table: "Reservations",
+                type: "integer",
+                nullable: false,
+                defaultValue: 0);
+        }
+
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "Persons",
+                table: "Reservations");
+        }
+    }
+}
Index: resTools_backend/backend/Migrations/DataContextModelSnapshot.cs
===================================================================
--- resTools_backend/backend/Migrations/DataContextModelSnapshot.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Migrations/DataContextModelSnapshot.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,143 @@
+﻿// <auto-generated />
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using backend.Data;
+
+#nullable disable
+
+namespace backend.Migrations
+{
+    [DbContext(typeof(DataContext))]
+    partial class DataContextModelSnapshot : ModelSnapshot
+    {
+        protected override void BuildModel(ModelBuilder modelBuilder)
+        {
+#pragma warning disable 612, 618
+            modelBuilder
+                .HasAnnotation("ProductVersion", "6.0.3")
+                .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+            modelBuilder.Entity("backend.Entities.Reservation", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("ContactName")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("ContactNumber")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int>("Persons")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("ReservationPlace")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("ReservationStatus")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("ReservationType")
+                        .HasColumnType("integer");
+
+                    b.Property<int>("RestaurantId")
+                        .HasColumnType("integer");
+
+                    b.Property<DateTime>("StartDate")
+                        .HasColumnType("timestamp with time zone");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("RestaurantId");
+
+                    b.ToTable("Reservations");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int?>("OwnerFk")
+                        .HasColumnType("integer");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("OwnerFk")
+                        .IsUnique();
+
+                    b.ToTable("Restoraunts");
+                });
+
+            modelBuilder.Entity("backend.Entities.User", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+
+                    b.Property<string>("Email")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("Password")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Users");
+                });
+
+            modelBuilder.Entity("backend.Entities.Reservation", b =>
+                {
+                    b.HasOne("backend.Entities.Restaurant", "Restaurant")
+                        .WithMany("Reservations")
+                        .HasForeignKey("RestaurantId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Restaurant");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.HasOne("backend.Entities.User", "Owner")
+                        .WithOne("Restaurant")
+                        .HasForeignKey("backend.Entities.Restaurant", "OwnerFk");
+
+                    b.Navigation("Owner");
+                });
+
+            modelBuilder.Entity("backend.Entities.Restaurant", b =>
+                {
+                    b.Navigation("Reservations");
+                });
+
+            modelBuilder.Entity("backend.Entities.User", b =>
+                {
+                    b.Navigation("Restaurant")
+                        .IsRequired();
+                });
+#pragma warning restore 612, 618
+        }
+    }
+}
Index: resTools_backend/backend/Program.cs
===================================================================
--- resTools_backend/backend/Program.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Program.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,75 @@
+using backend.Data;
+using backend.Helpers;
+using backend.Services;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.OpenApi.Models;
+using WebApi.Helpers;
+
+var builder = WebApplication.CreateBuilder(args);
+
+// Add services to the container.
+builder.Services.Configure<AppSettings>(builder.Configuration.GetSection("AppSettings"));
+builder.Services.AddControllers().AddNewtonsoftJson();
+// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
+builder.Services.AddEndpointsApiExplorer();
+builder.Services.AddSwaggerGen(c =>
+{
+    c.SwaggerDoc("v1", new OpenApiInfo() { Title = "resTools backend", Version = "v1" });
+    c.AddSecurityDefinition("Bearer",
+        new OpenApiSecurityScheme
+        {
+            In = Microsoft.OpenApi.Models.ParameterLocation.Header,
+            Description = "Please enter into field the word 'Bearer' following by space and JWT",
+            Name = "Authorization",
+            Type = Microsoft.OpenApi.Models.SecuritySchemeType.ApiKey,
+            Scheme="Bearer"
+        });
+    c.AddSecurityRequirement(new OpenApiSecurityRequirement()
+    {
+        {
+            new OpenApiSecurityScheme
+            {
+                Reference = new OpenApiReference
+                {
+                    Type = ReferenceType.SecurityScheme,
+                    Id = "Bearer"
+                },
+                Name = "Bearer",
+                In = ParameterLocation.Header,
+
+            },
+            new List<string>()
+        }
+    });
+});
+builder.Services.AddScoped<IUserService, UserService>();
+builder.Services.AddScoped<IRestaurantService, RestaurantService>();
+builder.Services.AddScoped<IReservationService, ReservationService>();
+builder.Services.AddScoped<ISmsService, SmsService>();
+
+builder.Services.AddDbContext<DataContext>(p => p.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
+
+var app = builder.Build();
+
+app.UseCors(x => x
+        .AllowAnyOrigin()
+        .AllowAnyMethod()
+        .AllowAnyHeader());
+
+// custom jwt auth middleware
+app.UseMiddleware<JwtMiddleware>();
+
+// Configure the HTTP request pipeline.
+if (app.Environment.IsDevelopment())
+{
+    app.UseSwagger();
+    app.UseSwaggerUI();
+}
+
+app.UseHttpsRedirection();
+
+app.UseAuthorization();
+
+app.MapControllers();
+
+app.Run();
Index: resTools_backend/backend/Properties/launchSettings.json
===================================================================
--- resTools_backend/backend/Properties/launchSettings.json	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Properties/launchSettings.json	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,31 @@
+﻿{
+  "$schema": "https://json.schemastore.org/launchsettings.json",
+  "iisSettings": {
+    "windowsAuthentication": false,
+    "anonymousAuthentication": true,
+    "iisExpress": {
+      "applicationUrl": "http://localhost:16765",
+      "sslPort": 44324
+    }
+  },
+  "profiles": {
+    "backend": {
+      "commandName": "Project",
+      "dotnetRunMessages": true,
+      "launchBrowser": true,
+      "launchUrl": "swagger",
+      "applicationUrl": "https://localhost:7073;http://localhost:5073",
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      }
+    },
+    "IIS Express": {
+      "commandName": "IISExpress",
+      "launchBrowser": true,
+      "launchUrl": "swagger",
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      }
+    }
+  }
+}
Index: resTools_backend/backend/Services/ReservationService.cs
===================================================================
--- resTools_backend/backend/Services/ReservationService.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Services/ReservationService.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,51 @@
+﻿using backend.Data;
+using backend.DTOs;
+using backend.Entities;
+using Microsoft.EntityFrameworkCore;
+
+namespace backend.Services
+{
+    public interface IReservationService
+    {
+        public Task CreateReservation(CreateReservationRequest req);
+        public Task ChangeReservationStatus(int resId, ReservationStatus status);
+    }
+    public class ReservationService : IReservationService
+    {
+        private readonly DataContext _context = null;
+        private readonly ISmsService _smsService = null;
+
+        public ReservationService(DataContext context, ISmsService smsService)
+        {
+            _context = context;
+            _smsService = smsService;
+        }
+
+        public async Task ChangeReservationStatus(int resId, ReservationStatus status)
+        {
+            var reservation = await _context.Reservations.FindAsync(resId);
+            reservation.ReservationStatus = status;
+            _context.Update(reservation);
+            await _context.SaveChangesAsync();
+            _smsService.ReservationStatusUpdate(reservation.ContactName, reservation.ContactNumber, reservation.ReservationStatus);
+        }
+
+        public async Task CreateReservation(CreateReservationRequest req)
+        {
+            Restaurant res = await _context.Restoraunts.Include(x => x.Reservations).FirstOrDefaultAsync();
+            Reservation reservation = new Reservation()
+            {
+                ContactName = req.ContactName,
+                ContactNumber = req.ContactNumber,
+                ReservationPlace = req.ReservationPlace,
+                ReservationType = req.ReservationType,
+                StartDate = req.StartDate,
+                Persons = req.Persons,
+                ReservationStatus = ReservationStatus.New
+            };
+            res.Reservations.Add(reservation);
+            _context.Restoraunts.Update(res);
+            await _context.SaveChangesAsync();
+        }
+    }
+}
Index: resTools_backend/backend/Services/RestaurantService.cs
===================================================================
--- resTools_backend/backend/Services/RestaurantService.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Services/RestaurantService.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,54 @@
+﻿using backend.Data;
+using backend.DTOs;
+using backend.Entities;
+using Microsoft.EntityFrameworkCore;
+
+namespace backend.Services
+{
+    public interface IRestaurantService
+    {
+        public Task CreateRestaurant(string name, int userId);
+        public Task<RestaurantResponse> GetRestaurant();
+    }
+    public class RestaurantService : IRestaurantService
+    {
+        private readonly DataContext _context = null;
+
+        public RestaurantService(DataContext context)
+        {
+            _context = context;
+        }
+        public async Task CreateRestaurant(string name, int userId)
+        {
+            User user = await _context.Users.FindAsync(userId);
+            Restaurant restaurant = new Restaurant() { Name = name, Owner = user};
+            await _context.Restoraunts.AddAsync(restaurant);
+            await _context.SaveChangesAsync();
+        }
+
+        public async Task<RestaurantResponse> GetRestaurant()
+        {
+            RestaurantResponse res = await _context.Restoraunts
+                .Include(x => x.Reservations)
+                .Select(x => new RestaurantResponse()
+                {
+                    Id = x.Id,
+                    Name = x.Name,
+                    OwnerId = x.OwnerFk,
+                    Reservations = x.Reservations.Select(t => new ReservationResponse()
+                    {
+                        ContactName = t.ContactName,
+                        ContactNumber = t.ContactNumber,
+                        Persons = t.Persons,
+                        StartDate = t.StartDate,
+                        ReservationStatus = t.ReservationStatus,
+                        Id = t.Id,
+                        ReservationPlace = t.ReservationPlace,
+                        ReservationType = t.ReservationType
+                    }).ToList()
+                })
+                .FirstOrDefaultAsync();
+            return res;
+        }
+    }
+}
Index: resTools_backend/backend/Services/SmsService.cs
===================================================================
--- resTools_backend/backend/Services/SmsService.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Services/SmsService.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,20 @@
+﻿using backend.Entities;
+
+namespace backend.Services
+{
+    public interface ISmsService
+    {
+        public Task ReservationStatusUpdate(string name, string number, ReservationStatus newStatus);
+    }
+    public class SmsService : ISmsService
+    {
+        public async Task ReservationStatusUpdate(string name, string number, ReservationStatus newStatus)
+        {
+            string message = $"Hello {name}, the status of your reservation was changed to: { Enum.GetName(typeof(ReservationStatus), newStatus)}";
+
+            // simulate sending sms
+            await Task.Delay(100);
+            Console.WriteLine(message);
+        }
+    }
+}
Index: resTools_backend/backend/Services/UserService.cs
===================================================================
--- resTools_backend/backend/Services/UserService.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/Services/UserService.cs	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,73 @@
+namespace backend.Services;
+
+using backend.Data;
+using backend.DTOs;
+using backend.Entities;
+using backend.Helpers;
+using backend.Models;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Options;
+using Microsoft.IdentityModel.Tokens;
+using System.IdentityModel.Tokens.Jwt;
+using System.Security.Claims;
+
+public interface IUserService
+{
+    Task<AuthenticateResponse> Authenticate(AuthenticateRequest model);
+    Task<AuthenticateResponse> Register(CreateUserRequest req);
+    Task<User> GetById(int id);
+}
+
+public class UserService : IUserService
+{
+    private readonly AppSettings _appSettings;
+    private readonly DataContext _context = null;
+
+    public UserService(IOptions<AppSettings> appSettings, DataContext context)
+    {
+        _appSettings = appSettings.Value;
+        _context = context;
+    }
+
+    public async Task<AuthenticateResponse> Authenticate(AuthenticateRequest model)
+    {
+        User user = await _context.Users.FirstOrDefaultAsync(x => x.Email == model.Email && x.Password == model.Password);
+
+        // return null if user not found
+        if (user == null) return null;
+
+        // authentication successful so generate jwt token
+        var token = generateJwtToken(user);
+
+        return new AuthenticateResponse { Email = user.Email, Id = user.Id, Token = token};
+    }
+
+    public async Task<User> GetById(int id)
+    {
+        return await _context.Users.FindAsync(id);
+    }
+
+    public async Task<AuthenticateResponse> Register(CreateUserRequest req)
+    {
+        User user = new User() { Email = req.Email, Password = req.Password };
+        await _context.Users.AddAsync(user);
+        await _context.SaveChangesAsync();
+        var token = generateJwtToken(user);
+        return new AuthenticateResponse { Email = user.Email, Id = user.Id, Token = token };
+    }
+
+    private string generateJwtToken(User user)
+    {
+        // generate token that is valid for 7 days
+        var tokenHandler = new JwtSecurityTokenHandler();
+        var key = System.Text.Encoding.ASCII.GetBytes(_appSettings.Secret);
+        var tokenDescriptor = new SecurityTokenDescriptor
+        {
+            Subject = new ClaimsIdentity(new[] { new Claim("id", user.Id.ToString()) }),
+            Expires = DateTime.UtcNow.AddDays(7),
+            SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature)
+        };
+        var token = tokenHandler.CreateToken(tokenDescriptor);
+        return tokenHandler.WriteToken(token);
+    }
+}
Index: resTools_backend/backend/appsettings.Development.json
===================================================================
--- resTools_backend/backend/appsettings.Development.json	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/appsettings.Development.json	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,8 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft.AspNetCore": "Warning"
+    }
+  }
+}
Index: resTools_backend/backend/appsettings.json
===================================================================
--- resTools_backend/backend/appsettings.json	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/appsettings.json	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,15 @@
+{
+  "AppSettings": {
+    "Secret": "chWS2ewNYT2tpLWIm1L5ty12c8FINao7p65LxPPM7GjkytlI5X1iZYWuh5KQhZgxkQqf8FVZuklWTfp0fDd4pvFy8ND6ecgircfxG2IckDzte1I2ZrTMS7xhpsux8vLxLGkGUi9ZXOAO9oaOYP5IelwJdiHiryEj9BdfMGT1QgRfsHHazqz6gtrJIcdW2pb3yrXPGtQ20UvXgXxw7dyAwd3byZexM0t781qgp7rT71YgkVyc8YBx74U6DcWtSka7"
+  },
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft.AspNetCore": "Warning"
+    }
+  },
+  "ConnectionStrings": {
+    "DefaultConnection": "Server=localhost; port=5432; user id = postgres; database=resToolsDB; password=121212; pooling = true; includeerrordetail = true"
+  },
+  "AllowedHosts": "*"
+}
Index: resTools_backend/backend/backend.csproj
===================================================================
--- resTools_backend/backend/backend.csproj	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
+++ resTools_backend/backend/backend.csproj	(revision 7a983b0054a13b5462a3e4a09e6fe5bf350d0949)
@@ -0,0 +1,29 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <Nullable>enable</Nullable>
+    <ImplicitUsings>enable</ImplicitUsings>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <None Include="..\.editorconfig" Link=".editorconfig" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.3" />
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.3" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.3" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.3">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
+    <PackageReference Include="Npgsql" Version="6.0.3" />
+    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.3" />
+    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
+    <PackageReference Include="Swashbuckle.Core" Version="5.6.0" />
+    <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.17.0" />
+  </ItemGroup>
+
+</Project>
