Skip to main content

Installation & Setup

Complete guide for installing and configuring the FishingLog Backend API.

Prerequisites

  • .NET SDK 9.0 or later
  • Docker Desktop (recommended)
  • PostgreSQL 16 (if not using Docker)
  • Git

Step 1: Clone the Repository

git clone <repository-url>
cd FishingLog.Backend

Step 2: Verify .NET SDK Installation

dotnet --version
# Should be 9.0.x or later

If not installed, download from: https://dotnet.microsoft.com/download

Step 3: Set Up HTTPS Certificate

For local development with HTTPS:

# Trust the development certificate
dotnet dev-certs https --trust

# Create certificate for Docker
mkdir -p ~/.aspnet/https
dotnet dev-certs https -ep ~/.aspnet/https/aspnetapp.pfx -p password123

Step 4: Configure Environment

The application uses appsettings.json for configuration. Key settings:

  • Connection String: PostgreSQL database connection
  • Cognito Settings: User Pool ID and Client ID (configured in Program.cs)

Default connection string (Development):

Host=localhost;Port=5432;Database=fishinglog_db;Username=fishinglog_user;Password=supersecurepassword

Step 5: Start PostgreSQL Database

# Start only the database
docker-compose up -d db

Option B: Using Local PostgreSQL

Ensure PostgreSQL is running and create the database:

CREATE DATABASE fishinglog_db;
CREATE USER fishinglog_user WITH PASSWORD 'supersecurepassword';
GRANT ALL PRIVILEGES ON DATABASE fishinglog_db TO fishinglog_user;

Step 6: Run Database Migrations

# Apply migrations to create database schema
dotnet ef database update --project FishingLog.Infrastructure --startup-project FishingLog.API

Step 7: Verify Installation

# Build the solution
dotnet build

# Run the API
dotnet run --project FishingLog.API/FishingLog.API.csproj

The API should be available at:

  • HTTPS: https://localhost:5100
  • HTTP: http://localhost:5101
  • Swagger UI: https://localhost:5100/swagger

Next Steps