Skip to main content

Overview

This guide walks you through setting up AndanDo for local development, from cloning the repository to running the application on your machine.
Before proceeding, ensure you’ve met all System Requirements.

Quick Start

1

Clone the Repository

Navigate to your workspace directory and clone the source code:
cd ~/workspace/source
git clone <repository-url> AndanDo
cd AndanDo/AndanDo
2

Configure Settings

Update connection strings and API keys in configuration files (detailed below).
3

Restore Dependencies

dotnet restore
4

Build the Project

dotnet build
5

Run the Application

dotnet run
Access the app at:
  • HTTPS: https://localhost:7129
  • HTTP: http://localhost:5004

Configuration Files

AndanDo uses two primary configuration files for environment-specific settings:

appsettings.json

Base configuration for all environments

appsettings.Development.json

Development-specific overrides with detailed logging

Connection String Configuration

Never commit real credentials to version control! Use environment variables or user secrets for sensitive data.
Edit both appsettings.json and appsettings.Development.json:
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=YOUR_SERVER;Database=AndandoDB;User Id=YOUR_USER;Password=YOUR_PASSWORD;TrustServerCertificate=true;"
  }
}
"DefaultConnection": "Server=localhost;Database=AndandoDB;Integrated Security=true;TrustServerCertificate=true;"
Uses Windows Authentication (no username/password needed).

JWT Configuration

Configure JSON Web Token settings for authentication:
{
  "Jwt": {
    "Issuer": "AndanDo",
    "Audience": "AndanDo",
    "SecretKey": "your-secure-secret-key-at-least-32-characters-long",
    "ExpirationMinutes": 120
  }
}
Important JWT Settings:
  • SecretKey: Must be at least 32 characters for HS256 algorithm
  • ExpirationMinutes: Session duration (120 = 2 hours)
  • Change the default SecretKey before deployment!

SMTP Email Configuration

Configure email service for notifications and password resets:
{
  "Smtp": {
    "Host": "smtp.gmail.com",
    "Port": 587,
    "UseSsl": false,
    "UseStartTls": true,
    "User": "[email protected]",
    "Password": "your-app-specific-password",
    "FromEmail": "[email protected]",
    "FromName": "AndanDo"
  }
}
For Gmail, generate an App Password:
  1. Enable 2-factor authentication on your Google account
  2. Visit myaccount.google.com/apppasswords
  3. Generate a new app password for “Mail”
  4. Use the 16-character password in your configuration

PayPal Configuration

Set up PayPal integration for payment processing:
{
  "PayPal": {
    "Mode": "sandbox",
    "ClientId": "YOUR_SANDBOX_CLIENT_ID",
    "ClientSecret": "YOUR_SANDBOX_SECRET",
    "BaseUrl": "https://api-m.sandbox.paypal.com"
  }
}
Get sandbox credentials from PayPal Developer Dashboard.

Database Setup

1

Create Database

Connect to your SQL Server instance and create the database:
CREATE DATABASE AndandoDB;
GO
USE AndandoDB;
GO
2

Run Database Scripts

Execute the database schema scripts to create tables and stored procedures:
Database schema scripts should be located in a /Database or /Scripts folder in the repository. Run them in order:
  1. Table creation scripts
  2. Stored procedure scripts
  3. Initial data/seed scripts
If using SQL Server Management Studio (SSMS):
  • Open the script files
  • Ensure you’re connected to the AndandoDB database
  • Execute each script (F5)
3

Verify Database Objects

Confirm all required objects exist:
-- List all tables
SELECT TABLE_NAME 
FROM INFORMATION_SCHEMA.TABLES 
WHERE TABLE_TYPE = 'BASE TABLE';

-- List all stored procedures
SELECT ROUTINE_NAME 
FROM INFORMATION_SCHEMA.ROUTINES 
WHERE ROUTINE_TYPE = 'PROCEDURE';

Expected Database Tables

The database should include tables for:
  • Users & Auth: User accounts, authentication, password resets
  • Tours: Tour listings, itineraries, inclusions/exclusions, FAQs
  • Tickets: Ticket types, pricing, age categories, sales windows
  • Reservations: TourReservation, TourReservationTicket for booking data
  • Reviews & Likes: User reviews, ratings, and post likes
  • Media: Tour images and uploads metadata

Directory Structure

