Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incomplete chart.js #6

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9808aaa
Create more_info.html
Aemitrius Sep 17, 2020
350d731
Add files via upload
Aemitrius Sep 21, 2020
410e400
Add files via upload
Aemitrius Sep 21, 2020
bcb79e5
Update base.html
Aemitrius Sep 21, 2020
fa3f65e
Create item
Aemitrius Sep 24, 2020
04f6aa2
Delete item
Aemitrius Sep 24, 2020
838f9a9
Add files via upload
Aemitrius Sep 24, 2020
8df1ed8
Add files via upload
Aemitrius Sep 24, 2020
d27c347
Add files via upload
Aemitrius Sep 24, 2020
d4b3eed
Add files via upload
Aemitrius Sep 24, 2020
0fdf067
Add files via upload
Aemitrius Sep 25, 2020
6b4bbbc
Add files via upload
Aemitrius Sep 25, 2020
fda7b74
Add files via upload
Aemitrius Sep 25, 2020
ef65a08
Add files via upload
Aemitrius Sep 25, 2020
0dca4ec
Add files via upload
Aemitrius Sep 26, 2020
b7a1f6d
Add files via upload
Aemitrius Sep 27, 2020
80cd9e0
Update README.md
Aemitrius Sep 28, 2020
29e83d8
Update chart.html
Aemitrius Sep 28, 2020
602671f
Update README.md
Aemitrius Sep 28, 2020
1b1d1be
Update README.md
Aemitrius Sep 28, 2020
cfdc6cb
Add files via upload
Aemitrius Sep 29, 2020
799fb73
Add files via upload
Aemitrius Sep 29, 2020
a323738
Add files via upload
Aemitrius Sep 29, 2020
5fd87ff
Add files via upload
Aemitrius Sep 29, 2020
297002a
Update settings.py
Aemitrius Sep 29, 2020
435df7e
Update urls.py
Aemitrius Sep 29, 2020
0e6638a
Add files via upload
Aemitrius Sep 30, 2020
80af9d6
Add files via upload
Aemitrius Sep 30, 2020
aaf8ebd
Update base.html
Aemitrius Sep 30, 2020
acb8b3b
Update README.md
Aemitrius Oct 1, 2020
008267b
Update README.md
Aemitrius Oct 1, 2020
5ef36da
Update README.md
Aemitrius Oct 1, 2020
285b223
Update README.md
Aemitrius Oct 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Inventory/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
3 changes: 3 additions & 0 deletions Inventory/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
5 changes: 4 additions & 1 deletion Inventory/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'questionaire.apps.QuestionaireConfig',
'chat.apps.ChatConfig',
'rest_framework',
]

