GetFit is an online shop where you can buy fitness products like apparels, accessories and supplements - all by ordering from your home. It is the result of an educational effort to learn and implement different aspects of web engineering. The main goal in this project was to implement 3-tier architecture rather than focusing on features.
Being a project of the web engineering course project, our main goal was to focus on building the platform following the 3-tier architecture. So we didn't implement many features. Rather our application has a true 3-tier design. Here's an overview of the 3-tier architecture.
Presentation Layer <> Logic Layer <> Data Access Layer <> Database
So the philosophy is that the presentation layer only knows about the logic layer and has no idea about the database. The logic layer accepts requests from the user. It then decides what information is needed to serve the user. Based on that, it queries all the data from the data access layer. The data access layer communicates directly with the database. So the user never knows where the database is. The logic layer can be in one server, data access layer in another, database in another.
The web application is built using the python django framework. However the django framework by default is only an MVC framework. Our main goal was to implement 3-tier architecture. So we had come up with some creative ideas.
We created two django projects. One for the logic layer, another for the data access layer. The logic layer receives requests. It has no models. All the models reside in the data access layer. The database is created accordingly. The two servers are configured in apache. We have two sites enabled at two different ports. The two ports serve the two applications.
The logic layer makes http request to the data access layer via the post method. Data access layer extracts the query and then retrieves data from database, converts the data into an xml file and sends the data back to the logic layer via http response. The logic layer parses the data and generates page for the user.
Since the layers communicate using the http request and response and the data is transferred in xml format, the two servers are actually language and platform independent. We can implement the data access layer in another language if we want. The server just needs to accept http request and send back http response according to the query. The platform doesn't matter here.
- 3 Tier architecture
- Language independent layers
- Data transfer in xml format
- Password stored by hashing
- Email verification enabled
It is by no means a complete project. There are lots of bugs and the project is incomplete in many different ways. However the main purpose of implementing a 3-tier architecture was carried out properly.