Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
222 changes: 221 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,221 @@
# ForSolutionAudit
# ForAdventure AssetTag API

A comprehensive .NET 8 Web API for outdoor adventure tracking and safety management. The AssetTag system enables adventurers to create digital asset tags that contain emergency contacts, trip plans, and location data for enhanced safety during outdoor activities.

## 🎯 Overview

ForAdventure AssetTag API is designed to support outdoor enthusiasts by providing a digital safety net through asset tags that contain crucial information for emergency situations. Each asset tag serves as a digital identifier linked to emergency contacts, detailed trip plans, and location coordinates.

### Key Features

- **Digital Asset Tag Creation**: Generate unique asset tags with QR codes for outdoor gear
- **Emergency Contact Management**: Store and manage emergency contact information
- **Trip Planning Integration**: Detailed trip plans with GPS coordinates and route information
- **Location Services**: Multiple GPS format support including What3Words integration
- **RESTful API**: OpenAPI/Swagger documented endpoints
- **In-Memory Storage**: Fast, lightweight data storage for development and testing

## πŸ—οΈ Architecture Overview

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ HTTP Client │───▢│ AssetTag API │───▢│ Data Storage β”‚
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ - Web Browser β”‚ β”‚ - Controllers β”‚ β”‚ - IAssetTagStoreβ”‚
β”‚ - Mobile App β”‚ β”‚ - Services β”‚ β”‚ - In-Memory β”‚
β”‚ - QR Scanner β”‚ β”‚ - Models β”‚ β”‚ - (Future: DB) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### Core Components

- **Models**: AssetTag, EmergencyContact, TripPlan, LocationCoordinates
- **Controllers**: AssetTagController for HTTP endpoint handling
- **Services**: AdventureAPIService for external integrations, ForAdventureLogic for business logic
- **Storage**: IAssetTagStore interface with in-memory implementation
- **API Endpoints**: Both controller-based and minimal API endpoints

## πŸš€ Quick Start

### Prerequisites

- [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0)
- Visual Studio 2022 or Visual Studio Code
- Git

### Installation

1. **Clone the repository**
```bash
git clone https://github.com/tcalice/AdventureTags.git
cd AdventureTags
```

2. **Build the solution**
```bash
cd AssetTag.API/WebApplication1
dotnet restore
dotnet build
```

3. **Run the application**
```bash
dotnet run
```

4. **Access the API**
- API Base URL: `https://localhost:7034` (or `http://localhost:5034`)
- Swagger UI: `https://localhost:7034/swagger`
- API Documentation: `https://localhost:7034/swagger/v1/swagger.json`

### Running Tests

```bash
cd AssetTag.API.test/AdventureTagTests
dotnet test
```

## πŸ“ API Usage Examples

### Create an Asset Tag

```http
POST /api/AssetTag/MakeAssetTag
Content-Type: application/json

{
"tagCode": "ADV-2024-001",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"emergencyContacts": [
{
"name": "John Doe",
"phone": "+1-555-0123",
"email": "john.doe@example.com"
}
],
"tripPlans": [
{
"tripRoute": "Mount Rainier Summit Trail",
"tripStartDate": "2024-07-15T08:00:00Z",
"tripEndDate": "2024-07-17T18:00:00Z",
"tripDurationDays": 3
}
]
}
```

### Response

```json
{
"message": "Retrieve your Asset Sticker with this Unique Asset Tag ID",
"assetTagId": "987fcdeb-51a2-43d1-b5c6-789012345678"
}
```

## πŸ“Š Project Structure

```
AdventureTags/
β”œβ”€β”€ AssetTag.API/
β”‚ └── WebApplication1/ # Main API project
β”‚ β”œβ”€β”€ Controllers/ # HTTP controllers
β”‚ β”œβ”€β”€ Models/ # Data models and interfaces
β”‚ β”œβ”€β”€ Services/ # Business logic and external services
β”‚ β”œβ”€β”€ Properties/ # Launch settings
β”‚ └── Program.cs # Application entry point
β”œβ”€β”€ AssetTag.API.test/
β”‚ └── AdventureTagTests/ # Unit tests
β”œβ”€β”€ docs/ # Documentation
└── README.md # This file
```

## πŸ”§ Configuration

### Development Settings

The application uses standard .NET configuration patterns:

- `appsettings.json`: Production settings
- `appsettings.Development.json`: Development overrides
- Environment variables: Override any configuration

### Dependency Injection

The application uses .NET's built-in DI container with the following services:

```csharp
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSingleton<IAssetTagStore, AssetTagStore>();
```

## πŸ§ͺ Testing

The project includes comprehensive unit tests using:

- **xUnit**: Testing framework
- **Moq**: Mocking framework
- **Microsoft.NET.Test.SDK**: Test runner

See [Testing Guide](docs/testing.md) for detailed testing strategies and coverage information.

## πŸš€ Deployment

For production deployment options:

- **Azure App Service**: Recommended for cloud deployment
- **Docker**: Container-based deployment
- **IIS**: On-premises Windows deployment

See [Deployment Guide](docs/deployment.md) for detailed deployment instructions.

## πŸ“– Documentation

- [Architecture Documentation](docs/architecture.md) - System design and request flow
- [API Documentation](docs/api.md) - Comprehensive API reference
- [Testing Guide](docs/testing.md) - Testing strategies and coverage
- [Deployment Guide](docs/deployment.md) - Azure deployment and CI/CD
- [Database Design](docs/database.md) - Data storage architecture
- [Development Workflow](docs/development.md) - Contributing guidelines

## 🀝 Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## πŸ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## πŸ†˜ Support

For questions and support:

- Create an [Issue](https://github.com/tcalice/AdventureTags/issues)
- Review the [Documentation](docs/)
- Check the [API Reference](docs/api.md)

## πŸ—ΊοΈ Roadmap

### Current Version (v1.0)
- βœ… Basic asset tag creation
- βœ… Emergency contact management
- βœ… In-memory data storage
- βœ… OpenAPI documentation

### Future Enhancements
- πŸ”„ Azure SQL Database integration
- πŸ”„ Real-time GPS tracking
- πŸ”„ QR code generation
- πŸ”„ Mobile app integration
- πŸ”„ Emergency alert system
- πŸ”„ Advanced trip analytics

---

Built with ❀️ for the outdoor adventure community
Loading