MIDDLEWARE = [
Expand Down Expand Up @@ -122,4 +125,4 @@
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "interface/static")
]
STATIC_ROOT = os.path.join(BASE_DIR, 'assets')
STATIC_ROOT = os.path.join(BASE_DIR, 'assets')
31 changes: 13 additions & 18 deletions Inventory/urls.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
"""Inventory URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.urls import path
from interface import views
from item.views import ItemChartView

urlpatterns = [
path('', views.cover, name='cover'),
path('dashboard', views.dashboard, name='dashboard'),
path('categories', views.categories, name='categories'),
path('check', views.check, name='check'),
path('arsenal', views.arsenal, name='arsenal'),
# path('', ItemChartView.as_view(), name='home'),
path('chart', ItemChartView.as_view(), name = 'chart'),
path('thechatbot',include('questionaire.urls')),
path('chat/',include('chat.urls')),
path('admin/', admin.site.urls),
path('', include('interface.urls'))

]
22 changes: 22 additions & 0 deletions Inventory/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from django.shortcuts import render
import sys

# Create your views here.
def cover(request):
return render(request, "interface/cover.html")

def dashboard(request):
return render(request, "interface/dashboard.html")

def categories(request):
return render(request, "interface/categories.html")

def check(request):
return render(request, "interface/check.html")


def arsenal(request):
return render(request, "interface/arsenal.html")

def chart(request):
return render(request,"chart.html")
123 changes: 122 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,122 @@
# Inventory_System_Eurymedons

<a href="https://i.ibb.co/j3Hsqrp/logo.png">
<img src="https://i.ibb.co/j3Hsqrp/logo.png" align="right" height="200"/>
</a>









# Inventory Management System by Eurymedons


## Basic Info <img src="https://raw.githubusercontent.com/aemmadi/aemmadi/master/wave.gif" width="30px">
A well designed management system(browser based web application) for eliminating time consuming physical management systems/methods, error-prone manual record keeping and physical reporting methods.

This project is based on python with various user-friendly features which are completely customizable and editable in the long run.

A preview is shown below
![Image Preview](https://github.com/codesbyN/Inventory-image-Eurymedon/blob/master/SS1.png "Image Preview")
### Features - :eyes:
* Frameworks -

Django framework, Dango Rest, Bootstrap
* User friendly UI created with Bootstrap
* Various database in different sections
* Admin panel created with Django
* Customizable user login system with editable user profiles
* Contact page for easier help and feedbacks
## Functional features - :handshake:
* Dashboard/Charts for visualization of the data
* Admin panel customizable and different access level
* Encryption feature in lieu of barcode system for better and safe transfer of data in the check in/out system. Also it can be used with various other features, hence improving its flexibility. Also it reduces the disadvantages in case of security of barcode systems.
* Specific ID system for employees and different items, equipped with the encryption feature
* Categories for different types of items stored. Each item has its own profile and can be viewed for more details. More categories can be added as per requirements if needed
* Record/History feature for different kinds of items
* Record keeping of users and filter feature for easy and fast searches
* Pdf download option of records to be used as hard copy.
* Navigation tutorial section for easy use.
* Only selected admins or superusers are permitted for full acccess of the inventory. Only superusers/selected admins can give users specific permissions and other customzatios from the admin panel.
* A user friendly chatbot for easy maintanence and help of the system

# What makes our Inventory better than everyone else? :clap:

The problem with the traditional inventory system was that they were not secured and easily maintainable. In a world of Technologies, there is need of an online system of inventory management. But still most inventory system is made using the outdated php language or languages such as React which is known for it's unstable modules sometimes.
After going through a number of articles we found out that Django will be the best language for an inventory system. The Django language is open source and maintain by a large communities and with every update it becomes more and more better. It is very much secure than the other languages and even a normal user can be quickly learn to handle the models of the websites and customize it accordingly.

And the very next thing that makes us better than any other inventory systems is that instead of the traditional barcode system, we are now using a new cryptography based encryption system. We found out that using barcodes have now become outdated and it is very vulnerable. Any person can retrieve the information stored in a barcode and it is big concern. Even though we are just sending equiments from one place to another, we have to make everything in a secure way.

Now an user can use our encryption system, input the data such as the quantity of items and their types, encrypt it with a key and print out the encrypted text(instead of the barcode) and send it out with the items. The user who will recieve it will now use the key given to him and decrypt the text(instead of the usual scanning of the barcode).
This way is more secure as only the person who has the key can access the information.

The Encryption system can also be used to exchange information between different person and can be put into many different uses as required by the user.

# Installation -
The `requirements.txt` file contains all the required libraries to be installed.

Use `pip install -r requirements.txt` to install the required dependencies(Or pip3).

python to be more than 3.0.0 and django –version 3.1.1. Also bootstrap 4.1,4.0

Extra apps needed are -
* Pillow
* WeasyPrint
* Crispy_forms
* Widget tweaks
* chart js
* gtk for windows

Use `pip install libname` to install the apps.

Steps after extracting the zip file -
* Go to the project folder and start the environment with conda or venv.
* Run `python manage.py collecstatic`
* Run `python manage.py makemigrations` -> `python manage.py sqlmigrate appname migration_number` -> `python manage.py migrate`
* Finally run `python manage.py runserver` to run the site on your localhost on port 8000.
* use `python manage.py createsuperuser` to create a super user and then login to the admin panel and enjoy the databases.

## Issues to be solved - :hourglass:
* The chatbot is still an incomplete feature. Also as this is a prototype it has few errors to be solved but it perfectly shows the features and the main aim of of the project we built.
* Since we had only one month and we have only made a prototype with a basic template, everything in the website can be improved with given time and made better.

# Technologies used
![JavaScript](https://img.shields.io/badge/-JavaScript-black?style=flat-square&logo=javascript)
![Python](https://img.shields.io/badge/-Python-black?style=flat-square&logo=Python)
![Bootstrap](https://img.shields.io/badge/-Bootstrap-563D7C?style=flat-square&logo=bootstrap)
![ElasticSearch](https://img.shields.io/badge/-ElasticSearch-005571?style=flat-square&logo=elasticsearch)
![Git](https://img.shields.io/badge/-Git-black?style=flat-square&logo=git)
![HTML5](https://img.shields.io/badge/-HTML5-E34F26?style=flat-square&logo=html5&logoColor=white)
![CSS3](https://img.shields.io/badge/-CSS3-1572B6?style=flat-square&logo=css3)
![Heroku](https://img.shields.io/badge/-Heroku-430098?style=round&logo=heroku)
![django](https://img.shields.io/badge/-django-450098?style=round&logo=django)


### Site is hosted on [Eurymedon Inventory](www.eurymedon-inventory.herokuapp.com)
**To login to the admin and view the models go to**
[admin login](eurymedon-inventory.herokuapp.com/admin)
### login : demo
### Password:inventory


# A quick Navigation and feature info
[Charts](http://eurymedon-inventory.herokuapp.com/dashboard/) - This is where you can dyanamically view charts in different ways, these are easily customizable according to the user needs.

[Encryption](http://eurymedon-inventory.herokuapp.com/encryption/encryption/) - This is the menu for the encryption system.

[Categories](http://eurymedon-inventory.herokuapp.com/categories) - This is menu for categories and product information page.

[People List and Pdf](http://eurymedon-inventory.herokuapp.com/users/user-list) - This is place where you can use our filter option and also elastisearch to find a specific product or person. This page can also show you the pdf option by which you can download any record.

[The Chatbot](http://eurymedon-inventory.herokuapp.com/thechatbot/thechatbot) - GET/POST/PUT/DELETE for Questionaires - Use for listing questionaires

[Chat list](http://eurymedon-inventory.herokuapp.com/chat/thechatbotchat/) - GET/POST/PUT/DELETE for Chat history of User

[Chat instance](http://eurymedon-inventory.herokuapp.com/chat/thechatbotchat/chatbot/) - Uploading json file of dialog tree




78 changes: 78 additions & 0 deletions chart.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{% extends 'interface/base.html'%}

{% block title %} Item ranking {% endblock title %}

{% block scripts %}

<script>

$(document).ready(function(){
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: [{% for item in qs %}'{{item.name}}',{% endfor %}],
datasets: [{
label: '# of quantity',
data: [{% for item in qs %}{{item.quantity}},{% endfor %}],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
});

</script>

{% endblock scripts %}

{% block content %}

<canvas id="myChart" width="500" height="200"></canvas>

<div class="container">
<div class = "title">
<h1>Chart.js Fun</h1>
<h3>Try to update the chart type and randomize the data!</h3>
</div>
<div class="controls">
<h5 class="label">Chart Type</h5>
<select name="chartType" id="chartType" onchange="updateChartType()">
<option value="line">Line</option>
<option value="bar">Bar</option>
<option value="radar">Radar</option>
<option value="polarArea">Polar Area</option>
<option value="doughnut">Doughnut</option>
</select>
<button onclick="randomizeData()">Randomize Data!</button>
</div>
<div class="chart-container" style="position: relative; width:85vw">
<canvas id="myChart"></canvas>
</div>
</div>
{% endblock content %}

3 changes: 3 additions & 0 deletions chat/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions chat/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class ChatConfig(AppConfig):
name = 'chat'
25 changes: 25 additions & 0 deletions chat/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.1.3 on 2018-12-04 07:32

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
('questionaire', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Chat',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('status', models.PositiveIntegerField(default=1, null=True)),
('log', models.TextField(default='')),
('questionaire', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='questionaire.Questionaire')),
],
),
]
12 changes: 12 additions & 0 deletions chat/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.db import models
from questionaire.models import Questionaire


class Chat(models.Model):
questionaire = models.ForeignKey(Questionaire, on_delete=models.CASCADE)
status = models.PositiveIntegerField(default=1,null=True)
log = models.TextField(default='')

def __str__(self):
return self.log

8 changes: 8 additions & 0 deletions chat/serializers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from rest_framework import serializers
from .models import Chat


class ChatSerializer(serializers.ModelSerializer):
class Meta:
model = Chat
fields = '__all__'
Loading