(result.Content);
+ }
+
+ ///
+ /// There are a lot more fields according to:
+ /// https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets
+ /// but these are the ones we care about for our use case.
+ ///
+ private class TweetV2PostRequest
+ {
+ [JsonProperty("text")]
+ public string Text { get; set; } = string.Empty;
+ }
+ }
+
+ public record TweetV2PostData
+ {
+ [JsonProperty("id")]
+ public string Id { get; init; }
+ [JsonProperty("text")]
+ public string Text { get; init; }
+
+ public TweetV2PostData(string id, string text)
+ {
+ Id = id;
+ Text = text;
+ }
+ }
+
+ public record TweetV2PostResponse
+ {
+ [JsonProperty("data")]
+ public TweetV2PostData Data { get; init; }
+
+ public string? Id => Data?.Id;
+ public string? Text => Data?.Text;
+
+ public TweetV2PostResponse(TweetV2PostData data)
+ {
+ Data = data;
+ }
+ }
+}
diff --git a/README.md b/README.md
index fd63673..f528172 100644
--- a/README.md
+++ b/README.md
@@ -48,7 +48,8 @@ To run the Website and API locally, follow these steps:
5. **Access the Application:**
- Once the Docker containers are up and running, you can access the Website in your browser. The website should launch automatically as soon as all the containers are ready.
- If the Website does not launch automatically, it will be running at `http://localhost:{port}` (the actual port will be displayed in the output window of Visual Studio: "Container Tools").
- - The API will also be running locally and accessible via a different URL. You can see its documentation and test the endpoints at `http://localhost:51515/swagger`.
+ - The API will also be running locally and accessible via a different URL. You can see its documentation and test the endpoints at `http://localhost:51515/swagger`.
+ - You can login to the API with any username from [the database initialization script](./mongo-init.js) and password: **Password@135**.
## Contributing
diff --git a/Test/Test.csproj b/Test/Test.csproj
index b319d04..711091c 100644
--- a/Test/Test.csproj
+++ b/Test/Test.csproj
@@ -1,36 +1,24 @@
-
-
- net6.0
- enable
-
- false
-
-
-
-
-
-
-
-
- runtime; build; native; contentfiles; analyzers; buildtransitive
- all
-
-
- runtime; build; native; contentfiles; analyzers; buildtransitive
- all
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ net8.0
+ enable
+ false
+
+
+
+
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Website/Dockerfile b/Website/Dockerfile
index 78fb695..03cf50f 100644
--- a/Website/Dockerfile
+++ b/Website/Dockerfile
@@ -10,8 +10,6 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Website/Website.csproj", "Website/"]
-COPY ["Application/Application.csproj", "Application/"]
-COPY ["Core/Core.csproj", "Core/"]
RUN dotnet restore "./Website/Website.csproj"
COPY . .
WORKDIR "/src/Website"
diff --git a/Website/Pages/SearchResults.cshtml b/Website/Pages/SearchResults.cshtml
index 6260ff4..766fc8e 100644
--- a/Website/Pages/SearchResults.cshtml
+++ b/Website/Pages/SearchResults.cshtml
@@ -29,12 +29,7 @@
{
-
Brief Meaning: @name.Meaning
-
-
- @Localizer["submitby"] @name.SubmittedBy
-
}
}
diff --git a/Website/Pages/SingleEntry.cshtml b/Website/Pages/SingleEntry.cshtml
index e9d7fd9..b04ab38 100644
--- a/Website/Pages/SingleEntry.cshtml
+++ b/Website/Pages/SingleEntry.cshtml
@@ -45,7 +45,7 @@
@Localizer["extendedmeaningof"]
@Model.Name.ExtendedMeaning
}
-
+
@if (Model.Name.Videos.Any())
{
@@ -134,7 +134,11 @@
@Localizer["variants"]
- @Model.Name.Variants
+
+ foreach (var variant in (List)Model.Name.Variants)
+ {
+ @variant
+ }
}
diff --git a/Website/Pages/SubmitName.cshtml.cs b/Website/Pages/SubmitName.cshtml.cs
index 35c0ba3..886918d 100644
--- a/Website/Pages/SubmitName.cshtml.cs
+++ b/Website/Pages/SubmitName.cshtml.cs
@@ -1,5 +1,5 @@
using Application.Services;
-using Core.Dto.Request;
+using Core.Dto.Response;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
using Website.Pages.Shared;
diff --git a/Website/Services/ApiService.cs b/Website/Services/ApiService.cs
index 43f0ec3..e924411 100644
--- a/Website/Services/ApiService.cs
+++ b/Website/Services/ApiService.cs
@@ -1,5 +1,4 @@
-using Core.Dto.Request;
-using Core.Dto.Response;
+using Core.Dto.Response;
using Microsoft.Extensions.Options;
using System.Text.Json;
using Website.Config;
diff --git a/YorubaNameDictionary.sln b/YorubaNameDictionary.sln
index a2cd3e4..6bbaa85 100644
--- a/YorubaNameDictionary.sln
+++ b/YorubaNameDictionary.sln
@@ -24,8 +24,11 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6626E809-1AC8-46E8-BBAF-1862FBC64D3D}"
ProjectSection(SolutionItems) = preProject
mongo-init.js = mongo-init.js
+ README.md = README.md
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "Infrastructure\Infrastructure.csproj", "{78930A71-3759-46B3-9429-80C4D4933D12}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -60,6 +63,10 @@ Global
{A69D2C16-E0AD-4911-8D4F-42369452BAB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A69D2C16-E0AD-4911-8D4F-42369452BAB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A69D2C16-E0AD-4911-8D4F-42369452BAB2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {78930A71-3759-46B3-9429-80C4D4933D12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {78930A71-3759-46B3-9429-80C4D4933D12}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {78930A71-3759-46B3-9429-80C4D4933D12}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {78930A71-3759-46B3-9429-80C4D4933D12}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/docker-compose.override.yml b/docker-compose.override.yml
index 6f9b93d..b594ccd 100644
--- a/docker-compose.override.yml
+++ b/docker-compose.override.yml
@@ -14,6 +14,10 @@ services:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://+:80
+ - Twitter__ConsumerKey=${YND_Twitter__ConsumerKey}
+ - Twitter__ConsumerSecret=${YND_Twitter__ConsumerSecret}
+ - Twitter__AccessToken=${YND_Twitter__AccessToken}
+ - Twitter__AccessTokenSecret=${YND_Twitter__AccessTokenSecret}
ports:
- "51515:80"
volumes: