Skip to content

The backend service that provides endpoints for my Pomodoro SPA.

License

Notifications You must be signed in to change notification settings

sangenshoku/pomodoroapi

Repository files navigation

Pomodo API

C# .Net Docker

It is a backend service that provides endpoints for my Pomodoro SPA.

Features

  • CRUD operations for tasks.
  • Cookie-based authentication.
  • Support for RESTful API design principles.
  • I'm planning to add more features in the future.

Technologies Used

  • ASP.NET 8
  • C#
  • Entity Framework Core
  • MariaDB
  • Docker
  • xUnit

Prerequisite

  • docker
  • .NET 8 SDK
  • dotnet-ef

Installation

Clone the project.

git clone <link>

Install Entity Framework Core.

dotnet tool install --global dotnet-ef

Install dependencies.

dotnet restore

Run the migrations.

dotnet ef database update --project ./PomodoroApi

Run the main project.

dotnet run --project ./PomodoroApi

Docker

The project uses environment and secret files in compose.yml. So you have to set them up.

First, create a secrets directory. Then, create the following files.

  • db_connection_string.txt - contains the database connection information.
  • db_password.txt - contains the password of the database.
# db_connection_string.txt
# this is the sample connection string for MariaDB.
Server=Your_Host;Database=Your_Database_Name;Uid=Your_User;Pwd=Your_Password
# db_password.txt
YourSuperSecretPassword

Lastly, create the .env file.

(Optional) If you're using Linux. You can simply run the command cp .env.example .env to create the file in your directory.

# .env
CONNECTION_STRING=
DB_PASSWORD=YourSuperSecretPassword

After that, you can use the following command to create and start containers.

docker compose up --build

Now, go to http://localhost:5174/swagger/index.html to test it out.

Testing

Use the command dotnet test to run all the tests.

About

The backend service that provides endpoints for my Pomodoro SPA.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published