Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

-----------

Overall architecture

Image RemovedImage Added



Server layout

Info

The flask web service is started by the following uwsgi command.


(py3env) [ec2-user@ip-172-31-2-230 seisfinder2]$ cat webservice-ec2.sh
#!/bin/bash
#sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 5000
/home/ec2-user/py3env/bin/uwsgi --http :5000 --http-websockets --plugin-dir ./ --plugins python37,gevent37 --gevent 1000 --mount /=webservice:sfapp --master --socket /run/seistech.sock --chmod-socket=777 --vacuum --die-on-term


This creates a socket /run/seistech.sock, and Nginx monitors this socket file to route the traffic from port 5000 to port 443. See the line marked with ( *) below from Nginx configuration.


/etc/nginx/nginx.conf
...
server {
    listen 80;
    server_name seistech.nz www.seistech.nz;
    return 301 <https://seistech.nz$request_uri;>
 }

server {
    listen 80;
    server_name eap.seistech.nz;
    return 301 <https://eap.seistech.nz$request_uri;>
}
# Settings for a TLS enabled server.
server {
    listen       443 ssl http2 default_server;
    listen       [::]:443 ssl http2 default_server;
    server_name  seistech.nz,www.seistech.nz;
    root         /usr/share/nginx/html;
	ssl_certificate "/etc/letsencrypt/archive/seistech.nz/fullchain1.pem";
	ssl_certificate_key "/etc/letsencrypt/archive/seistech.nz/privkey1.pem";
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  10m;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_serve
    # Load configuration files for the default server block.r_ciphers on;
    include /etc/nginx/default.d/*.conf;

    location / {
        rewrite /(.+) /$1 break;
	    include uwsgi_params;
    	uwsgi_pass unix:/run/seistech.sock;  ----------------- (*)
    }
}
server {
    listen       443 ssl http2 ;
    listen       [::]:443 ssl http2 ;
    server_name  eap.seistech.nz;
    root         /usr/share/nginx/html;
    ssl_certificate "/etc/letsencrypt/archive/seistech.nz/fullchain1.pem";
    ssl_certificate_key "/etc/letsencrypt/archive/seistech.nz/privkey1.pem";
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  10m;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;
    include /etc/nginx/default.d/*.conf;

    location / {
        rewrite /(.+) /$1 break;
        include uwsgi_params;
        uwsgi_pass unix:/run/seistech_5001.sock;
    }
}

...

SeisTech_New_Order


Questions





Do we charge for each IM for the same location? (ie. different order for an IM?)

Simplest implementation will be checking the particular combination of data (userID, location, service details ) has a purchase history match. If yes, free of charge. Otherwise, proceed to Order.

Initially we focus on "products" - disaggregation and gm selection. Where user can freely play with various parameters without extra charge once purchased


Bulk order discount? If user wants all IMs? Do we set maximum threshold that gives everything?

Simplest implementation will be setting a maximum threshold for a project and charges $0 once the threshold exceeds.

Academic users can have maximum threshold = 0

Monetisation scheme will be further explored later.


If a user-specified location is snapped to one location that matches an existing project : Should we merge this project to the existing one? (free of charge?)

Simpler to merge to an existing project, but less revenue.

Seems unfair to the end-user client who paid the money, while other end-user clients employing the same consultant getting free-ride.

We charge again. Each project is linked to user-specified location (not snapped one, without detailed info of snapped one omitted).


ER Diagram



Next Steps

  • Reach an agreement on the architecture design
  • Identify modules and separate them
  • Determine input and output interface and document : Follow comment standards
  • Implement DB and basic skeleton

...