How amirulhakiim/platformwelldatasync works
The PlatformWellDataSync project is a .NET Core Web API application that serves as an interface for platform, well, and synchronization operations. It integrates with a SQL Server database and is set up to run within Docker containers using Docker Compose. This setup implies a full-stack application architecture where the backend (API) is containerized along with the database.
Major Components
• Web API Container: This container (built using the provided Dockerfile) hosts the .NET Core Web API. Inside this container, the application logic is organized with controllers (in the Controllers directory), data access (in the Data directory using Entity Framework’s AppDbContext), and data models (in the Models directory) that reflect the underlying SQL database tables.
• Database (SQL Server) Container: Managed via Docker Compose (docker-compose.yml), it runs the SQL Server instance. This component is critical for storing platform and well data and handling migrations, as seen in the Migrations folder.
• External Clients: Any HTTP client (or swagger UI at the /swagger endpoint) that communicates with the Web API.
Understand the Data Flow
• Within the API container, the Controllers handle these requests. For instance, the PlatformWellController and SyncsController define the endpoints.
• The controllers rely on the AppDbContext (Entity Framework) for data access. AppDbContext interacts with the SQL Server database.
• The flow includes pulling and persisting data based on defined models (Platform, Well, SyncRequest, PlatformWell).
Architectural Patterns & Design Principles
• Use of MVC-like patterns where Controllers separate API logic from the business/data logic.
• The Data Access pattern via Entity Framework (EF Core) abstracts the database operations.
• Containerization with Docker ensuring consistency of the runtime environment across different stages (development, testing, and production).
• Migrations are handled through Entity Framework, reflecting evolving database schemas.
Key Technologies
• .NET Core (C#) for the API server.
• Entity Framework Core for ORM and database migrations.
• SQL Server for persistent storage.
• Docker & Docker Compose for container orchestration.