Skip to content

Commit 333cbc3

Browse files
committed
initial init
1 parent dabe4b6 commit 333cbc3

File tree

351 files changed

+32953
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

351 files changed

+32953
-0
lines changed

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
/dist
14+
15+
# misc
16+
.DS_Store
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*

Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM python:3.9.1
2+
3+
ENV PYTHONUNBUFFERED=1
4+
WORKDIR /usr/src/app
5+
COPY ./server/ ./
6+
RUN pip install -r requirements.txt
7+
RUN chmod +x ./entrypoint.sh

README.md

+57

docker-compose.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version : "3.8"
2+
3+
services:
4+
localserver:
5+
build: .
6+
container_name: localserver
7+
command: ./server/entrypoint.sh
8+
volumes:
9+
- .:/usr/src/app
10+
ports:
11+
- "8000:8000"
12+
depends_on:
13+
- db
14+
- redis
15+
16+
db:
17+
image: postgres
18+
container_name: db
19+
environment:
20+
- POSTGRES_DB=JETGESTDB
21+
- POSTGRES_USER=postgres
22+
- POSTGRES_PASSWORD=DBserver
23+
24+
redis:
25+
image: "redis:alpine"
26+
container_name: redis

lerna.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"packages": [
3+
"packages/*"
4+
],
5+
"npmClient": "yarn",
6+
"useWorkspaces": true,
7+
"version": "1.0.2"
8+
}

package.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "jetgest",
3+
"version": "1.0.0",
4+
"private": true,
5+
"description": "Jetgest Business Management app",
6+
"workspaces": [
7+
"packages/app"
8+
],
9+
"scripts": {
10+
"dev": "concurrently \"docker compose up\" \"wait-on http://localhost:8000/admin && lerna run start --scope=gestion-app\"",
11+
"dev:electron": "concurrently \"docker compose up\" \"wait-on http://localhost:8000/admin && lerna run electron:dev --scope=gestion-app\""
12+
},
13+
"author": "Walid Salah",
14+
"devDependencies": {
15+
"concurrently": "^6.2.0",
16+
"lerna": "^4.0.0",
17+
"wait-on": "^6.0.0"
18+
}
19+
}

packages/app/.env.electron

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_MODE=electron

packages/app/.env.web

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_MODE=web

packages/app/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
/dist
14+
15+
# misc
16+
.DS_Store
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*

packages/app/.vscode/launch.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "pwa-chrome",
9+
"request": "launch",
10+
"name": "Launch Chrome against localhost",
11+
"url": "http://localhost:3000",
12+
"webRoot": "${workspaceFolder}"
13+
}
14+
]
15+
}

packages/app/README.md

+3
2.12 KB
5.93 KB
2.58 KB
4.12 KB
4.08 KB

packages/app/assets/images/bank.png

1.29 KB

packages/app/assets/images/bareme.png

2.22 KB
5.8 KB
6.08 KB
6.26 KB

packages/app/assets/images/book.png

1.35 KB

packages/app/assets/images/btree.png

3.91 KB
914 Bytes

packages/app/assets/images/castle.png

1014 Bytes
858 Bytes

packages/app/assets/images/close.png

3.5 KB

packages/app/assets/images/copy.png

1.87 KB

packages/app/assets/images/cut.png

1.1 KB
6.08 KB

packages/app/assets/images/dollar.png

955 Bytes

packages/app/assets/images/entry.png

2.84 KB
5.81 KB
5.9 KB

packages/app/assets/images/folder.png

904 Bytes

packages/app/assets/images/gears.png

5.4 KB

packages/app/assets/images/home.png

1011 Bytes

packages/app/assets/images/house.png

823 Bytes
2.62 KB

packages/app/assets/images/letter.png

796 Bytes
7.37 KB

packages/app/assets/images/outie.png

3 KB

packages/app/assets/images/paste.png

809 Bytes
1.89 KB
852 Bytes

packages/app/assets/images/pin.png

5.19 KB
916 Bytes
7.9 KB
4.86 KB

packages/app/assets/images/save.png

