Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
31a38d8
updates
sjhallo07 Oct 11, 2025
5f82fec
Implement user registration, login, logout, and frontend integration.…
sjhallo07 Oct 11, 2025
6101eb6
Frontend and backend registration, login, logout, manifest and routin…
sjhallo07 Oct 11, 2025
7b49452
Add CarMake and CarModel models, register in admin, implement get_car…
sjhallo07 Oct 12, 2025
794b5b5
Update populate.py to add CarMake and CarModel sample data
sjhallo07 Oct 12, 2025
fcebb7a
Update car make descriptions in populate.py and settings.py
sjhallo07 Oct 13, 2025
c21324a
Update car make descriptions in populate.py
sjhallo07 Oct 13, 2025
95d2f71
Your descriptive commit message here
sjhallo07 Oct 13, 2025
e8eafec
Update: frontend routes, Django URLs, bug fixes, and .env backend URL
sjhallo07 Oct 14, 2025
dbb39d3
Update README: author Marcos Mora
sjhallo07 Oct 14, 2025
d654fc4
puntos finales de API usando Express-Mongo
sjhallo07 Oct 16, 2025
769f0f3
Update frontend dependencies for build and scripts
sjhallo07 Oct 16, 2025
2fc032d
feat: PostReview make/model selects; seed and populate fixes; express…
sjhallo07 Oct 18, 2025
274e6f4
Add GitHub Actions workflow for linting Python and JS
sjhallo07 Oct 18, 2025
1534deb
Add GitHub Actions workflow for linting Python and JS
sjhallo07 Oct 18, 2025
41b8664
Initial plan
Copilot Oct 18, 2025
a42f439
Add .jshintrc config and update workflow to exclude node_modules
Copilot Oct 18, 2025
b4f361e
Initial plan
Copilot Oct 18, 2025
5de6a42
Fix flake8 linting errors in server/djangoproj/urls.py
Copilot Oct 18, 2025
16dce1c
update dockerfile and yml
sjhallo07 Oct 18, 2025
6b56120
Add Dockerfile, deployment.yaml and entrypoint script
sjhallo07 Oct 18, 2025
b2a97f8
Initial plan
Copilot Oct 19, 2025
128af98
Fix GitHub Actions workflow: update action versions, add caching, fix…
Copilot Oct 19, 2025
069f1bc
Update PostReview.jsx with new content
sjhallo07 Oct 19, 2025
37c93a4
Merge pull request #2 from sjhallo07/copilot/fix-linting-errors-urls-…
sjhallo07 Oct 19, 2025
1c92cff
Merge pull request #1 from sjhallo07/copilot/add-jshint-config-and-up…
sjhallo07 Oct 19, 2025
f17d539
Merge branch 'main' into copilot/fix-github-actions-workflow
sjhallo07 Oct 19, 2025
323defd
Update .github/workflows/main.yml
sjhallo07 Oct 19, 2025
c5b1046
Update .github/workflows/main.yml
sjhallo07 Oct 19, 2025
485d8c5
Update .github/workflows/main.yml
sjhallo07 Oct 19, 2025
2fdc6a3
Update .github/workflows/main.yml
sjhallo07 Oct 19, 2025
2431d7d
Merge pull request #3 from sjhallo07/copilot/fix-github-actions-workflow
sjhallo07 Oct 19, 2025
17a1bde
Add Docker Image CI workflow
sjhallo07 Oct 21, 2025
68cebaa
Change ICR_NAMESPACE to specific repository
sjhallo07 Oct 21, 2025
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
  •  
  •  
  •  
18 changes: 18 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
75 changes: 75 additions & 0 deletions .github/workflows/ibm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This workflow will build a docker container, publish it to IBM Container Registry, and deploy it to IKS when there is a push to the "main" branch.
#
# To configure this workflow:
#
# 1. Ensure that your repository contains a Dockerfile
# 2. Setup secrets in your repository by going to settings: Create ICR_NAMESPACE and IBM_CLOUD_API_KEY
# 3. Change the values for the IBM_CLOUD_REGION, REGISTRY_HOSTNAME, IMAGE_NAME, IKS_CLUSTER, DEPLOYMENT_NAME, and PORT

name: Build and Deploy to IKS

on:
push:
branches: [ "main" ]

# Environment variables available to all jobs and steps in this workflow
env:
GITHUB_SHA: ${{ github.sha }}
IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY }}
IBM_CLOUD_REGION: us-south
ICR_NAMESPACE: ${{ us.icr.io/sn-labs-abreu760 }}
REGISTRY_HOSTNAME: us.icr.io
IMAGE_NAME: iks-test
IKS_CLUSTER: example-iks-cluster-name-or-id
DEPLOYMENT_NAME: iks-test
PORT: 5001

jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
environment: production
steps:

- name: Checkout
uses: actions/checkout@v4

# Download and Install IBM Cloud CLI
- name: Install IBM Cloud CLI
run: |
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
ibmcloud --version
ibmcloud config --check-version=false
ibmcloud plugin install -f kubernetes-service
ibmcloud plugin install -f container-registry

# Authenticate with IBM Cloud CLI
- name: Authenticate with IBM Cloud CLI
run: |
ibmcloud login --apikey "${IBM_CLOUD_API_KEY}" -r "${IBM_CLOUD_REGION}" -g default
ibmcloud cr region-set "${IBM_CLOUD_REGION}"
ibmcloud cr login

# Build the Docker image
- name: Build with Docker
run: |
docker build -t "$REGISTRY_HOSTNAME"/"$ICR_NAMESPACE"/"$IMAGE_NAME":"$GITHUB_SHA" \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" .

# Push the image to IBM Container Registry
- name: Push the image to ICR
run: |
docker push $REGISTRY_HOSTNAME/$ICR_NAMESPACE/$IMAGE_NAME:$GITHUB_SHA

# Deploy the Docker image to the IKS cluster
- name: Deploy to IKS
run: |
ibmcloud ks cluster config --cluster $IKS_CLUSTER
kubectl config current-context
kubectl create deployment $DEPLOYMENT_NAME --image=$REGISTRY_HOSTNAME/$ICR_NAMESPACE/$IMAGE_NAME:$GITHUB_SHA --dry-run -o yaml > deployment.yaml
kubectl apply -f deployment.yaml
kubectl rollout status deployment/$DEPLOYMENT_NAME
kubectl create service loadbalancer $DEPLOYMENT_NAME --tcp=80:$PORT --dry-run -o yaml > service.yaml
kubectl apply -f service.yaml
kubectl get services -o wide
145 changes: 145 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
name: 'CI Pipeline'

'on':
push:
branches: [master, main]
pull_request:
branches: [master, main]

env:
CI: true
NODE_VERSION: '20'
PYTHON_VERSION: '3.12'

jobs:
lint_python:
name: Lint Python Files
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
cache-dependency-path: server/requirements.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8

- name: Print working directory
run: pwd

- name: Run Linter
run: |
pwd
# Find all Python files recursively and run flake8 on them
find . -name "*.py" -exec flake8 {} +
echo "Linted all the python files successfully"

lint_js:
name: Lint JavaScript Files
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install JSHint
run: npm install jshint --global

- name: Run Linter
run: |
# Find all JavaScript files and run JSHint on them
find ./server/database -name "*.js" -exec jshint {} +
echo "Linted all the js files successfully"

build_frontend:
name: Build and Test Frontend
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: server/frontend/package-lock.json

- name: Install dependencies
working-directory: ./server/frontend
run: npm ci

- name: Run tests
working-directory: ./server/frontend
run: npm test -- --watchAll=false --passWithNoTests
# TODO: Remove continue-on-error once tests are implemented
continue-on-error: true

- name: Build application
working-directory: ./server/frontend
run: npm run build

build_database:
name: Build and Test Database Service
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: server/database/package-lock.json

- name: Install dependencies
working-directory: ./server/database
run: npm ci

- name: Run tests (if available)
working-directory: ./server/database
run: npm test || echo "No tests specified yet"

test_python:
name: Test Python Django App
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
cache-dependency-path: server/requirements.txt

- name: Install dependencies
working-directory: ./server
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run Django tests
working-directory: ./server
run: python manage.py test
# TODO: Remove continue-on-error once tests are implemented
continue-on-error: true
4 changes: 4 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"node": true,
"esversion": 8
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# coding-project-template
# coding-project-template

**Author:** Marcos Mora
25 changes: 25 additions & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM python:3.12.0-slim-bookworm

ENV PYTHONBUFFERED 1
ENV PYTHONWRITEBYTECODE 1

ENV APP=/app

# Change the workdir.
WORKDIR $APP

# Install the requirements
COPY requirements.txt $APP

RUN pip3 install -r requirements.txt

# Copy the rest of the files
COPY . $APP

EXPOSE 8000

RUN chmod +x /app/entrypoint.sh

ENTRYPOINT ["/bin/bash","/app/entrypoint.sh"]

CMD ["gunicorn", "--bind", ":8000", "--workers", "3", "djangoproj.wsgi"]
Loading