Ensure the following directory structure exists:
AndanDo/
├── Components/
│   ├── Pages/               # Blazor pages (Home, Marketplace, TourDetails, etc.)
│   └── Shared/              # Shared components (NavMenu, SearchBar, etc.)
├── Services/
│   ├── Auth/                # Authentication service
│   ├── JWT/                 # JWT token service
│   ├── Email/               # Email service
│   ├── Tour/                # Tour management service
│   ├── Utility/             # Utility services (likes, reviews, conversion)
│   └── Paypal/              # PayPal integration
├── Dtos/                    # Data transfer objects
├── wwwroot/
│   ├── uploads/             # User-uploaded tour images (create if missing)
│   ├── template/            # Invoice templates
│   ├── css/                 # Stylesheets
│   └── js/                  # JavaScript files
├── Properties/
│   └── launchSettings.json  # Launch profiles
├── appsettings.json         # Base configuration
├── appsettings.Development.json  # Dev configuration
└── Program.cs               # Application entry point
Create the uploads directory manually:
mkdir -p wwwroot/uploads
This directory stores user-uploaded tour images and must have write permissions.

Build and Run

Using .NET CLI

1

Navigate to Project Directory

cd ~/workspace/source/AndanDo/AndanDo
2

Restore NuGet Packages

dotnet restore
This downloads all dependencies:
  • MailKit v4.14.1
  • Microsoft.Data.SqlClient v6.1.3
  • System.IdentityModel.Tokens.Jwt v8.14.0
  • System.Drawing.Common v8.0.7
3

Build the Project

dotnet build
Build errors? Check that:
  • .NET 10.0 SDK is installed (or change to net8.0 in .csproj)
  • All configuration files are properly formatted
4

Run the Application

dotnet run
Runs with HTTPS profile, accessible at:
  • https://localhost:7129
  • http://localhost:5004

Using Visual Studio 2022

  1. Open AndanDo.sln in Visual Studio
  2. Ensure AndanDo project is set as startup project
  3. Select launch profile: https or http
  4. Press F5 (debug) or Ctrl+F5 (run without debugging)
  5. Browser opens automatically to https://localhost:7129

Using Visual Studio Code

  1. Open the AndanDo folder in VS Code
  2. Install recommended extensions (C# Dev Kit)
  3. Press F5 or use Run > Start Debugging
  4. Select ”.NET Core Launch (web)” configuration
  5. Navigate to https://localhost:7129 in your browser

Verifying the Setup

1

Check Console Output

When the application starts, you should see:
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:7129
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5004
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
2

Access the Homepage

Open a browser and navigate to https://localhost:7129You should see:
  • AndanDo logo and navigation menu
  • Tour marketplace with cards
  • Search bar with autocomplete
  • Recent tours slider
3

Test Database Connection

Try registering a new user or browsing tours. If you see data, the database connection is working correctly.
If you see database errors, verify:
  • SQL Server is running
  • Connection string is correct
  • Database exists with proper schema
  • User has necessary permissions
4

Check SignalR WebSocket

Open browser DevTools (F12) > Network tabLook for a successful WebSocket connection to /_blazor?id=...
Green “101 Switching Protocols” status means SignalR is connected properly.

Common Setup Issues

Error: Unable to bind to https://localhost:7129Solution: Change ports in Properties/launchSettings.json:
"applicationUrl": "https://localhost:7130;http://localhost:5005"
Error: Cannot open database "AndandoDB" requested by the loginSolutions:
  1. Verify SQL Server is running: services.msc (Windows) or systemctl status mssql-server (Linux)
  2. Check database exists: Connect with SSMS or Azure Data Studio
  3. Test connection string with sqlcmd or database tool
  4. Verify user permissions on the database
Error: The SSL connection could not be establishedSolution: Trust the development certificate:
dotnet dev-certs https --trust
On Linux, you may need to manually trust the certificate in your browser.
Error: Unable to find package 'MailKit'Solutions:
  1. Clear NuGet cache:
    dotnet nuget locals all --clear
    
  2. Restore with verbose logging:
    dotnet restore --verbosity detailed
    
  3. Check NuGet sources:
    dotnet nuget list source
    
Error: Access denied when saving file to wwwroot/uploadsSolution: Ensure the directory exists and has write permissions:
# Create directory
mkdir -p wwwroot/uploads

# Set permissions (Linux/macOS)
chmod 755 wwwroot/uploads

Development Workflow

Hot Reload

Use dotnet watch run for automatic recompilation on file changes

Database Changes

Execute SQL scripts directly in SSMS or run migrations as needed

Testing Features

Use PayPal sandbox, test email addresses, and dummy data

Debugging

Attach debugger in Visual Studio or VS Code, set breakpoints in C# code

Useful Development Commands

# Clean build artifacts
dotnet clean

# Rebuild from scratch
dotnet clean && dotnet build

# Run with specific environment
dotnet run --environment Development

# Publish for local testing
dotnet publish -c Debug

# List all project dependencies
dotnet list package

Next Steps

Production Deployment

Learn how to deploy AndanDo to production environments with IIS, Azure, or Docker

Build docs developers (and LLMs) love