6.41 KB
10.1 KB
1.23 KB

packages/app/assets/images/sigma.png

1.76 KB

packages/app/assets/images/sql.png

5.44 KB

packages/app/assets/images/stats.png

7.27 KB

packages/app/assets/images/steps.png

1.79 KB
2.92 KB
2.64 KB
3.01 KB
2.15 KB
1.99 KB
1.99 KB
2.16 KB
1.96 KB
2.73 KB
2.37 KB
2 KB
2.06 KB
1.92 KB
1.19 KB

packages/app/capacitor.config.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"appId": "com.jetlight.jetgest",
3+
"appName": "gestion-app",
4+
"bundledWebRuntime": false,
5+
"npmClient": "npm",
6+
"webDir": "build",
7+
"cordova": {}
8+
}

packages/app/craco.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
let target = 'web';
2+
if (process.env.REACT_APP_MODE === 'electron') {
3+
target = 'electron-renderer'
4+
}
5+
console.log(`craco.config.js: setting webpack target to: ${target}`);
6+
7+
module.exports = {
8+
webpack: {
9+
configure: {
10+
target: target
11+
}
12+
}
13+
};

packages/app/electron/main.ts

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import { app, BrowserWindow } from 'electron';
2+
import * as path from 'path';
3+
import * as isDev from 'electron-is-dev';
4+
import installExtension, { REACT_DEVELOPER_TOOLS } from "electron-devtools-installer";
5+
import createMenu from './menu';
6+
7+
export let win: BrowserWindow | null = null;
8+
let modalWin: BrowserWindow | null = null;
9+
10+
function createWindow() {
11+
win = new BrowserWindow({
12+
width: 1024,
13+
height: 900,
14+
webPreferences: {
15+
nodeIntegration: true,
16+
contextIsolation: false,
17+
preload: __dirname + "/preload.js"
18+
}
19+
})
20+
21+
modalWin = new BrowserWindow({
22+
width: 1100,
23+
height: 950,
24+
parent: win,
25+
modal: true,
26+
show: false,
27+
minimizable: false,
28+
maximizable: true,
29+
movable: true,
30+
webPreferences: {
31+
nodeIntegration: true,
32+
contextIsolation: false
33+
}
34+
});
35+
36+
modalWin.setMenu(null);
37+
38+
win.webContents.on('new-window', async (event, url) => {
39+
event.preventDefault();
40+
await modalWin?.loadURL("about:blank");
41+
console.log(url);
42+
modalWin?.loadURL(url);
43+
modalWin?.show();
44+
})
45+
46+
if (isDev) {
47+
win.loadURL('http://localhost:3000/');
48+
} else {
49+
// 'build/index.html'
50+
win.loadURL(`file://${__dirname}/../index.html`);
51+
}
52+
53+
win.on('closed', () => { win = null; modalWin = null});
54+
modalWin.on('close', (event) => { event.preventDefault(); modalWin?.hide();});
55+
56+
win.setMenu(createMenu(win));
57+
58+
// Hot Reloading
59+
if (isDev) {
60+
// 'node_modules/.bin/electronPath'
61+
require('electron-reload')(__dirname, {
62+
electron: path.join(__dirname, '..', '..', 'node_modules', '.bin', 'electron'),
63+
forceHardReset: true,
64+
hardResetMethod: 'exit'
65+
});
66+
}
67+
68+
// DevTools
69+
installExtension(REACT_DEVELOPER_TOOLS)
70+
.then((name) => console.log(`Added Extension: ${name}`))
71+
.catch((err) => console.log('An error occurred: ', err));
72+
73+
if (isDev) {
74+
win.webContents.openDevTools();
75+
}
76+
}
77+
78+
app.on('ready', createWindow);
79+
80+
app.on('window-all-closed', () => {
81+
if (process.platform !== 'darwin') {
82+
app.quit();
83+
}
84+
});
85+
86+
app.on('activate', () => {
87+
if (win === null) {
88+
createWindow();
89+
}
90+
});

0 commit comments

Comments
 (0)