ADIN API is an ASP.NET Core 5.0 Web API for managing maintenance tasks and the resources required for each task. It supports user authentication, structured logging, and Docker-based setup for local development.
- Entity Framework Core with PostgreSQL (or SQL Server) support
- Repository + Unit-of-Work pattern
- AutoMapper DTO↔model mapping
- Serilog logging
- JWT authentication & role-based authorization (User, Administrator)
- Swagger UI for interactive documentation
- Static file hosting for uploaded images (
/files)
- .NET 5 SDK
- Docker & Docker Compose (optional)
- PostgreSQL or SQL Server instance
git clone https://github.com/etfrobotics/adin_api
cd adin_apiEdit adin_api/appsettings.json with connection strings. Example for PostgreSQL:
"ConnectionStrings": {
"postgreSQLstring": "Host=localhost;Port=5432;Database=adin_db_postgres;Username=admin;Password=AdinApp2022!"
}Switch to UseSqlServer in Startup.cs to use sqlConnection.
dotnet restore
dotnet build
dotnet ef database update
dotnet run --project adin_apidocker-compose up --buildAPI available at http://localhost:8001.
Create a folder named files on your PC. Place any static assets inside and ensure the API is configured to serve this folder (see documentation). The contents will then be available from the API at /files.
A default administrator is seeded:
| Password | |
|---|---|
| knezevic@etf.rs | AdinApp2022! |
POST /api/Loginto obtain JWT.- Include the token as
Authorization: Bearer <token>. POST /api/Registeris restricted to administrators.
POST /api/Login– Authenticate userPOST /api/Register– Register user (admin only)GET /api/Tasks– List tasksGET /api/Tasks/{id}– Task details with steps & resourcesPOST /api/Tasks,PUT /api/Tasks/{id},DELETE /api/Tasks/{id}– Task managementGET /api/Components,GET /api/Tools,GET /api/SafetyTools,GET /api/Steps– Resource endpointsPOST /api/Images– Upload image (served from/files)
Explore the full API via Swagger UI.
adin_api/
├─ Controllers/ # API controllers
├─ DTOs/ # Data transfer objects
├─ Data/
│ ├─ Models/ # Entity models
│ ├─ Repository/ # Repositories & unit of work
│ └─ Configuration/ # EF Core configuration & seed data
├─ Services/ # Authentication services
├─ Program.cs
├─ Startup.cs
├─ Dockerfile
└─ docker-compose.yml
No license has been specified for this repository.