Skip to content

Commit ea11090

Browse files
authored
Merge pull request #63 from PythonBulawayo/develop
Update main with latest POC changes
2 parents 2985017 + 16ffbb1 commit ea11090

File tree

104 files changed

+12379
-8340
lines changed

Some content is hidden

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

104 files changed

+12379
-8340
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git/
2+
.idea/
3+
.vscode/
4+
.gitignore
5+
.venv/

.flake8

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E203
4+
ignore = D203, F722
5+
exclude =
6+
frontend/,
7+
.git,
8+
__pycache__,
9+
docs/source/conf.py,
10+
old,
11+
build,
12+
dist,
13+
venv,
14+
.venv,
15+
.env,
16+
migrations,
17+
addons,
18+
addons-dev,
19+
settings.py,
20+
max-complexity = 10

.github/workflows/backend_lint.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Backend_Pylint_Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- develop
8+
paths:
9+
- 'backend/**'
10+
push:
11+
branches:
12+
- main
13+
- develop
14+
paths:
15+
- 'backend/**'
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
python-version: ["3.8", "3.9", "3.10"]
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
- name: Install flake8
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install flake8
33+
working-directory: backend
34+
- name: Running flake8
35+
run: |
36+
flake8 .

.github/workflows/deploy.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Deploy Application
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Repository
11+
uses: actions/checkout@v3
12+
13+
- name: Setup SSH Keys
14+
run: |
15+
mkdir -p ~/.ssh
16+
echo "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_rsa
17+
chmod 600 ~/.ssh/id_rsa
18+
ssh-keyscan -t rsa ${{ secrets.VPS_IP }} >> ~/.ssh/known_hosts
19+
20+
- name: Deploy using Ansible
21+
run: ansible-playbook -i ansible/hosts --private-key ~/.ssh/id_rsa -u optimus ansible/deploy.yaml
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Front-end Eslint
2+
3+
on:
4+
push:
5+
branches: [ "main", "develop" ]
6+
paths:
7+
- 'frontend/**'
8+
pull_request:
9+
branches: [ "main", "develop" ]
10+
paths:
11+
- 'frontend/**'
12+
13+
jobs:
14+
build:
15+
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
node-version: [18.x]
21+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: 'npm'
30+
cache-dependency-path: frontend/package-lock.json
31+
32+
- name: Update npm
33+
working-directory: frontend
34+
run: npm install -g npm@latest
35+
- name: Install dependencies
36+
working-directory: frontend
37+
run : npm install
38+
- name: Lint code
39+
working-directory: frontend
40+
run: npm run lint
41+

.gitpod.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Image of workspace. Learn more: https://www.gitpod.io/docs/configure/workspaces/workspace-image
2+
image: gitpod/workspace-full:latest
3+
4+
# List the start up tasks. Learn more: https://www.gitpod.io/docs/configure/workspaces/tasks
5+
tasks:
6+
- name: Setup Backend
7+
before: cd backend
8+
command: python -m venv venv && source venv/bin/activate && pip install -r requirements.txt && python manage.py makemigrations && python manage.py migrate && python manage.py runserver
9+
- name: Create Superuser Account
10+
before: cd backend
11+
command: python manage.py createsuperuser
12+
- name: Setup Frontend
13+
before: cd frontend
14+
command: npm install && npm run dev
15+
16+
# List the ports to expose. Learn more: https://www.gitpod.io/docs/configure/workspaces/ports
17+
ports:
18+
- name: Frontend
19+
description: Port 5173 for the frontend
20+
port: 5173
21+
onOpen: open-browser
22+
- name: Open Backend
23+
description: Port 8000 for the frontend
24+
port: 8000
25+
onOpen: open-preview
26+
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MIT License
2+
3+
Copyright (c) 2024 PythonBulawayo
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)