Welcome to eSim and Arduino on Cloud’s documentation!¶
The project aims to provide a facility for a user to design different types of electronic circuits and arduino projects and simulate them by providing simulation parameters on the web. The detailed features will be updated soon.
Overview¶
eSim on Cloud¶
This system allows the users to draw analog and digital circuits and simulate them. The users have a facility to drag and drop components from the left pane onto the schematic grid on the right pane. The components on the grid are connected using wires. The circuit can then be simulated using the different simulation parameters (DC Solver, DC Sweep, Transient analysis, and AC analysis). The basic ERC check enables the users to find out errors if any. The size of the schematic grid can be changed from A1 to A5 paper sizes along with portrait and landscape modes. The users can also print the circuit or save it in pdf format for documentation purposes.
Arduino on Cloud¶
This system allows the users to drag and drop Arduino components from the left pane onto the working space on the right. The pins of the Arduino board can be connected to various input/output devices like LED, motor, push button, etc using wires. There is also a facility to change the color of wires, LEDs, and such components, so as to differentiate the easily. The users can then proceed to write their code in the code window which is then simulated. There is an option for the users to print or save it in pdf format for documentation purposes. The basic ERC check enables the users to find out errors if any.
Note
This docs is created using Read the docs and we will be glad to receive pull requests for updating the same. Please go through the Contribute section to know more.
Architecture and Installation¶
The production environment consist of the following docker containers:
Container Name |
Description |
---|---|
nginx |
Used as a reverse proxy to route requests to appropriate endpoints and loadbalancing |
celery |
Used as a reverse proxy to route requests to appropriate endpoints and loadbalancing |
redis |
Used as a cache and a task queue for Celery |
mongodb |
Container running MongoDB Database |
db |
Container running MYSQL Database |
django |
Container running the main Django Backend serving all APIs |
arduino-frontend |
Container running node 10 helping build Angular app for Arduino Simulation Webapp |
eda-frontend |
Container running node 10 helping build React app for EDA CircuitSimulation Webapp |
Note
These containers depend on .env.prod file, configuration details can be reffered from Environment Variables.

Installation and Usage¶
It is essential that docker and docker-compose are installed on a system before following the steps.
Production Environment¶
git clone git@github.com:frg-fossee/eSim-Cloud.git && cd eSim-Cloud
cp .env .env.prod
docker-compose -f docker-compose.prod.yml –env-file .env.prod up –scale django=1 –scale celery=3 -d
Note
Please change the default passwords in the .env.prod file to secure your instance against attackers.
Development Environment¶
git clone git@github.com:frg-fossee/eSim-Cloud.git && cd eSim-Cloud
git checkout develop
Configure docker with github packages for pulling pre built images
echo $GITHUB_TOKEN | docker login docker.pkg.github.com –username [github_username] –password-stdin
/bin/bash first_run.dev.sh
For running only the backend containers¶
docker-compose -f docker-compose.dev.yml up django
For running only the eda-frontend container with backend¶
docker-compose -f docker-compose.dev.yml up eda-frontend
For running only the arduino-frontend container with backend¶
docker-compose -f docker-compose.dev.yml up arduino-frontend
Useful Commands¶
docker exec -it <container ID> <command>
eg. docker exec -it b7e7acf2283e /bin/sh
sh migrations.sh inside a docker container to apply db migrations manually
To seed libraries - python manage.py seed_libs –location kicad-symbols/ inside container
To remove seeded libraries - python manage.py seed_libs –clear inside container
Environment Variables¶
Variable |
Description |
Default |
---|---|---|
PYTHONUNBUFFERED |
allows for log messages to be immediately dumped witout buffering |
True |
SQL_ENGINE |
SQL Engine used by Django |
django.db.backends.mysql |
SQL_HOST |
Hostname for database server |
db |
SQL_PORT |
Port for database server |
3306 |
DJANGO_DEBUG |
Debug mode setting for Django |
True |
MYSQL_ROOT_PASSWORD |
Root password for MYSQL |
password |
MYSQL_DATABASE |
Default database name for MYSQL |
esimcloud_db |
MYSQL_USER |
Username for MYSQL Server |
user |
MYSQL_PASSWORD |
password for MYSQL Server |
password |
MONGO_INITDB_ROOT_USERNAME |
Username for MongoDB Initial Database |
user |
MONGO_INITDB_ROOT_PASSWORD |
Password for MongoDB Initial Database |
password |
MONGO_INITDB_DATABASE |
MongoDB Initial Database name |
esimcloud_db |
TAG_MYSQL |
MYSQL Docker Image Tag to pull ( Version ) |
8.0 |
TAG_REDIS |
Redis Docker Image Tag to pull ( Version ) |
alpine3.11 |
TAG_MONGO |
Mongodb Docker Image Tag to pull ( Version ) |
4.2.6 |
GUNICORN_WORKERS |
Number of Gunicorn workers to spawn per container |
5 |
CELERY_WORKERS |
Number of Celery workers to spawn per container |
5 |
EDA_PUBLIC_URL |
public url used to build react frontend files |
|
ARDUINO_BASE_HREF |
public path used to build angular frontend files |
/arduino/ |
Note
Please change the default passwords in the .env.prod file to secure your instance against attackers.
Introduction to eSim on Cloud¶
eSim Development Flow¶


