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

Dev #6

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 18 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,41 @@
version: 2.1
orbs:
node: circleci/[email protected]
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs

jobs:
setup:
docker:
- image: cimg/base:stable

working_directory: ~/jobs-data-analyzer/JDA-12/v1

steps:
- checkout:
path: ~/jobs-data-analyzer
- node/install-packages:
app-dir: JDA-12/v1
cache-only-lockfile: true
check-cache: never
include-branch-in-cache-key: true
pkg-manager: npm
with-cache: true
- run:
command: ls -a ./ && npm ci
name: check and install


build:
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
- image: cimg/base:stable
# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps

working_directory: ~/jobs-data-analyzer/JDA-12

steps:
- checkout
- checkout:
path: ~/jobs-data-analyzer
- run:
name: "checks"
command: "echo $(python --version)"
name: install python
command: sudo apt-get install python && python --version

# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
build:
jobs:
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/python-package-conda.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ __pycache__/
*$py.class


.env
node_modules/
node_modules

Expand Down
1 change: 1 addition & 0 deletions .pyenv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.7.12
11 changes: 11 additions & 0 deletions APIs/exp-API/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# JDA - API

API to parsed data.
Runs on independent server.

## Running

Go to `JDA` folder and run `npm start` <br/>
It will launch this `api` server before launching the `frontend` server.

READ JDA/servers.md for other launch methods
File renamed without changes.
94 changes: 94 additions & 0 deletions APIs/exp-API/bin/www
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/usr/bin/env node
require('dotenv').config();

/**
* Module dependencies.
*/

var app = require('../app');
var debug = require('debug')('api:server');
var http = require('http');

/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.API_PORT);
app.set('port', port);

/**
* Create HTTP server.
*/

var server = http.createServer(app);

/**
* Listen on provided port, on all network interfaces.
*/

server.listen(port);
server.on('error', onError);
server.on('listening', onListening);

/**
* Normalize a port into a number, string, or false.
*/

function normalizePort(val) {
var port = parseInt(val, 10);

if (isNaN(port)) {
// named pipe
return val;
}

if (port >= 0) {
// port number
return port;
}

return false;
}

/**
* Event listener for HTTP server "error" event.
*/

function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}

var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;

// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}

/*
* Port info message
* */
console.log("Step 1: Go to http://localhost:"+process.env.API_PORT+"/api");
/**
* Event listener for HTTP server "listening" event.
*/

function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
}
File renamed without changes.
17 changes: 9 additions & 8 deletions JDA-12/data-API/routes/api.js → APIs/exp-API/routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ var last_six_months = function()

for( var i = 0; i < YEAR.length/2; i++ )
{
prev_month -= i ;
prev_month = ( YEAR.length + prev_month ) % YEAR.length;
prev_month = ( YEAR.length + (curr_month - i) ) % YEAR.length;
months.push({
'month': YEAR[ prev_month ],
'year': ( prev_month < 0 ) ? ( curr_year - 1 ) : curr_year
'year': ((curr_month - i) < curr_month) ? (curr_year - 1) : curr_year
});
}
return months;
Expand All @@ -33,9 +32,11 @@ var last_six_months = function()
router.get(['/data','/jobs'], function(req, res, next)
{
var months = last_six_months();
var sample_months = [ 'Jan', 'Dec', 'Nov', 'Oct', 'Sept', 'Aug' ];
sample_months.reverse();
const MAX = 40;
var six_months = [];

months.forEach(function( element ){ six_months.unshift( element.month ); });

const MAX = 200000;

var job_queries = [ 'Software Engineer', 'Support Engineer', 'Dev-Ops'];

Expand Down Expand Up @@ -71,7 +72,7 @@ router.get(['/data','/jobs'], function(req, res, next)
title:{ text: job_queries[0] + ' demand.' },
tooltip: { },
legend: { data: ['Applications'] },
xAxis: { data: sample_months },
xAxis: { data: six_months },
yAxis: { },
series: [
{
Expand Down Expand Up @@ -124,7 +125,7 @@ router.get(['/data','/jobs'], function(req, res, next)
title:{ text: job_queries[1] + ' demand.' },
tooltip: { },
legend: { data: ['Applications'] },
xAxis: { data: sample_months },
xAxis: { data: six_months },
yAxis: { },
series: [
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions APIs/py-API/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import uvicorn
from fastapi import FastAPI

api = FastAPI()

from py-API import security
import views
6 changes: 6 additions & 0 deletions APIs/py-API/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from fastapi import Request, HTTPException, Depends
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from fastapi.responses import HTMLResponse, PlainTextResponse
from db import crud, models, schemas, get_db
from
6 changes: 3 additions & 3 deletions JDA-12/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

&nbsp;&nbsp;&nbsp;&nbsp; Everything related to visualization. <br />

<<<<<<< HEAD
<span>
<img width="400" src="../piechart.png">
<img width="400" src="../barchart.png">
Expand Down Expand Up @@ -165,7 +164,9 @@ When running from a `poetry` activated (`JDA`) `virtualenv` set the flask variab
2. Build dashboard to visualize jobs data from `db`, integrate with results from `4`:`ec2` above
3. Testing, testing, some more testing
4. Machine learning. See `4` above.

=======

&nbsp;&nbsp;&nbsp;&nbsp; [References issue JDA-12](https://solvestack.atlassian.net/browse/JDA-12?atlOrigin=eyJpIjoiZjMzZjNkNjBjMTIxNDYyNGJmZWJiZDc0MmU2YzY4OTciLCJwIjoiaiJ9)

## Tableau WebApp with Flask backend
Expand All @@ -192,5 +193,4 @@ password: yourpassword

- `Flask`
- `Tableau` ( `Rest API` and `JS API` )
- `HTML / CSS / JS`
>>>>>>> 445d259 (JDA-12 Create seperate folder for JDA-12)
- `HTML / CSS / JS`
2 changes: 1 addition & 1 deletion JDA-12/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def jobs(self):
jda.config['FLASK_ADMIN_SWATCH'] = 'cerulean'
admin = Admin(jda, name='JDA', template_mode='bootstrap3')

from JDA-12 import models, views
from ./ import models, views

if __name__ == "__main__":
jda.run(debug=True)
Expand Down
12 changes: 0 additions & 12 deletions JDA-12/data-API/README.md

This file was deleted.

File renamed without changes.
5 changes: 5 additions & 0 deletions JDA-12/data-API/config/project 2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project = {
'name': 'Jobs Data API',
'db':{ 'HOST': 'HOST', 'USER': 'USER', 'URI': 'URI' }
}
module.exports = project;
1 change: 0 additions & 1 deletion JDA-12/data-API/node_modules/.bin/mime

This file was deleted.

Loading