Structure101 Soda Dependency Database provides a REST API to a database of codebase dependencies.
984
Maintained by: Structure101
Where to get help: [email protected]
Structure101 is a software architecture platform that bridges the architect/programmer divide to deliver the benefits of well-structured codebases with defined and communicated architecture.

In the event your network restricts access to Docker Hub you must first download the following required images before following our Docker instructions below:
soda-server: https://s101-pickup.s3.amazonaws.com/generic/masterv7/soda-server.tar
soda-client: https://s101-pickup.s3.amazonaws.com/generic/masterv7/soda-client.tar
postgres-15-alpine: https://s101-pickup.s3.amazonaws.com/generic/masterv7/postgres-15-alpine.tar
Once downloaded, use the docker load command to bring up the images in Docker Desktop.
docker load --input soda-server.tar soda-client.tar postgres-15-alpine.tar
For the ease of usage its recommended to install Docker Desktop for your respective OS: https://www.docker.com/products/docker-desktop/
Also make sure that the docker-compose command is working as expected (if you are going to use docker compose for orchestration).
https://docs.docker.com/engine/reference/commandline/compose/
Create a directory named soda and under it create the following files:
The contents of the above required files are outlined below.
1] Inside the .env file, add the following content with the appropriate configuration. The explanation of each of the variables is given at the end of this Readme:
#
# db
#
PORT=8001
DB_PORT=5432
DB_NAME='sodadb'
DB_USER='soda'
DB_PASS='pass'
# (For Linux-based systems, use: DB_IP='172.17.0.1')
DB_IP='host.docker.internal'
DB_SCHEMA='s101_20230112'
#
# general
#
DB_DIALECT='postgres'
DB_VERSION=21194
#
# Cache
#
CACHE_ENABLED='False'
CACHE_SIZE=48
CORS_WHITELIST=[]
DB_LIMIT=200000
RS_LIMIT=10000
The configuration of the .env depends on the use case. For example, you may already a database that you want to use, in which case, configure the DB_* parameters accordingly.
Note: The .env file format is dependent on your operating system. On Windows you must use single quotes around each string variable, e.g. DB_NAME='sodadb' & DB_IP='172.17.0.1' etc. While on Linux, single quotes are not required, only the values are needed, e.g. DB_NAME=sodadb & DB_IP=172.17.0.1
2] Inside the docker-compose file, add the following:
version: '3'
services:
sodaserver:
container_name: soda-server
image: structure101/soda-server
restart: always
env_file:
- .env
depends_on:
- db
sodaclient:
container_name: soda-client
image: structure101/soda-client
restart: always
depends_on:
- sodaserver
ports:
- 80:80
db:
image: postgres:15-alpine
environment:
- POSTGRES_HOST=${HOST}
- POSTGRES_PORT=${PORT}
- POSTGRES_USER=${USER}
- POSTGRES_PASSWORD=${PASSWORD}
- POSTGRES_DB=${DB}
volumes:
- ./data:/var/lib/postgresql/data
ports:
- ${PORT}:5432
3] Now run one of the following commands to start the Structure101 Soda Dependency Database Docker containers:
4] You should now have a running Docker containers with 3 services:
docker pull to save the docker hub images on your machine as follows
1] Create a soda-db.properties file with the following properties set appropriately:
dburl=jdbc:postgresql://localhost:5432/sodadb?currentSchema=s101_20230112
dbuser=soda
dbpwd=pass
2] Then create a structure101-build-conf.xml with the following arguments set appropriately:
<?xml version="1.0" encoding="UTF-8"?>
<headlessversion="1.0">
<arguments>
<argumentname="repository" value="const(THIS_FILE)/soda-db.properties"/>
<argumentname="project" value="my-project"/>
<argumentname="label" value="1.0"/>
<argumentname="local-project" value="const(THIS_FILE)/my-project.cpa.hsp">
</argument>
</arguments>
<!-- OPERATIONS TO EXCEUTE -->
<operations>
<!-- PUBLISH OPERATION -->
<operationtype="publish"></operation>
</operations>
</headless>
Note: Structure101 has 4 primary parsers: C/C++ (cpa), C# (dotnet), Java (java), and a Generic (gen) language parser with support for Javascript/Typescript and Python. The build configuration file above and the command used below to run the publish command use C/C++ as an example. If you are not working with C/C++ (cpa) please replace the occurrences of cpa in the configuration file above, and command below, with the appropriate parser string.
3] Finally run the following publish command:
java -jar structure101-cpa-build.jar structure101-build-conf.xml
4] For more on Structure101 Build publishing please see the Structure101 Help here. If using Structure101 for Clang C/C++ remember to also publish your function hashcodes and C++ attributes using the publish-cpa-attributes operation.
1] Simply run the following command (using the Structure101 Build jar for your preferred programming language):
java -cp structure101-java-build.jar com.structure101.headless.S101HeadlessCmdRunner db-import-from-repository -repository=/my-respositories/my-repo -dbid=0000
docker-compose up command as 5433 HOST=172.17.0.1 PORT=5433 USER=soda PASSWORD=pass DB=sodadb docker-compose up and then you will change the same in .env file for DB_PORT, and in soda.properties file the string will be changed to something like dburl=jdbc:postgresql://localhost:5433/sodadb?currentSchema=s101_20230112Generate respective certificates. How To Create a Self-Signed SSL Certificate for Nginx Modify your nginx configuration as follows:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
server {
listen 443 ssl;
server_name localhost;
ssl_certificate /etc/nginx/certs/nginx.crt;
ssl_certificate_key /etc/nginx/certs/nginx.key;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location ~ ^/(api|api-docs)/ {
proxy_pass http://172.17.0.1:8001;
proxy_read_timeout 1800;
proxy_connect_timeout 1800;
proxy_send_timeout 1800;
send_timeout 1800;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}
Modify the sodaclient section in docker-compose as follows:
sodaclient:
container_name: soda-client
image: structure101/soda-client
restart: always
depends_on:
- sodaserver
ports:
- 80:80
- 443:443
volumes:
- ./cert:/etc/nginx/certs/
- ./nginx.conf:/etc/nginx/nginx.conf
Above we are mounting the certificates and updating nginx.conf files as per our needs.
Content type
Image
Digest
sha256:116f70571…
Size
99.3 MB
Last updated
about 2 years ago
docker pull structure101/soda-server