Skip to content

Chevi-Koren/Tours-Project-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tours Project Server

Overview

Tours Project Server is a robust, multi-layered .NET 9 solution for managing flights, customers, orders, destinations, and related business logic for a travel or airline management system. The project is architected using a clean separation of concerns, leveraging a layered architecture with Data Access Layer (DAL), Business Logic Layer (BL), and a RESTful Web API (Server).


Architecture

1. Data Access Layer (DAL)

  • Purpose: Handles all direct interactions with the SQL Server database using Entity Framework Core.
  • Key Components:
    • Models: Represent database tables (e.g., Flight, Order, Class, Customer, ClassToFlight, etc.).
    • Services: Implement CRUD operations for each entity.
    • DalManager: Centralizes access to all DAL services.
    • dbcontext: Entity Framework context mapping all tables and relationships.

2. Business Logic Layer (BL)

  • Purpose: Implements business rules, validation, and data transformation between the DAL and the API.
  • Key Components:
    • Models: Business representations of entities (e.g., BlFlight, BlOrder, etc.).
    • Services: Contain business logic and orchestrate DAL operations.
    • BlManager: Centralizes access to all BL services.
    • Interfaces: Define contracts for business operations.

3. Server (Web API)

  • Purpose: Exposes the system's functionality via RESTful HTTP endpoints for client applications.
  • Key Components:
    • Controllers: Handle HTTP requests for each entity (e.g., FlightController, OrdersController, ClassToFlightController, etc.).
    • Program.cs: Configures the web server, dependency injection, CORS, and Swagger for API documentation.

Main Features

  • Flight Management: Create, update, delete, and retrieve flights and their details.
  • Order Management: Manage customer orders, including order details and associations with flights.
  • Customer Management: Register, update, and manage customer information.
  • Class & ClassToFlight Management: Handle flight classes (e.g., economy, business) and their assignment to specific flights.
  • Destination Management: Manage flight destinations and related data.
  • Advanced Queries: Retrieve flights by source, destination, date, and more.
  • Robust Error Handling: Consistent error responses and validation across all endpoints.
  • Swagger Integration: Interactive API documentation and testing.

Technologies

  • .NET 9
  • ASP.NET Core Web API
  • Entity Framework Core
  • SQL Server (LocalDB)
  • Dependency Injection
  • Swagger/OpenAPI

Project Structure

Tours-Project-Server/ ? ??? Dal/ # Data Access Layer (EF models, services, context) ??? BL/ # Business Logic Layer (business models, services, interfaces) ??? Server/ # Web API (controllers, Program.cs) ??? database/ # SQL Server .mdf file (LocalDB)

Getting Started

  1. Clone the repository
  2. Ensure .NET 9 SDK is installed
  3. Configure the database connection string
    • The default connection string is set for LocalDB in dbcontext.cs.
    • Update as needed for your environment.
  4. Build and run the solution
    • Use Visual Studio or dotnet build / dotnet run from the command line.
  5. Access the API
    • Swagger UI is available at https://localhost:<port>/swagger for interactive exploration.

API Endpoints

  • Flights: /api/Flight
  • Orders: /api/Orders
  • Customers: /api/Customers
  • ClassToFlight: /api/ClassToFlight
  • Class: /api/Class
  • Destinations: /api/Destinition
  • OrdersDetails: /api/OrdersDetails
  • ThisFlight: /api/ThisFlight

Each controller supports standard CRUD operations and advanced queries as appropriate.


Customization & Extension

  • Add new entities: Define models in DAL and BL, implement services, and expose via a new controller.
  • Business rules: Implement or update logic in BL services.
  • Database migrations: Use Entity Framework Core tools for schema updates.

Security & Best Practices

  • Connection Strings: Move sensitive data out of source code and into configuration files or environment variables.
  • Validation: All controllers validate input and return appropriate HTTP status codes.
  • CORS: Configured to allow all origins for development; restrict in production as needed.

License

This project is for educational and demonstration purposes.
For production use, review and update security, error handling, and deployment practices.


Authors

  • Developed by Yocheved Koren.

Contact

For questions or support, please send an email to the following address: chevi4564@gmail.com.

=======

Tours-Project-Server

08157ded3b171cfb7b47923106ad4f3d15f7e425

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages