Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2fe605f
[refactor/PPFR-1]: changed logo and title
ignatKupryashin Jun 22, 2025
e3388c3
[refactor/PPFR-1]: change buttons to antd
ignatKupryashin Jun 22, 2025
a0c65b8
[refactor/PPFR-1]: chaged routers
ignatKupryashin Jun 22, 2025
1cd14c5
[refactor/PPFR-1]: changed structure and imports
ignatKupryashin Jun 22, 2025
36b521e
Merge pull request #13 from PrettyPet-Organization/refactor/PPFR-1-re…
ignatKupryashin Jun 22, 2025
80292e0
[feature/PPF-5]: created layout
ignatKupryashin Jun 22, 2025
922d2f9
added layout. started to create navigation
ignatKupryashin Jun 29, 2025
e0b99f7
created Authorized routes
ignatKupryashin Jun 29, 2025
0b38cbc
styled desktop
ignatKupryashin Jul 21, 2025
3abbbbc
created mobile layput. not styled
ignatKupryashin Jul 21, 2025
6d7b7e5
[PPF-5] finished with authorized mobile layout
ignatKupryashin Jul 24, 2025
59bf4c3
Merge pull request #16 from PrettyPet-Organization/feature/ppf-5-auth…
ignatKupryashin Jul 24, 2025
714373a
[PPF-11] created http client
ignatKupryashin Aug 2, 2025
cb09dea
[PPF-11] changed default url
ignatKupryashin Aug 2, 2025
bd87ba8
Merge pull request #17 from PrettyPet-Organization/feature/ppf-11-http
ignatKupryashin Aug 2, 2025
5c87a0b
feat: create nginx conf for ci/cd deployment
nsvk13 Aug 4, 2025
3b67478
ci: initial linter job for ci/cd pipeline
nsvk13 Aug 4, 2025
6bef1b4
ci: initial build job for ci/cd pipeline
nsvk13 Aug 4, 2025
9fa4b03
ci: initial deploy job for ci/cd pipeline
nsvk13 Aug 4, 2025
61b9e73
feat: add Dockerfile with nginx and multi-stage build
nsvk13 Aug 4, 2025
bb7418f
feat: add docker-compose configuration for production
nsvk13 Aug 4, 2025
1bd841e
feat: add .dockerignore to optimize build context
nsvk13 Aug 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
dist
.dockerignore
Dockerfile
docker-compose.yml
.git
.gitlab-ci.yml
*.log
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build

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

jobs:
build:
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-files-${{ github.sha }}
path: dist/
retention-days: 7

- name: Build summary
run: |
echo "✅ Build completed successfully" >> $GITHUB_STEP_SUMMARY
echo "📦 Artifacts uploaded as: build-files-${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
73 changes: 73 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Deploy to Server
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run lint
run: npm run lint

- name: TypeScript check
run: npx tsc --noEmit

- name: Build project
run: npm run build

- name: Deploy to server
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: ${{ secrets.SERVER_PORT || 22 }}
script: |
echo "🚀 Starting deployment..."

cd /opt

if [ ! -d "frontend-react" ]; then
echo "📥 Cloning repository..."
git clone https://github.com/PrettyPet-Organization/frontend-react.git
else
echo "🔄 Updating repository..."
cd frontend-react
git fetch origin
git reset --hard origin/main
cd ..
fi

cd frontend-react

echo "⏹️ Stopping old containers..."
docker-compose down || true

echo "🔨 Building and starting containers..."
docker-compose up -d --build

echo "⏳ Waiting for startup..."
sleep 10

if docker-compose ps | grep -q "Up"; then
echo "✅ Deployment successful!"
else
echo "❌ Something went wrong"
docker-compose logs
exit 1
fi

docker-compose ps
50 changes: 50 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Lint

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

jobs:
lint:
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint
continue-on-error: false

- name: Run TypeScript check
run: npx tsc --noEmit

- name: Run Prettier check
run: |
if npm run format:check; then
echo "✅ Code formatting is correct"
else
echo "❌ Code formatting issues found. Run 'npm run format' to fix."
exit 1
fi
continue-on-error: false

- name: Lint summary
if: always()
run: |
echo "## Lint Results" >> $GITHUB_STEP_SUMMARY
echo "- ESLint: ${{ steps.eslint.outcome || '✅ Passed' }}" >> $GITHUB_STEP_SUMMARY
echo "- TypeScript: ${{ steps.typescript.outcome || '✅ Passed' }}" >> $GITHUB_STEP_SUMMARY
echo "- Prettier: ${{ steps.prettier.outcome || '✅ Passed' }}" >> $GITHUB_STEP_SUMMARY
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# enviroment
.env
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:20-alpine3.19 AS builder

WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM nginx:alpine

COPY --from=builder /app/dist /usr/share/nginx/html

COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.8'

services:
frontend:
build: .
container_name: prettypet-frontend
restart: unless-stopped
ports:
- "80:80"
volumes:
- ./logs:/var/log/nginx
environment:
- NODE_ENV=production
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>Pretty Pet</title>
</head>
<body>
<div id="root"></div>
Expand Down
43 changes: 43 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied expired no-cache no-store private must-revalidate auth;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;

server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri $uri/ /index.html;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}

add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;

location /health {
access_log off;
return 200 "healthy\n";
add_header Content-Type text/plain;
}
}
}
Loading
Loading