Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 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
963a01c
Fix lint errors in Dealers.jsx
sjhallo07 Oct 21, 2025
8b4da23
chore: add duplicate-finder script and docker-compose for local dev i…
sjhallo07 Oct 22, 2025
9b92d57
chore: move find_duplicates.sh to repo root and remove duplicate
sjhallo07 Oct 22, 2025
8fa301b
chore: update docker-compose to use concrete build paths (server, ser…
sjhallo07 Oct 22, 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)
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
47 changes: 47 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: "3.8"
services:
mongo:
image: mongo:6
restart: unless-stopped
volumes:
- mongo-data:/data/db
ports:
- "27017:27017"

express-service:
build: ./server
restart: unless-stopped
environment:
- MONGO_URL=mongodb://mongo:27017/dealerships
depends_on:
- mongo
ports:
- "3000:3000"

sentiment:
# Placeholder image; replace with your sentiment service image or build path
image: your-sentiment-image-or-placeholder
# If you have a local Dockerfile for sentiment, replace the image line with:
# build: ./server/djangoapp/microservices/sentiment
ports:
- "8080:8080"

django:
build: ./server/djangoapp/microservices
command: >
sh -c "python manage.py migrate --noinput &&
python manage.py runserver 0.0.0.0:8000"
volumes:
- ./server/djangoapp/microservices:/app:cached
environment:
- DJANGO_SETTINGS_MODULE=project.settings
- DEALERS_SERVICE_URL=http://express-service:3000
- SENTIMENT_SERVICE_URL=http://sentiment:8080
ports:
- "8000:8000"
depends_on:
- express-service
- sentiment

volumes:
mongo-data:
62 changes: 62 additions & 0 deletions find_duplicates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
# Encuentra archivos duplicados por hash (md5) y lista sus rutas.
# Uso:
# ./find_duplicates.sh --check # solo informa
# ./find_duplicates.sh --delete # elimina duplicados dejando uno por hash (SÓLO USAR CON CAUTELA)
#
# Excluye node_modules, .git y venv por defecto.

set -euo pipefail

MODE="${1:---check}"
ROOT_DIR="${2:-.}"

TMPFILE=$(mktemp)
trap 'rm -f "$TMPFILE"' EXIT

echo "Generando hashes en $ROOT_DIR ..."
find "$ROOT_DIR" -type f \
! -path "*/node_modules/*" \
! -path "*/.git/*" \
! -path "*/venv/*" \
! -path "*/.venv/*" \
-print0 |
xargs -0 md5sum > "$TMPFILE"

echo "Buscando duplicados..."
awk '{ print $1 " " $2 }' "$TMPFILE" | sort | awk '
{
hash=$1; $1=""; path=substr($0,2);
a[hash]=a[hash] "||" path;
cnt[hash]++;
}
END {
for (h in cnt) {
if (cnt[h] > 1) {
n = split(a[h], arr, "||");
printf("DUP_HASH %s COUNT %d\n", h, cnt[h]);
for (i=1;i<=n;i++) if (length(arr[i])>0) print " " arr[i];
print "";
}
}
}
'

if [ "$MODE" = "--delete" ]; then
echo "MODO --delete: eliminando duplicados y conservando el primer archivo listado por hash."
awk '{ print $1 " " $2 }' "$TMPFILE" | sort | awk '
{
hash=$1; $1=""; path=substr($0,2);
if (!(hash in seen)) {
seen[hash]=path;
} else {
print path;
}
}' | while read -r dup; do
echo "Eliminando: $dup"
rm -v "$dup"
done
echo "Eliminación completada. Recomendado: revisar git status y confirmar."
else
echo "Modo de solo verificación (--check). Para eliminar duplicados ejecutar con --delete."
fi
62 changes: 62 additions & 0 deletions scripts/find_duplicates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
# Encuentra archivos duplicados por hash (md5) y lista sus rutas.
# Uso:
# ./scripts/find_duplicates.sh --check # solo informa
# ./scripts/find_duplicates.sh --delete # elimina duplicados dejando uno por hash (SÓLO USAR CON CAUTELA)
#
# Excluye node_modules, .git y venv por defecto.

set -euo pipefail

MODE="${1:---check}"
ROOT_DIR="${2:-.}"

TMPFILE=$(mktemp)
trap 'rm -f "$TMPFILE"' EXIT

echo "Generando hashes en $ROOT_DIR ..."
find "$ROOT_DIR" -type f \
! -path "*/node_modules/*" \
! -path "*/.git/*" \
! -path "*/venv/*" \
! -path "*/.venv/*" \
-print0 |
xargs -0 md5sum > "$TMPFILE"

echo "Buscando duplicados..."
awk '{ print $1 " " $2 }' "$TMPFILE" | sort | awk '
{
hash=$1; $1=""; path=substr($0,2);
a[hash]=a[hash] "||" path;
cnt[hash]++;
}
END {
for (h in cnt) {
if (cnt[h] > 1) {
n = split(a[h], arr, "||");
printf("DUP_HASH %s COUNT %d\n", h, cnt[h]);
for (i=1;i<=n;i++) if (length(arr[i])>0) print " " arr[i];
print "";
}
}
}
'

if [ "$MODE" = "--delete" ]; then
echo "MODO --delete: eliminando duplicados y conservando el primer archivo listado por hash."
awk '{ print $1 " " $2 }' "$TMPFILE" | sort | awk '
{
hash=$1; $1=""; path=substr($0,2);
if (!(hash in seen)) {
seen[hash]=path;
} else {
print path;
}
}' | while read -r dup; do
echo "Eliminando: $dup"
rm -v "$dup"
done
echo "Eliminación completada. Recomendado: revisar git status y confirmar."
else
echo "Modo de solo verificación (--check). Para eliminar duplicados ejecutar con --delete."
fi
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