Skip to content

💸 Price observatory to find the best bargains!

License

Notifications You must be signed in to change notification settings

jim113/ntua-softeng

 
 

Repository files navigation

cheapies.gr

Build Status PyPI - Django Version PyPI - Python Version APMLicense

💸 Price observatory to find the best bargains!

❓ Project Description

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.

🚹 Team

This project was curated by "mycoderocks" team comprising of (alphabetical order):

🔩 Setup/Usage

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

Step 1. Install Dependencies

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 

Step 2. Setup MySQL database

The web application uses MySQL as a database for holding data.

  1. Login into mysql from the command line and create the database
create database cheapies character set utf8;
  1. Create a database.cnf file containing the following information
[client]
database = cheapies
user = user
password = password
default-character-set = utf8
  1. Optional if you are in a testing environment (e.g. Travis CI) you can fake a database via make test_db.

  2. Make the needed migrations and compile messages with

make migrate

Step 3. Populate the database with data

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

Run the development webserver

Then you can run the webserver with

python3 manage.py runserver

Building a Docker Image

This project can be dockerized. The configuration is located at Dockerfile and docker-compose.yml

  1. Build the docker image using docker-compose
export DOCKER_HOST=127.0.0.1
  1. Run the image with
sudo docker-compose up

Or use the make dockerize from the provided Makefile

🔨 Technologies Used

  • 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

📰 Guidelines

Language

The application language is Greek.

Code Formatting

Creating a view

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 declare

    section.example {
        .a {
            /* CSS Formatting of a inside example */
        }
    }

    for view-specific CSS. Otherwise, you should put it inside main.css

➕ Contributing Workflow

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.

Project Structure

  • 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 to product.html).
  • 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.

About

💸 Price observatory to find the best bargains!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 53.7%
  • HTML 37.4%
  • JavaScript 4.2%
  • CSS 2.6%
  • Makefile 1.6%
  • Dockerfile 0.4%
  • Shell 0.1%