Skip to content

pangiann/inCharge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inCharge.gr

Template repository, used for NTUA/ECE Software Engineering, 2020-2021

❓ Project Description

This project aims to provide a web-based electric vehicle charging application, which will allow the drivers to have a charging profile. Specifically, monitoring your charging data, observing your contract and your provider's info, initialize a charging session are all possible via the application.

Beyond the driver's interface described above, our application also supports an admin and boss mode, where the employees of the electricity distributor companies can monitor the customers of their employing company, check the sessions their company supported and issue monthly bills to their customers.

🚹 Team

This project was curated by "TOULOUMPES" 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) as well as Python dependencies. Install them via

make deps 

Step 2. Setup MySQL database

Our application uses MySQL database. In this part database with name sql_inCharge will be created. Also, this Makefile rool will fill in the database with specific required data. Run the below command:

make test_db

Step 3. Populate the databse with data

In this step, we make use of python to fill our database with sessions, customers and other various data. In order to run test-insertion you have to be inside back-end file where test-insertion file exists.

python3 test-insertion.py

Step 4. Deploy web app

If you want to deploy our website using nginx you have to install nginx with:

sudo apt install nginx

Then create a new folder in /var/www/ named e.g. inCharge. Then you need to copy front-end files from TL directory to /var/www/inCharge/html

The configuration file for nginx looks like this:

server {
	listen localhost:4500;
	listen [::]:4500;

	# SSL configuration
	#
	# listen 443 ssl default_server;
	# listen [::]:443 ssl default_server;
	#
	# Note: You should disable gzip for SSL traffic.
	# See: https://bugs.debian.org/773332
	#
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See: https://bugs.debian.org/765782
	#
	# Self signed certs generated by the ssl-cert package
	# Don't use them in a production server!
	#
	# include snippets/snakeoil.conf;

	root /var/www/incharge.com/html;

	# Add index.php to the list if you are using PHP
	index index.html index.htm index.nginx-debian.html;

	server_name inCharge;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
	}

	# deny access to .htaccess files, if Apache's document root
	# concurs with nginx's one
	#
	#location ~ /\.ht {
	#	deny all;
	#}
}

The last action is to restart nginx server and then visit http://127.0.0.1:4500/web-drivers/

Final Step

In order to use our apis you have to run either server.py with python3 or api.py. Path for our apis is localhost:8765/evcharge/api

To test some of our apis you could run cli.

First run:

sh build.sh

Some examples for cli usage:

ev_charge17 --help 

ev_charge17 login --username [username] --passw [password] --format [json|csv]

ev_charge17 SessionsPerStation --station [station_id] --datefrom [%Y-%m-%d] --dateto [%Y-%m-%d] --apikey [apikey] --format [json|csv]

🔨 Technologies Used

  • Back-end

    • Python v3.8
    • Flask 1.1.2
    • MySQL v8.0.23
    • Werkzeug 1.0.1
  • Front-end

    • HTML5
    • CSS (scss)
    • JavaScript
  • Deployment

    • CherryPy
    • nginx
  • Continuous Integration & Unit Testing

    • coverage-5.5
  • Build Automation

    • GNU Make

Directory structure

Δομήστε τα παραδοτέα σας στους παρακάτω φακέλους όπως φαίνεται στην εκφώνηση της εργασίας.

/documentation

  • έγγραφα τεκμηρίωσης και διαγράμματα

/back-end

  • πηγαίος κώδικας και έλεγχοι του back-end της εφαρμογής

/cli-client

  • πηγαίος κώδικας και έλεγχοι του CLI client

/front-end

  • πηγαίος κώδικας και έλεγχοι του front-end της εφαρμογής

About

inCharge is an easy-to-use app handling the process of charging your electric vehicle in charging stations employing the app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors