Luis Figueiredo 4eaa3167ee more пре 8 година
..
bin 52d2ec1d1c Improved build пре 8 година
pkg 4eaa3167ee more пре 8 година
src 4eaa3167ee more пре 8 година
.gitignore 52d2ec1d1c Improved build пре 8 година
.goproj 5e046887fb initial commit пре 8 година
README.md 5e046887fb initial commit пре 8 година

README.md

Simple-backend

Projet structure

Backend -

Core -

Services    
    usersvc,
    imagesvc,
    etcsvc
Browser       WebHandler       Services       DataStore
   |               |              |               |
   |-request------>|              |               |
   |               |              |               |
   |               |-call-------->|               |
   |               |              |               |
   |               |              |-query-------->|
   |               |              |               |
   |               |              |<---------data-|
   |               |              |               |
   |               |<------return-|               |               
   |               |              |               |
   |<-----response-|              |               |
   |               |              |               |
   |               |              |               |
Browser       WebHandler       Services       DataStore

(Browser), (WebHandler), (Services), (DataStore)

in MVC we have Model View Controller in same "project" despite this is some what organized it will tie some logic to project, in most projects this is also fine, but ends up later to some recoding in different projects repeat all over again.

Also in regular .NET web projects we have

Persistence:
	Proj.Data.Contacts   
		Model
	Proj.Data            
		ModelRepository
Logic:
	Proj.Business        
		ModelBO 
	Proj.Web
		Controllers
		Views

as Views are Processed and sent to browser,
Controllers receive request and go to ModelBO retrieving Contacts, it return a view which are processed and sent back to server

```	

The goal
Create independent contexts:

Persistence:

Pkg.DataStore - persistence

UserService:

Pkg.UserModel
Pkg.UserLogic (service entry point)

ImageService:

Pkg.ImageModel
Pkg.ImageLogic

```

The caller must be independent from browser, we can create different front ends such as CLI.

Service can require more than one Querier, we can create virtual DB with tables

Logic:

WebProject

ViewModel
Controllers
Views (cshtml)

DataStore data persistence Service performs logic, validation, authorization Communication receives

tests

With independent services we should have a maincore:

```go

Core will prepare the database, session etc

core.Session();

core.User().Login etc