- Every 1 minute service connects to sftp and checks if there are new or modified files.
- Service downloads and syncs all the new files to local path.
- If remote file modified, same local file also gets updated.
- All file and directory info is stored in Datatabse (postgresql).
- EF core code first migration used.
- Project developed using Service oriented architecture (Repository pattern, Unit of work).
- Solution is divided with foud sub projects, such as Web, Core, Domain & Infrasruction.
- For background job , Hangfire is used
- For Logging, Serilog is used.
- SSH server is configurable from AppSettings.json
For database context and migration , refer to project MediaFon.FileManager.Infrastructure.
cd MediaFon.FileManager.Infrastructure
dotnet ef database update
Change SFTP Server configuration from appsetting.json
{
"SSH_Settings": {
"SFTP_SERVER": "192.168.0.109",
"SFTP_USER": "root",
"SFTP_PASS": "Password",
"SFTP_PORT": 22,
"UserDefinedRemoteWorkingDirectory": "/C:/SFTP", // Starting forward slash before 'C:/' is required
"BackgroundJobInterval": 1,
"LocalFileStoreLocation": "LocalFileStorage" // Folder should be within the Web Application directory
}
}
MediaFon.FileManager.Web is the start up project to run the application.