<commit_before># films
A simple MVC web server written in Go with restful interfaces providing CRUD operations on database tables.

The films web server is a very simple example of how the Go programming language can be used to build a website.  It has one table called "people" with three fields, a numeric ID, a text field "forename" and another "surname".  The server has web pages that perform the Create, Read, Update and Delete (CRUD) operations on the table.  It looks (and is) ridiculously simple, but this allows me to concentrate on the mechanics of handling web pages and data rather than the business logic that a real website would require.  If you are trying to figure out how to create a website or just do test-driven development in Go, looking at this project should give you a start.

The server is designed using the Model View Controller (MVC) pattern, which supports separation of concerns.  The major components of the web server are models, views and controllers.  Each of those components is only concerned with well-defined issues.  The models are repositories (sometimes called Data Access Objects or DAOs) that provide access to data in the database.  The models are not concerned with what will be done with the data or how it will be represented (rendered) when the user sees it.  The views are templates that produce HTML pages.  They are only concerned with rendering the data.  They make no decisions, they just render the data that they are given.  The controllers implement the business logic of the application.  They use the repositories to access the data and use the views to display it.  They are not concerned with where the data comes from or how it will be rendered.  They are only concerned with what the user is allowed to do with the data.  

I'm one of the organisers of the the Surrey Go User Group (https://groups.google.com/forum/#!forum/surrey-golang).  Having looked at this project, other members of the group are now writing their own web servers, borrowing ideas from this one as needed. 


Fetching and Building the Films Server
======================================

First, get the dependencies:

```
go get github.com/go-sql-driver/mysql
go get github.com/coopernurse/gorp
go get github.com/emicklei/go-restful
go get github.com/golang/mock/gomock
go get github.com/petergtz/pegomock/pegomock
```

Note: by default, go get does not update anything that you have already downloaded.  If you downloaded any of those packages a long time ago, you may wish to update them to the latest version using the -u flag, for example:

go get -u github.com/coopernurse/gorp

Next, clone the server source code and build it.  For example, in a UNIX or Linux command window:

```
cd $HOME
mkdir goprojects<commit_msg>fixed incorrect go get advice for GORP<commit_after># films
A simple MVC web server written in Go with restful interfaces providing CRUD operations on database tables.

The films web server is a very simple example of how the Go programming language can be used to build a website.  It has one table called "people" with three fields, a numeric ID, a text field "forename" and another "surname".  The server has web pages that perform the Create, Read, Update and Delete (CRUD) operations on the table.  It looks (and is) ridiculously simple, but this allows me to concentrate on the mechanics of handling web pages and data rather than the business logic that a real website would require.  If you are trying to figure out how to create a website or just do test-driven development in Go, looking at this project should give you a start.

The server is designed using the Model View Controller (MVC) pattern, which supports separation of concerns.  The major components of the web server are models, views and controllers.  Each of those components is only concerned with well-defined issues.  The models are repositories (sometimes called Data Access Objects or DAOs) that provide access to data in the database.  The models are not concerned with what will be done with the data or how it will be represented (rendered) when the user sees it.  The views are templates that produce HTML pages.  They are only concerned with rendering the data.  They make no decisions, they just render the data that they are given.  The controllers implement the business logic of the application.  They use the repositories to access the data and use the views to display it.  They are not concerned with where the data comes from or how it will be rendered.  They are only concerned with what the user is allowed to do with the data.  

I'm one of the organisers of the the Surrey Go User Group (https://groups.google.com/forum/#!forum/surrey-golang).  Having looked at this project, other members of the group are now writing their own web servers, borrowing ideas from this one as needed. 


Fetching and Building the Films Server
======================================

First, get the dependencies:

```
go get github.com/go-sql-driver/mysql
go get gopkg.in/gorp.v1
go get github.com/emicklei/go-restful
go get github.com/golang/mock/gomock
go get github.com/petergtz/pegomock/pegomock
```

Note: by default, go get does not update anything that you have already downloaded.  If you downloaded any of those packages a long time ago, you may wish to update them to the latest version using the -u flag, for example:

go get -u github.com/coopernurse/gorp

Next, clone the server source code and build it.  For example, in a UNIX or Linux command window:

```
cd $HOME
mkdir goprojects
{'fraction_non_alphanumeric': 0.05493314058547163, 'fraction_numerical': 0.00018070112034694616, 'mean_word_length': 4.236518448438979, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3969514', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1324, 'n_words': 871}