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
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
Edit bothappsettings.json and appsettings.Development.json:
- Local SQL Server
- SQL Server Express
- Remote SQL Server
- Azure SQL Database
JWT Configuration
Configure JSON Web Token settings for authentication:Important JWT Settings:
SecretKey: Must be at least 32 characters for HS256 algorithmExpirationMinutes: Session duration (120 = 2 hours)- Change the default
SecretKeybefore deployment!
SMTP Email Configuration
Configure email service for notifications and password resets:PayPal Configuration
Set up PayPal integration for payment processing:- Sandbox (Development)
- Live (Production)
Database Setup
Run Database Scripts
Execute the database schema scripts to create tables and stored procedures:If using SQL Server Management Studio (SSMS):
Database schema scripts should be located in a
/Database or /Scripts folder in the repository. Run them in order:- Table creation scripts
- Stored procedure scripts
- Initial data/seed scripts
- Open the script files
- Ensure you’re connected to the
AndandoDBdatabase - Execute each script (F5)
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,TourReservationTicketfor booking data - Reviews & Likes: User reviews, ratings, and post likes
- Media: Tour images and uploads metadata
Directory Structure
Ensure the following directory structure exists:Build and Run
Using .NET CLI
Restore NuGet Packages
- MailKit v4.14.1
- Microsoft.Data.SqlClient v6.1.3
- System.IdentityModel.Tokens.Jwt v8.14.0
- System.Drawing.Common v8.0.7
Build the Project
Build errors? Check that:
- .NET 10.0 SDK is installed (or change to
net8.0in .csproj) - All configuration files are properly formatted
Using Visual Studio 2022
- Open
AndanDo.slnin Visual Studio - Ensure
AndanDoproject is set as startup project - Select launch profile: https or http
- Press F5 (debug) or Ctrl+F5 (run without debugging)
- Browser opens automatically to
https://localhost:7129
Using Visual Studio Code
- Open the
AndanDofolder in VS Code - Install recommended extensions (C# Dev Kit)
- Press F5 or use Run > Start Debugging
- Select ”.NET Core Launch (web)” configuration
- Navigate to
https://localhost:7129in your browser
Verifying the Setup
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
Test Database Connection
Try registering a new user or browsing tours. If you see data, the database connection is working correctly.
Common Setup Issues
Port Already in Use
Port Already in Use
Error:
Unable to bind to https://localhost:7129Solution: Change ports in Properties/launchSettings.json:SQL Server Connection Failed
SQL Server Connection Failed
Error:
Cannot open database "AndandoDB" requested by the loginSolutions:- Verify SQL Server is running:
services.msc(Windows) orsystemctl status mssql-server(Linux) - Check database exists: Connect with SSMS or Azure Data Studio
- Test connection string with
sqlcmdor database tool - Verify user permissions on the database
Certificate Trust Issues (HTTPS)
Certificate Trust Issues (HTTPS)
Error: On Linux, you may need to manually trust the certificate in your browser.
The SSL connection could not be establishedSolution: Trust the development certificate:NuGet Package Restore Failed
NuGet Package Restore Failed
Error:
Unable to find package 'MailKit'Solutions:- Clear NuGet cache:
- Restore with verbose logging:
- Check NuGet sources:
Upload Directory Permissions
Upload Directory Permissions
Error:
Access denied when saving file to wwwroot/uploadsSolution: Ensure the directory exists and has write permissions:Development Workflow
Hot Reload
Use
dotnet watch run for automatic recompilation on file changesDatabase 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
Next Steps
Production Deployment
Learn how to deploy AndanDo to production environments with IIS, Azure, or Docker