Skip to content
7 changes: 7 additions & 0 deletions Evand-Backend/Evand.API/Evand.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Evand.Application\Evand.Application.csproj" />
<ProjectReference Include="..\Evand.Persistence\Evand.Persistence.csproj" />
<ProjectReference Include="..\Evand.Infrastructure\Evand.Infrastructure.csproj" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions Evand-Backend/Evand.Application/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Evand.Application;

public class Class1
{

}
13 changes: 13 additions & 0 deletions Evand-Backend/Evand.Application/Evand.Application.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\Evand.Domain\Evand.Domain.csproj" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
14 changes: 14 additions & 0 deletions Evand-Backend/Evand.Domain/Entities/Base/BaseEntity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Evand.Domain.Entities.Base
{
public class BaseEntity
{
public int Id { get; set; }
public Guid Guid { get; set; } = Guid.NewGuid();
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
}
31 changes: 31 additions & 0 deletions Evand-Backend/Evand.Domain/Entities/Event.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Evand.Domain.Entities.Base;

namespace Evand.Domain.Entities
{
public class Event : BaseEntity
{
public string Name { get; set; } = null!;
public string Category { get; set; } = null!;
public double? X { get; set; }
public double? Y { get; set; }
public decimal Price { get; set; }
public string? Photo { get; set; }
public string Address { get; set; } = null!;
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public int Capacity { get; set; }

public int OrganizerId { get; set; }
public User Organizer { get; set; } = null!;

public DateTime OrganizedDate { get; set; }

public ICollection<EventParticipant> Participants { get; set; } = new List<EventParticipant>();
public ICollection<EventLike> Likes { get; set; } = new List<EventLike>();
public ICollection<EventComment> Comments { get; set; } = new List<EventComment>();
}
}
21 changes: 21 additions & 0 deletions Evand-Backend/Evand.Domain/Entities/EventComment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Evand.Domain.Entities.Base;

namespace Evand.Domain.Entities
{
public class EventComment : BaseEntity
{
public string Text { get; set; } = null!;

public int UserId { get; set; }
public User User { get; set; } = null!;

public int EventId { get; set; }
public Event Event { get; set; } = null!;

public DateTime CommentedAt { get; set; }
}
}
18 changes: 18 additions & 0 deletions Evand-Backend/Evand.Domain/Entities/EventLike.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Evand.Domain.Entities
{
public class EventLike
{
public int UserId { get; set; }
public User User { get; set; } = null!;

public int EventId { get; set; }
public Event Event { get; set; } = null!;

public DateTime LikedAt { get; set; }
}
}
19 changes: 19 additions & 0 deletions Evand-Backend/Evand.Domain/Entities/EventParticipant.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Evand.Domain.Entities.Base;

namespace Evand.Domain.Entities
{
public class EventParticipant : BaseEntity
{
public int UserId { get; set; }
public User User { get; set; } = null!;

public int EventId { get; set; }
public Event Event { get; set; } = null!;

public DateTime ParticipatedAt { get; set; }
}
}
26 changes: 26 additions & 0 deletions Evand-Backend/Evand.Domain/Entities/User.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Evand.Domain.Entities.Base;

namespace Evand.Domain.Entities
{
public class User : BaseEntity
{
public string FullName { get; set; } = null!;
public string Email { get; set; } = null!;
public string HashPassword { get; set; } = null!;
public string? PhoneNumber { get; set; }

public string? City { get; set; }

public string? Province { get; set; }
public string? Avatar { get; set; }

public ICollection<EventParticipant> ParticipatedEvents { get; set; } = new List<EventParticipant>();
public ICollection<EventLike> LikedEvents { get; set; } = new List<EventLike>();
public ICollection<EventComment> Comments { get; set; } = new List<EventComment>();
}
}
9 changes: 9 additions & 0 deletions Evand-Backend/Evand.Domain/Evand.Domain.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
6 changes: 6 additions & 0 deletions Evand-Backend/Evand.Infrastructure/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Evand.Infrastructure;

public class Class1
{

}
19 changes: 19 additions & 0 deletions Evand-Backend/Evand.Infrastructure/Evand.Infrastructure.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\Evand.Application\Evand.Application.csproj" />
<ProjectReference Include="..\Evand.Domain\Evand.Domain.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.1" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
6 changes: 6 additions & 0 deletions Evand-Backend/Evand.Persistence/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Evand.Persistence;

public class Class1
{

}
22 changes: 22 additions & 0 deletions Evand-Backend/Evand.Persistence/DbContextes/EvandDbContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Evand.Domain.Entities;
using Microsoft.EntityFrameworkCore;

namespace Evand.Persistence.DbContextes
{
public class EvandDbContext(DbContextOptions<EvandDbContext> options) : DbContext(options)
{

// ===== DbSets =====
public DbSet<User> Users => Set<User>();
public DbSet<Event> Events => Set<Event>();

public DbSet<EventParticipant> EventParticipants => Set<EventParticipant>();
public DbSet<EventLike> EventLikes => Set<EventLike>();
public DbSet<EventComment> EventComments => Set<EventComment>();

}
}
23 changes: 23 additions & 0 deletions Evand-Backend/Evand.Persistence/Evand.Persistence.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\Evand.Application\Evand.Application.csproj" />
<ProjectReference Include="..\Evand.Domain\Evand.Domain.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
56 changes: 56 additions & 0 deletions Evand-Backend/Evand.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Evand.API", "Evand.API\Evand.API.csproj", "{60A16710-9DAA-40DA-B7E8-D261849A0B4D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Evand.Domain", "Evand.Domain\Evand.Domain.csproj", "{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Evand.Application", "Evand.Application\Evand.Application.csproj", "{C0615288-BAC6-4228-B28E-69CEC24A0198}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Evand.Persistence", "Evand.Persistence\Evand.Persistence.csproj", "{B3F737D2-A770-4156-99F7-E6990FCDA665}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Evand.Infrastructure", "Evand.Infrastructure\Evand.Infrastructure.csproj", "{1F685523-824C-4698-9D47-41E435428491}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -27,6 +35,54 @@ Global
{60A16710-9DAA-40DA-B7E8-D261849A0B4D}.Release|x64.Build.0 = Release|Any CPU
{60A16710-9DAA-40DA-B7E8-D261849A0B4D}.Release|x86.ActiveCfg = Release|Any CPU
{60A16710-9DAA-40DA-B7E8-D261849A0B4D}.Release|x86.Build.0 = Release|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Debug|x64.ActiveCfg = Debug|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Debug|x64.Build.0 = Debug|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Debug|x86.ActiveCfg = Debug|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Debug|x86.Build.0 = Debug|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Release|Any CPU.Build.0 = Release|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Release|x64.ActiveCfg = Release|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Release|x64.Build.0 = Release|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Release|x86.ActiveCfg = Release|Any CPU
{15BE70E3-9A15-4C10-A594-7BD7E8F6C5FD}.Release|x86.Build.0 = Release|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Debug|x64.ActiveCfg = Debug|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Debug|x64.Build.0 = Debug|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Debug|x86.ActiveCfg = Debug|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Debug|x86.Build.0 = Debug|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Release|Any CPU.Build.0 = Release|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Release|x64.ActiveCfg = Release|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Release|x64.Build.0 = Release|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Release|x86.ActiveCfg = Release|Any CPU
{C0615288-BAC6-4228-B28E-69CEC24A0198}.Release|x86.Build.0 = Release|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Debug|x64.ActiveCfg = Debug|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Debug|x64.Build.0 = Debug|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Debug|x86.ActiveCfg = Debug|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Debug|x86.Build.0 = Debug|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Release|Any CPU.Build.0 = Release|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Release|x64.ActiveCfg = Release|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Release|x64.Build.0 = Release|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Release|x86.ActiveCfg = Release|Any CPU
{B3F737D2-A770-4156-99F7-E6990FCDA665}.Release|x86.Build.0 = Release|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Debug|x64.ActiveCfg = Debug|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Debug|x64.Build.0 = Debug|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Debug|x86.ActiveCfg = Debug|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Debug|x86.Build.0 = Debug|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Release|Any CPU.Build.0 = Release|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Release|x64.ActiveCfg = Release|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Release|x64.Build.0 = Release|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Release|x86.ActiveCfg = Release|Any CPU
{1F685523-824C-4698-9D47-41E435428491}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading