๐ธ Price observatory to find the best bargains!
This project aims to provide a web-based "price observatory", which will allow the users to post product prices from different stores. Volunteers will record the prices of various items and share them via the application.
Beyond the basic capabilities of product, store, time and space registration footprint and price as well as the facilities for their search, monitoring and opposition data (tables, charts, charts, etc.), special emphasis should be put on the possibility the interconnection of third-party applications with the observatory through appropriate web-based APIs.
This repository hosts the Software Engineering assignment for NTUA Course "Software Engineering" (Fall 2018).
๐ The application is developed using the Django Web Framework in Python 3.5.
This project was curated by "mycoderocks" team comprising of (alphabetical order):
- Dimitris Christou (AM: 03115058, iochrist1997@gmail.com)
- Ioannis Daras (AM: 03115018, daras.giannhs@gmail.com)
- Dimitris Kelesis (AM: 03115037, xd4ever7@gmail.com)
- Marios Papachristou (AM: 03115101, papachristoumarios@gmail.com)
- Ioannis Siachos (AM: 03115109, el15109@central.ntua.gr)
- Konstantinos Stavropoulos (AM: 03115046, stako2009@hotmail.com)
The project comes with a Makefile for as a build automation tool for automating various tasks in the repository. Below there are some steps you need to get started using the project
An overview of available options can be obtained via
make help
You will need to install the dependencies required in order to have a functional project. This part comprises of both system-level dependencies (MySQL and GDAL) as well as Python dependencies. Install them via
make deps
The web application uses MySQL as a database for holding data.
- Login into mysql from the command line and create the database
create database cheapies character set utf8;
- Create a
database.cnf
file containing the following information
[client]
database = cheapies
user = user
password = password
default-character-set = utf8
-
Optional if you are in a testing environment (e.g. Travis CI) you can fake a database via
make test_db
. -
Make the needed migrations and compile messages with
make migrate
There is a Makefile inside the root directory designated to fill in the database with data using crawled data from the Internet as well as the OSM Nominatim API. You can use it with:
make data
Clean uneeded data
make clean
Then you can run the webserver with
python3 manage.py runserver
This project can be dockerized. The configuration is located at Dockerfile
and docker-compose.yml
- Build the docker image using
docker-compose
export DOCKER_HOST=127.0.0.1
- Run the image with
sudo docker-compose up
Or use the make dockerize
from the provided Makefile
-
Back-end
- Python v3.5
- Django v2.1
- MySQL v14.14
- Django REST Framework
- Google Maps Geocoding API
-
Front-end
- Bootstrap v4.1.3
- Tachyons v4.1
- wow.js
- Mapbox v0.5
- jQuery
- slick.js
-
Deployment
- Gunicorn
- nginx
- Docker
-
Continuous Integration & Unit Testing
- Travis CI
- Selenium (Browser-based testing)
- Locust.io (RESTful API Testing)
-
Build Automation
- GNU Make
The application language is Greek.
- Back-end: PEP8 and Django Coding Style
- Front-end: Bootstrap CSS Coding Standards
When creating a view, let's say example
you should notice the following things:
-
The view name matches the template name, so you should create
example.html
-
If you use any static JS code, place it into
<app_name>/static/js/example.js
file. -
The main styling should go into
<app_name>/static/main.css
. Inside the HTML file you should declare{% extends layout.html %} {% block content %} <section id="example"> <div class="a"> <!-- SOME CODE HERE --> </div> <!-- CODE HERE --> </section> {% endblock %}
and inside
main.css
you should declaresection.example { .a { /* CSS Formatting of a inside example */ } }
for view-specific CSS. Otherwise, you should put it inside
main.css
We are using the Git Branch Workflow. In the future we will migrate to fork & pull-request workflow. The project status is kept inside GitHub Projects following the Kanban System
The project tasks are tracked with GitHub projects following the Kanban Scheduling Methodology.
docs/
Project-level documentation needs to be stored here and be written in Markdown. Module-specific documentation may be located only in source files.etc/
Extra files that accompany the project, such as configuration of external tools etc.<app_name>/
Django applications that reside inside the project<app_name>/urls.py
Application-level urls<app_name>/views.py
Application-level views<app_name>/models.py
Application-level models<app_name>/templates/<template.html>
HTML Templates<app_name>/static/{css, js}/{file.css, file.js}
CSS and JavaScript Static files- CSS Static files contain a
main.css
that contains the basic CSS for the web application - JS Static files are organized per view (e.g.
product.js
refers toproduct.html
).
- CSS Static files contain a
project/
urls.py
Top-level routing instructions.
manage.py
Django command-line tool._version.py
Contains a__version__
variable to indicate the current version of the website. Semantic versioning is used.setup.py
Setup script.requirements.txt
Pinned production dependencies.