ninya-io / ninya.io

Find StackOverflow users near you by tags and reputation
MIT License
60 stars 13 forks source link

Code cleanup #29

Closed cburgdorf closed 10 years ago

cburgdorf commented 10 years ago

The code base of the syncing code is quite a mess. It's still full of frontend related code (e.g. express) which has no business being there. Furthermore I would like to seperate a couple of things:

From the surface I would like A to look like this:

var syncService = new ninya.sync.stackExchange.SyncService({
    // syncing with a different StackExchange site would be as easy as changing the name here
    stackSite: 'stackoverflow',

    // this could be any user provided repository but we could
    // provide implementations for postgres + elasticsearch within the library
    workingUserRepository: new ninya.sync.stackExchange.PostgresUserRepository(...),
    backupUserRepository: new ninya.sync.stackExchange.PostgresUserRepository(...)

    // the maximum number of users to sync
    maxUserCount: 150000
});

syncService.run();

Dragging @kyjan and @PascalPrecht into this

cburgdorf commented 10 years ago

This is more or less finished. It's still coupled directly to postgres which means it's not using the repository pattern from the outside (although it's used internally to some extend) but it's a lower priority to change that. Closing here.