Reading Component Symbol Library files and Rendering in the Browser¶
The Kicad symbol libraries ‘.lib’ and ‘.dcm’ (https://github.com/KiCad/kicad-symbols) are parsed to generate SVG files that are compatible with the mxgraph (javascript graph library). These components are generated only once and are cached. These generated SVG files are read and rendered in the component list (left pane) using mxgraph.
Generating XML files¶
The components from the left pane are dropped onto the schematic grid. By default, the size of the grid is A4, which can be changed from A5 to A1. The components connected by wires are converted to XML format using mxgraph, whenever the circuit is saved by the user. This XML is used to save and re-open the saved circuits. This XML is also used to auto annotate the circuit, and in performing ERC checks as well.
Generating Netlist¶
Using the mxgraph object, a netlist is generated (compatible with ngspice simulator) when the user clicks on the ‘Simulation’ or ‘generate netlist’ button. The simulation parameters are supplied by the user based on the simulation type chosen by the user. The following are the different parts of netlist generation:
Title: title of the schematic diagram
RC Circuit
Model: All spice models given by users will be listed here. These are extra parameters which are not delivered with ngspice. They are device manufacturer specific and may be obtained from their web sites or from other sites
.model BC546B npn ( IS=7.59E-15 VAF=73.4 .........)
Netlist: Text description of circuit. It has all components listed with connecting nodes, parameters and spice model (if specified by the user). This is generated with the help of mxgraph object. An example is shown below
r1 in out 1k c1 out gnd 10u v1 in gnd pwl(0m 0 0.5m 5 50m 5 50.5m 0 100m 0) Q1 intc intb 0 BC546B
Control Line: It has all simulation parameters. It is generated depending on the type of simulation and the parameters specified by user
.tran 10e-03 100e-03 0e-03 // Transient analysis .ac dec 10 10 1Meg // AC Analysis
Control Block: All Interactive commands to actually produce output for given schematic.
.control run print all > data.txt .endc .end
Simulation¶
When the ‘Simulate’ button is clicked, the ERC checks are performed. If all goes well then the netlist is generated. If not, the error(s) are shown to the user.
This netlist is sent to the backend services. Using the distributed queueing mechanism of Celery, asynchronous requests (netlist files) are kept in queue and passed onto Ngspice.
Ngspice then outputs a text file with all the coordinates required to plot the graph.
This textfile is then parsed using an inhouse parser to convert the data of the text file into an organised data structures (
JSON
). The simulation graph is then plotted and rendered based on the data returned by thisJSON
usingchartjs
.
JSON format returned by parser¶
As mentioned above, the output produced by ngspice is converted to JSON
. The format is given below:
{ total_number_of_tables: <int>, isGraph: <bool>, data:[ { labels : [ ], x : [ ], y : [ [ ] , [ ] ] , } ] }
total-number-of-tables: The number of tables present.
isGraph:
True
, if the data is a graph,False
if the data is just a table.data: An array which contains one or more objects depending on the input provided to the parser.
labels: An array which contains all the labels that have to be present on the graph. Eg. [“time”, “vin”, “vout”].
x: An array containing all the
x
co-ordinates for a set of graph. E.g. Time on x-axis. This is a linear array as thex
coordinates will be the same for different set ofy
coordinates.y: A 2D array containing
y
co-ordinates for different graphs.
Features¶
The schematic editor is divided into 3 panes. The left pane consists of the Component List
and a facility to search components. The middle pane consists of the grid on which the components will be dropped and the circuit will be designed. The right pane consists of the grid properties, description of the circuit, and components position. More details are given below.
Component categories¶
The kicad components are categorized as follows, where each component has Name
, Description
, Keywords
, and Datasheet
.
Analog
Device
Triac_Thyristor
Transistor_IGBT
Diode
Transistor_FET
pspice
Oscillator
eSim_Sources
eSim_Hybrid
Motor
LED
Transistor_BJT
power
4xxx
Searching Component¶
Rather than going through categories and locating the component symbol, one can also search a component by typing in the textbox given, using the filters like Name
, Keyword
, Description
, Component Library
, and Prefix
.
Grid size and Orientation¶
The size of the grid can be changed from A1 to A5 and offers Portrait and Landscape mode
Components Position¶
Using the this box, one can access and view the circuit which do not fit onto the specified grid size. Its like accessing another page. This situation arises when one has a large circuit and changes the grid from a larger size to a smaller one.
Schematic Description¶
A text area in which one can write the description about the circuit.
Basic Editor Operations¶
The following basic editor functions are supported:
Undo
Redo
Delete
Zoom in
Zoom out
Default size
Rotate
Print
Clear All: Clear the schematic drawn
Gallery¶
Sample circuits are available in the gallery for anyone to refer and use. These circuits can be opened, saved, and simulated.
Saving and Re-Opening¶
The circuits are saved only of an authenticated user and are viewed on the user dashboard. The same can be reopened as well for further editing.
Dashboard¶
A place where the authenticated user can view the different circuits designed by him/her. Then user can open the saved circuit into the editor by clicking on Launch in Editor
.
Export¶
Image: The circuit can be exported as
jpeg
,png
, andsvg
. This is useful for documenting and printing.JSON: The circuit can be exported as
JSON
so as to open it again using the Upload feature.
Open Schematic¶
The schematic can be opened using the following methods:
Uploading file: One needs to upload the file in
JSON
format i.e. which was exported using this tool.Local: The circuits saved by the authenticated user.
Gallery: The sample circuits available in the gallery for anyone to refer.
ERC Check¶
Basic ERC check is done for simulating a circuit. For example, if the wires are connected or not.
Generate Netlist¶
Based on the circuit a netlist is generated. The internal process of generating a netlist was described in the previous section.
Simulate¶
There are four simulation modes as follows
DC Solver: A DC simulation attempts to find a stable DC solution of your circuit.
DC Sweep: A DC Sweep will plot the DC solution of your circuit across different values of a parameter of a circuit element. You can sweep any numerical parameter of any circuit element in your circuit.
Transient Analysis: A Transient analysis does a Time-Domain Simulation of your circuit over a certain period of time.
AC Analysis: AC Analysis does a small signal analysis of your circuit. The input can be any voltage source or current source.
Spice simulator¶
Using the spice simulator one can type the netlist in the code editor box and simulate it. Simulation result window will popup displaying the result.
Note: Add > data.txt
at the end of the control line.
.control run print all > data.txt .endc .end
eSim Gallery Examples¶
eSim gallery has 6 example circuits. You can open, re-design, save, and simulate them. These are listed below.
Voltage Divider¶

Simulation Type: DC Solver
Simulation Parameters: None
Simulation
RC Circuit¶

Simulation Type: Transient Analysis
- Simulation Parameters
Start Time: 0
Stop Time: 100m
Step Time: 10m
Simulation
Dual RC Ladder¶

Simulation Type: Transient Analysis
- Simulation Parameters
Start Time: 0
Stop Time: 50m
Step Time: 50u
Simulation
Bipolar Amplifier¶

Simulation Type: Transient Analysis
- Simulation Parameters
Start Time: 0
Stop Time: 10m
Step Time: 10u
Simulation
Simulation Type: AC Analysis
- Simulation Parameters
Type: Decade
Points: 10
Start frequency: 10
Stop frequency: 10Meg
Simulation
Shunt Clipper¶

Simulation Type: DC Sweep
- Simulation Parameters
Component: V1
Start Voltage: 0
Stop Voltage: 1
Step Voltage: 1m
Add Expression: -v1#branch
Simulation
RC Circuit Parallel¶

Simulation Type: Transient Analysis
- Simulation Parameters
Start Time: 0
Stop Time: 30m
Step Time: 10u
Simulation
Screenshots¶
Introduction to Arduino on Cloud¶
Arduino Development Flow¶
Drawing Components and Rendering in Browser¶
Each component is drawn in Inkscape which is exported as
.png
and.svg
. These files are stored in/ArduinoFrontend/src/assets/images/components/
. This is a one time process.The
png
files (components) are rendered in the components pane (left pane) in the browser.When the components are dropped onto the workspace on the right, the components are rendered using
SVG
if that component does not have any animation, i.e. they remain static during entire the simulation processRaphael
: if that component produces some animation during the simulation. A basic example would be: glowing of LED.
The details of these components like
name
,pins
,drawing path
,voltage
,current
,frequency
,color of LED
, etc., are stored in respective json files/ArduinoFrontend/src/assets/jsons/
Capturing Arduino Project Schematic¶
The components from the left pane are dropped onto the workspace. The components and their connections are stored in JSON format.
Simulation¶
At first, a basic check is done whether the required components are connected or not.
The code written is then compiled by
Arduino CLI
which generates ahex code
.This hex code is then passed to
AVR8js
which simulates the components in the browser.
Features¶
The Arduino circuit designer is divided into 2 panes. The left pane consists of the components, while the right pane consists of a workspace on which the components will be dropped and the circuit will be designed. More details are given below.
Component categories¶
The components are categorized as follows:
Categories |
Components |
---|---|
General |
Resistor, Breadboard |
Controllers |
Arduino UNO |
Output |
Buzzer, LED, Motor, LCD, Servo Motor, 7 segment display, RGB LED |
Input |
Push button, Ultrasonic Distance Sensor, PIR Sensor, Slide switch, Photo sensor, Temperature Sensor, Potentiometer, Gas Sensor |
Sources |
9v Battery, Coin cell 3v |
Drivers |
Motor driver L298N |
Miscellaneous |
Label, Relay module |
Workspace¶
A workspace is a place where the user can drop the components and design the arduino circuit by connecting the components using wires.
Component Info / Properties¶
The properties for each component can be set by clicking on the component and changing/setting the desired value in the box on the right. For example, one can change the color of LED, set resistence value, etc. To know more information about the component, one can click the View Info
button.
ERC Check¶
Basic ERC check is done for simulating a circuit. For example, if the wires are connected or not.
View/Download Component List¶
The list of components and its quantity which are present on the workspace can be viewed or downloaded in CSV format. This come handy for maintaining a check list or a buying list, when one switches from the web based arduino designer to a physical one.
Export¶
The circuit can be exported as jpeg
, png
, and svg
. This is useful for documenting and printing.
Code editor¶
A code editor is a place where the users will write the code (logic) for simulation. This is nothing but ino
file, which can be downloaded for use in Arduino IDE. There is also a facility to include the supported header files like EEPROM, LiquidCrystal, Servo, SoftwareSerial, Wire, and SPI.
Simulator¶
The Simulation toggle button starts/stops the simulation. The console window displays the logs and output if any for the simulation.
Saving and Re-opening¶
The circuits are saved only of an authenticated user and are displayed on the user dashboard. The same can be reopened as well for further editing.
Dashboard¶
A place where the authenticated user can view the different circuits designed by him/her.
Gallery¶
A set of example projects (circuit design and code) which can be referred by the users. This is an addon material helpful for the novice users who need to get a feel of the system and the circuit design.
Screenshots¶
Developer docs¶
APIs¶
List of APIs used in this system
- POST /arduino/compile¶
Compile list of Arduino Sketch File
- Status Codes
- GET /auth/o/{provider}/¶
- Parameters
provider (string) –
- Status Codes
200 OK –
- Response JSON Object
access (string) – (read only)
refresh (string) – (read only)
user (string) – (read only)
- POST /auth/o/{provider}/¶
- Parameters
provider (string) –
- Request JSON Object
access (string) – (read only)
refresh (string) – (read only)
user (string) – (read only)
- Status Codes
- Response JSON Object
access (string) – (read only)
refresh (string) – (read only)
user (string) – (read only)
- POST /auth/token/login/¶
Use this endpoint to obtain user authentication token.
- Request JSON Object
password (string) –
username (string) –
- Status Codes
- Response JSON Object
password (string) –
username (string) –
- POST /auth/token/logout/¶
Use this endpoint to logout user (remove user authentication token).
- Status Codes
- GET /auth/users/¶
- Status Codes
200 OK –
- Response JSON Object
[].email (string) –
[].id (integer) – (read only)
[].username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (read only)
- POST /auth/users/¶
- Request JSON Object
email (string) –
id (integer) – (read only)
password (string) – (required)
username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (required)
- Status Codes
- Response JSON Object
email (string) –
id (integer) – (read only)
password (string) – (required)
username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (required)
- POST /auth/users/activation/¶
- Request JSON Object
token (string) – (required)
uid (string) – (required)
- Status Codes
- Response JSON Object
token (string) – (required)
uid (string) – (required)
- GET /auth/users/me/¶
- Status Codes
200 OK –
- Response JSON Object
[].email (string) –
[].id (integer) – (read only)
[].username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (read only)
- PUT /auth/users/me/¶
- Request JSON Object
email (string) –
id (integer) – (read only)
username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (read only)
- Status Codes
200 OK –
- Response JSON Object
email (string) –
id (integer) – (read only)
username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (read only)
- PATCH /auth/users/me/¶
- Request JSON Object
email (string) –
id (integer) – (read only)
username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (read only)
- Status Codes
200 OK –
- Response JSON Object
email (string) –
id (integer) – (read only)
username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (read only)
- DELETE /auth/users/me/¶
- Status Codes
- POST /auth/users/resend_activation/¶
- Request JSON Object
email (string) – (required)
- Status Codes
- Response JSON Object
email (string) – (required)
- POST /auth/users/reset_password/¶
- Request JSON Object
email (string) – (required)
- Status Codes
- Response JSON Object
email (string) – (required)
- POST /auth/users/reset_password_confirm/¶
- Request JSON Object
new_password (string) – (required)
token (string) – (required)
uid (string) – (required)
- Status Codes
- Response JSON Object
new_password (string) – (required)
token (string) – (required)
uid (string) – (required)
- POST /auth/users/reset_username/¶
- Request JSON Object
email (string) – (required)
- Status Codes
- Response JSON Object
email (string) – (required)
- POST /auth/users/reset_username_confirm/¶
- Request JSON Object
new_username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (required)
- Status Codes
- Response JSON Object
new_username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (required)
- POST /auth/users/set_password/¶
- Request JSON Object
current_password (string) – (required)
new_password (string) – (required)
- Status Codes
- Response JSON Object
current_password (string) – (required)
new_password (string) – (required)
- POST /auth/users/set_username/¶
- Request JSON Object
new_username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (required)
- Status Codes
- Response JSON Object
new_username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (required)
- GET /auth/users/{id}/¶
- Parameters
id (integer) – A unique integer value identifying this user.
- Status Codes
200 OK –
- Response JSON Object
email (string) –
id (integer) – (read only)
username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (read only)
- PUT /auth/users/{id}/¶
- Parameters
id (integer) – A unique integer value identifying this user.
- Request JSON Object
email (string) –
id (integer) – (read only)
username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (read only)
- Status Codes
200 OK –
- Response JSON Object
email (string) –
id (integer) – (read only)
username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (read only)
- PATCH /auth/users/{id}/¶
- Parameters
id (integer) – A unique integer value identifying this user.
- Request JSON Object
email (string) –
id (integer) – (read only)
username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (read only)
- Status Codes
200 OK –
- Response JSON Object
email (string) –
id (integer) – (read only)
username (string) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (read only)
- DELETE /auth/users/{id}/¶
- Parameters
id (integer) – A unique integer value identifying this user.
- Status Codes
- GET /circuits/¶
Listing Published Circuits
- Status Codes
200 OK –
- Response JSON Object
[].author (integer) –
[].base64_image (string) – (read only)
[].circuit_id (string) – (read only)
[].data_dump (string) – (required)
[].description (string) – (required)
[].last_updated (string) – (read only)
[].publish_request_time (string) – (read only)
[].sub_title (string) –
[].title (string) – (required)
- GET /circuits/{circuit_id}/¶
Listing Published Circuits
- Parameters
circuit_id (string) – A UUID string identifying this circuit.
- Status Codes
200 OK –
- Response JSON Object
author (integer) –
base64_image (string) – (read only)
circuit_id (string) – (read only)
data_dump (string) – (required)
description (string) – (required)
last_updated (string) – (read only)
publish_request_time (string) – (read only)
sub_title (string) –
title (string) – (required)
- GET /components/¶
Listing All Library Details
- Query Parameters
name__icontains (string) –
keyword__icontains (string) –
description__icontains (string) –
component_library__library_name__icontains (string) –
component_library (string) –
symbol_prefix (string) –
- Status Codes
200 OK –
- Response JSON Object
[].alternate_component[].dmg (integer) – (required)
[].alternate_component[].full_name (string) – (required)
[].alternate_component[].id (integer) – (read only)
[].alternate_component[].part (string) – (required)
[].alternate_component[].svg_path (string) – (required)
[].component_library (string) – (required)
[].data_link (string) – (required)
[].description (string) – (required)
[].full_name (string) – (required)
[].id (integer) – (read only)
[].keyword (string) – (required)
[].name (string) – (required)
[].svg_path (string) – (required)
[].symbol_prefix (string) – (required)
[].thumbnail_path (string) – (required)
- GET /components/{id}/¶
Listing All Library Details
- Parameters
id (integer) – A unique integer value identifying this library component.
- Status Codes
200 OK –
- Response JSON Object
alternate_component[].dmg (integer) – (required)
alternate_component[].full_name (string) – (required)
alternate_component[].id (integer) – (read only)
alternate_component[].part (string) – (required)
alternate_component[].svg_path (string) – (required)
component_library (string) – (required)
data_link (string) – (required)
description (string) – (required)
full_name (string) – (required)
id (integer) – (read only)
keyword (string) – (required)
name (string) – (required)
svg_path (string) – (required)
symbol_prefix (string) – (required)
thumbnail_path (string) – (required)
- GET /libraries/¶
Listing All Library Details
- Query Parameters
library_name (string) –
- Status Codes
200 OK –
- Response JSON Object
[].id (integer) – (read only)
[].library_name (string) – (required)
[].saved_on (string) – (read only)
- GET /libraries/{id}/¶
Listing All Library Details
- Parameters
id (integer) – A unique integer value identifying this library.
- Status Codes
200 OK –
- Response JSON Object
id (integer) – (read only)
library_name (string) – (required)
saved_on (string) – (read only)
- GET /publish/circuit/¶
CRUD for viewing unpublished / published circuits ( Permission Groups )
- Status Codes
200 OK –
- Response JSON Object
[].author (integer) –
[].base64_image (string) – (read only)
[].circuit_id (string) – (read only)
[].data_dump (string) – (required)
[].description (string) – (required)
[].last_updated (string) – (read only)
[].publish_request_time (string) – (read only)
[].sub_title (string) –
[].title (string) – (required)
- POST /publish/circuit/¶
CRUD for viewing unpublished / published circuits ( Permission Groups )
- Request JSON Object
author (integer) –
base64_image (string) – (read only)
circuit_id (string) – (read only)
data_dump (string) – (required)
description (string) – (required)
last_updated (string) – (read only)
publish_request_time (string) – (read only)
sub_title (string) –
title (string) – (required)
- Status Codes
- Response JSON Object
author (integer) –
base64_image (string) – (read only)
circuit_id (string) – (read only)
data_dump (string) – (required)
description (string) – (required)
last_updated (string) – (read only)
publish_request_time (string) – (read only)
sub_title (string) –
title (string) – (required)
- GET /publish/circuit/{circuit_id}/¶
CRUD for viewing unpublished / published circuits ( Permission Groups )
- Parameters
circuit_id (string) – A UUID string identifying this circuit.
- Status Codes
200 OK –
- Response JSON Object
author (integer) –
base64_image (string) – (read only)
circuit_id (string) – (read only)
data_dump (string) – (required)
description (string) – (required)
last_updated (string) – (read only)
publish_request_time (string) – (read only)
sub_title (string) –
title (string) – (required)
- PUT /publish/circuit/{circuit_id}/¶
CRUD for viewing unpublished / published circuits ( Permission Groups )
- Parameters
circuit_id (string) – A UUID string identifying this circuit.
- Request JSON Object
author (integer) –
base64_image (string) – (read only)
circuit_id (string) – (read only)
data_dump (string) – (required)
description (string) – (required)
last_updated (string) – (read only)
publish_request_time (string) – (read only)
sub_title (string) –
title (string) – (required)
- Status Codes
200 OK –
- Response JSON Object
author (integer) –
base64_image (string) – (read only)
circuit_id (string) – (read only)
data_dump (string) – (required)
description (string) – (required)
last_updated (string) – (read only)
publish_request_time (string) – (read only)
sub_title (string) –
title (string) – (required)
- PATCH /publish/circuit/{circuit_id}/¶
CRUD for viewing unpublished / published circuits ( Permission Groups )
- Parameters
circuit_id (string) – A UUID string identifying this circuit.
- Request JSON Object
author (integer) –
base64_image (string) – (read only)
circuit_id (string) – (read only)
data_dump (string) – (required)
description (string) – (required)
last_updated (string) – (read only)
publish_request_time (string) – (read only)
sub_title (string) –
title (string) – (required)
- Status Codes
200 OK –
- Response JSON Object
author (integer) –
base64_image (string) – (read only)
circuit_id (string) – (read only)
data_dump (string) – (required)
description (string) – (required)
last_updated (string) – (read only)
publish_request_time (string) – (read only)
sub_title (string) –
title (string) – (required)
- DELETE /publish/circuit/{circuit_id}/¶
CRUD for viewing unpublished / published circuits ( Permission Groups )
- Parameters
circuit_id (string) – A UUID string identifying this circuit.
- Status Codes
- GET /publish/publishing/¶
Publishing CRUD Operations
- Status Codes
200 OK –
- Response JSON Object
[].circuit.author (integer) –
[].circuit.base64_image (string) – (read only)
[].circuit.circuit_id (string) – (read only)
[].circuit.data_dump (string) – (required)
[].circuit.description (string) – (required)
[].circuit.last_updated (string) – (read only)
[].circuit.publish_request_time (string) – (read only)
[].circuit.sub_title (string) –
[].circuit.title (string) – (required)
[].published (boolean) –
[].reviewed_by (string) –
[].tags[].description (string) – (required)
[].tags[].id (integer) – (read only)
[].tags[].tag (string) – (required)
- POST /publish/publishing/¶
Publishing CRUD Operations
- Request JSON Object
circuit.author (integer) –
circuit.base64_image (string) – (read only)
circuit.circuit_id (string) – (read only)
circuit.data_dump (string) – (required)
circuit.description (string) – (required)
circuit.last_updated (string) – (read only)
circuit.publish_request_time (string) – (read only)
circuit.sub_title (string) –
circuit.title (string) – (required)
published (boolean) –
reviewed_by (string) –
tags[].description (string) – (required)
tags[].id (integer) – (read only)
tags[].tag (string) – (required)
- Status Codes
- Response JSON Object
circuit.author (integer) –
circuit.base64_image (string) – (read only)
circuit.circuit_id (string) – (read only)
circuit.data_dump (string) – (required)
circuit.description (string) – (required)
circuit.last_updated (string) – (read only)
circuit.publish_request_time (string) – (read only)
circuit.sub_title (string) –
circuit.title (string) – (required)
published (boolean) –
reviewed_by (string) –
tags[].description (string) – (required)
tags[].id (integer) – (read only)
tags[].tag (string) – (required)
- GET /publish/publishing/{id}/¶
Publishing CRUD Operations
- Parameters
id (integer) – A unique integer value identifying this publish.
- Status Codes
200 OK –
- Response JSON Object
circuit.author (integer) –
circuit.base64_image (string) – (read only)
circuit.circuit_id (string) – (read only)
circuit.data_dump (string) – (required)
circuit.description (string) – (required)
circuit.last_updated (string) – (read only)
circuit.publish_request_time (string) – (read only)
circuit.sub_title (string) –
circuit.title (string) – (required)
published (boolean) –
reviewed_by (string) –
tags[].description (string) – (required)
tags[].id (integer) – (read only)
tags[].tag (string) – (required)
- PUT /publish/publishing/{id}/¶
Publishing CRUD Operations
- Parameters
id (integer) – A unique integer value identifying this publish.
- Request JSON Object
circuit.author (integer) –
circuit.base64_image (string) – (read only)
circuit.circuit_id (string) – (read only)
circuit.data_dump (string) – (required)
circuit.description (string) – (required)
circuit.last_updated (string) – (read only)
circuit.publish_request_time (string) – (read only)
circuit.sub_title (string) –
circuit.title (string) – (required)
published (boolean) –
reviewed_by (string) –
tags[].description (string) – (required)
tags[].id (integer) – (read only)
tags[].tag (string) – (required)
- Status Codes
200 OK –
- Response JSON Object
circuit.author (integer) –
circuit.base64_image (string) – (read only)
circuit.circuit_id (string) – (read only)
circuit.data_dump (string) – (required)
circuit.description (string) – (required)
circuit.last_updated (string) – (read only)
circuit.publish_request_time (string) – (read only)
circuit.sub_title (string) –
circuit.title (string) – (required)
published (boolean) –
reviewed_by (string) –
tags[].description (string) – (required)
tags[].id (integer) – (read only)
tags[].tag (string) – (required)
- PATCH /publish/publishing/{id}/¶
Publishing CRUD Operations
- Parameters
id (integer) – A unique integer value identifying this publish.
- Request JSON Object
circuit.author (integer) –
circuit.base64_image (string) – (read only)
circuit.circuit_id (string) – (read only)
circuit.data_dump (string) – (required)
circuit.description (string) – (required)
circuit.last_updated (string) – (read only)
circuit.publish_request_time (string) – (read only)
circuit.sub_title (string) –
circuit.title (string) – (required)
published (boolean) –
reviewed_by (string) –
tags[].description (string) – (required)
tags[].id (integer) – (read only)
tags[].tag (string) – (required)
- Status Codes
200 OK –
- Response JSON Object
circuit.author (integer) –
circuit.base64_image (string) – (read only)
circuit.circuit_id (string) – (read only)
circuit.data_dump (string) – (required)
circuit.description (string) – (required)
circuit.last_updated (string) – (read only)
circuit.publish_request_time (string) – (read only)
circuit.sub_title (string) –
circuit.title (string) – (required)
published (boolean) –
reviewed_by (string) –
tags[].description (string) – (required)
tags[].id (integer) – (read only)
tags[].tag (string) – (required)
- DELETE /publish/publishing/{id}/¶
Publishing CRUD Operations
- Parameters
id (integer) – A unique integer value identifying this publish.
- Status Codes
- POST /save¶
API to save the state of project to db which can be loaded or shared later
- Status Codes
- Response JSON Object
base64_image (string) – (read only)
create_time (string) – (read only)
data_dump (string) – (required)
description (string) –
name (string) –
owner (integer) –
save_id (string) –
save_time (string) – (read only)
shared (boolean) –
- GET /save/list¶
Returns Saved data for given username, Only user who saved the state can access it THIS WILL ESCAPE DOUBLE QUOTES
- Status Codes
200 OK –
- Response JSON Object
base64_image (string) – (read only)
create_time (string) – (read only)
data_dump (string) – (required)
description (string) –
name (string) –
owner (integer) –
save_id (string) –
save_time (string) – (read only)
shared (boolean) –
- GET /save/{save_id}¶
Returns Saved data for given save id , Only user who saved the state can access / update it THIS WILL ESCAPE DOUBLE QUOTES
- Parameters
save_id (string) –
- Status Codes
200 OK –
- Response JSON Object
base64_image (string) – (read only)
create_time (string) – (read only)
data_dump (string) – (required)
description (string) –
name (string) –
owner (integer) –
save_id (string) –
save_time (string) – (read only)
shared (boolean) –
- POST /save/{save_id}¶
Returns Saved data for given save id , Only user who saved the state can access / update it THIS WILL ESCAPE DOUBLE QUOTES
- Parameters
save_id (string) –
- Status Codes
200 OK –
- Response JSON Object
base64_image (string) – (read only)
create_time (string) – (read only)
data_dump (string) – (required)
description (string) –
name (string) –
owner (integer) –
save_id (string) –
save_time (string) – (read only)
shared (boolean) –
- POST /save/{save_id}/sharing/{sharing}¶
Enables sharing for the given saved state
- Parameters
save_id (string) –
sharing (string) –
- Status Codes
200 OK –
- Response JSON Object
base64_image (string) – (read only)
create_time (string) – (read only)
data_dump (string) – (required)
description (string) –
name (string) –
owner (integer) –
save_id (string) –
save_time (string) – (read only)
shared (boolean) –
- GET /simulation/status/{task_id}¶
Returns Simulation results for ‘task_id’ provided after uploading the netlist /api/task/<uuid>
- Parameters
task_id (string) –
- Status Codes
200 OK –
- POST /simulation/upload¶
API for NetlistUpload
Requires a multipart/form-data POST Request with netlist file in the ‘file’ parameter
- Status Codes
- GET /tags/¶
CRUD for Tags
- Status Codes
200 OK –
- Response JSON Object
[].description (string) – (required)
[].id (integer) – (read only)
[].tag (string) – (required)
- POST /tags/¶
CRUD for Tags
- Request JSON Object
description (string) – (required)
id (integer) – (read only)
tag (string) – (required)
- Status Codes
- Response JSON Object
description (string) – (required)
id (integer) – (read only)
tag (string) – (required)
- GET /tags/{id}/¶
CRUD for Tags
- Parameters
id (integer) – A unique integer value identifying this circuit tag.
- Status Codes
200 OK –
- Response JSON Object
description (string) – (required)
id (integer) – (read only)
tag (string) – (required)
- PUT /tags/{id}/¶
CRUD for Tags
- Parameters
id (integer) – A unique integer value identifying this circuit tag.
- Request JSON Object
description (string) – (required)
id (integer) – (read only)
tag (string) – (required)
- Status Codes
200 OK –
- Response JSON Object
description (string) – (required)
id (integer) – (read only)
tag (string) – (required)
- PATCH /tags/{id}/¶
CRUD for Tags
- Parameters
id (integer) – A unique integer value identifying this circuit tag.
- Request JSON Object
description (string) – (required)
id (integer) – (read only)
tag (string) – (required)
- Status Codes
200 OK –
- Response JSON Object
description (string) – (required)
id (integer) – (read only)
tag (string) – (required)
- DELETE /tags/{id}/¶
CRUD for Tags
- Parameters
id (integer) – A unique integer value identifying this circuit tag.
- Status Codes
DB Switching Instructions¶
To switch between databases, follow the instructions below
Please note all data in the database will be lost
Turn off existing containers
docker-compose -f docker-compose.dev.yml down
Switch to the needed config inside .env then copy it to prod config
cp .env .env.prod
, make needed changes ( if required) in the prod configUncomment the appropriate DB Block inside docker-compse.(dev/prod).yml, please note only one db block should be present
Build Containers and run db migrations again
./first_run.dev.sh
Contributing¶
Contributing¶
Want to contribute? Great to know! eSim and Arduino on Cloud is an open source project and we welcome contributions from all. We would be very happy to collaborate with you. To contribute to this project please make sure that you first discuss with us and follow the guidelines given.
Types of contributions¶
Contributions can be of different types. Some are listed below.
Report a bug
Suggest a feature
Fix a bug
Improve UI
Contribute a new feature
Update documentation
Reporting Bug / Suggesting Features¶
If you just want to report a bug in our system or want to suggest a new feature or improve UI, etc., then first browse through our existing issues to check whether this has been addressed or not. If not, feel free to create a new issue. Please read the new issue guidelines given.
Step 1: Assign/Create Issues¶
Existing issues¶
Before you start contributing, first browse through the existing issues and pull requests to know whether someone else has already fixed or is already working on it.
If an issue is already created but no one is assigned to it, create a comment ‘Assignee: @YourGitHubUsername’. This will let the community know that you are addressing this issue.
Just a suggestion: If you are a new contributor you can look at issues tagged as ‘good first issue’ tag. These are comparatively smaller and easier to address than the other ones.
New issues¶
Before you create a new issue on GitHub, first discuss your ideas about the new feature or notify the bug on our appropriate Discord channels. Our contributors will interact with you and help you take it further.
Once the feature is approved or the bug is confirmed, based on your discussion with the contributors on our discord channel, create a new issue on GitHub. Please read the guidelines for creating a new issue.
Inactivity Period¶
If you have assigned the issue to yourself (existing or new), we request you to be active on your forked repository.
There might be a situation when you have other priorities or sometimes you might be taking a break, etc., wherein you may not be able to contribute to your forked repo for more than 3 weeks.
In such a case, we request you to just ping us on Discord and inform us about it also mentioning your inactivity period.
An inactivity of over 3 weeks in your repo or no discussion on Discord, without prior intimation, will be considered that you are no longer interested. In such a case the assignee name will be removed so that the issue can be solved by someone else. You are however free to assign it to yourself again when you are available, if the issue is not assigned to someone else.
Step 2: Fork Repository¶
The first step is to fork the repository so that you have your own repository in which you can work on.
Create a new branch (feature or bugfix) from the Develop branch and work on the newly created branch. This way if we make some changes to the Develop branch in our repo, you can upstream it at anytime for maintaining the updated codebase.
Step 3: Contribute¶
Once the branch created, you can start contributing (coding, documentation, test cases, etc.). Make sure that you follow the contributing guidelines.
We use GitHub Actions for continuous integrations that runs linting and testing operations.
There might be some changes to the original repository which will not reflect in your forked repository automatically. If you want to update it, sync it using the steps given in the link: https://help.github.com/articles/syncing-a-fork/
Step 4: Make a pull request¶
When you feel that you are ready to merge your contributions into our repository, create a pull request from your feature/bugfix branch to our Develop branch.
Select an appropriate label from the list E.g. enhancement, bug fix, etc.
Please go through the pull request guidelines.
Our reviewing team will review your pull request made and will interact with you by posting comments. You may be asked to modify incase there is any issue.
We request you to be active in responding to our comments so as to merge/close the issue.
Incase you do not respond to our comments within a week, we will close it. Feel free to open it again when you are ready to interact.
Contributing Guidelines¶
Follow the django coding style: https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/
If you are modifying or adding a feature then write unit test cases.
Avoid unnecessary modification of existing code. Ofcourse, you are free to optimize and resolve bugs.
Avoid duplication of code
Break your code/logic into different functions and add comments for better understanding.
If your contributions have some dependencies or they modify existing structure, then update the README.md file accordingly. Also feel free to add more documentation files.
Commit your code on a regular basis with meaningful commit messages.
Creating a new issue¶
Title¶
Enter a crisp and meaningful title.
Description¶
Describe your issue in details.
If its a bug or error provide animated image (gif) or screenshots supporting your issue and showing the problem.
If its a new feature which has changes in UI, provide wireframes that will help us visualize your suggested feature.
Mention an approximate time that will required for you to complete and make a pull request (Only for developers). You can ignore this if you are just reporting or suggesting.
Tag the issue appropriately, whether it belongs to ‘eSim’ or ‘Arduino’. Choose the type of issue ‘enhancement’, ‘bug’ etc.
Finally, mention ‘Assignee: @YourGitHubUsername’. This will let the community know that you are addressing this issue. You can ignore this if you are just reporting or suggesting.
Pull request¶
A pull request is one of the most essential parts of sharing your contributions with us. Please make sure that you read and follow the guidelines. This will help us in accepting the pull request easily.
Guidelines¶
Each pull request should be for a single feature or addressing a single problem only.
Avoid handling multiple features or bug fixes into one pull request.
Ensure that you create it for the appropriate branch only.
Write a brief description about your contribution and what problem does it solve. A pull request with good description is always appreciated and will be accepted easily.
Once the pull request is made, GitHub actions will show linting errors if any and the different test results. If all goes well then ‘All checks have passed’ will be displayed on your pull request. If any one fails, you can check the details and act accordingly.
Credits¶
eSim on the Cloud¶
Arduino on the Cloud¶
Arduino Frontend Guide¶
Serve on a Local Machine¶
Note: Required Node JS and Angular 7
For installing nodejs and npm visit ( https://nodejs.org/en/download/)
Open Command prompt (or powershell) and enter the following:
npm install -g @angular/cli ng --version
Without Docker¶
Please Follow the Steps.
Open Command promt
Navigate to folder dist/eSim-cloud/ArduinoFrontend/
Execute the following command to start Angular server:
ng serve
For more serve commands visit (https://angular.io/cli/serve)
To build the app and deploy your Angular application to a remote server:
ng build --prod
With Docker¶
Configuring Production Environment¶
Install Docker and docker-compose for server OS
git clone git@github.com:frg-fossee/eSim-Cloud.git && cd eSim-Cloud
cp .env .env.prod
(PLEASE CHANGE DEFAULT CREDENTIALS IN THE .env.prod FILE)docker-compose -f docker-compose.prod.yml --env-file .env.prod up --scale django=2 --scale celery=3 -d
Configuring Development Environment¶
Install docker-ce and docker-compose for your OS
To Build/ReBuild necessary containers using
docker-compose -f docker-compose.dev.yml build
( Please note these containers are only for dev environment, in production compiled files will be served by nginx)
To run arduino-frontend along with all backend containers
docker-compose -f docker-compose.dev.yml up arduino-frontend
Our Web Application is supported by the following browsers:
Google Chrome
Mozilla Firefox
Opera
Microsoft Edge
Safari