3 Commits

Author SHA1 Message Date
41846a6eb6 Merge feature/full-frontend-v1 into main (initial frontend codebase by Yamen)
Made-with: Cursor
2026-04-01 18:18:52 +04:00
b04db0b06c chore: verify deployment hook
Made-with: Cursor
2026-03-30 19:41:30 +04:00
3ebcec2b43 chore: add docker-compose, .gitignore and README
Infrastructure files for staging deployment pipeline.
The post-receive hook on the staging server will build and
deploy automatically when PRs are merged to main.

Made-with: Cursor
2026-03-30 19:40:44 +04:00
5 changed files with 38 additions and 59 deletions

View File

@@ -1,10 +0,0 @@
node_modules
dist
.git
.env
.env.local
.env.production
*.md
docs/
.vscode/
coverage/

14
.gitignore vendored
View File

@@ -4,9 +4,13 @@ node_modules/
# Build output
dist/
build/
.next/
out/
# Environment
# Environment / secrets — never commit
.env
.env.*
!.env.example
.env.local
.env.production
.env.*.local
@@ -25,9 +29,5 @@ Thumbs.db
# Logs
*.log
npm-debug.log*
# Testing
coverage/
# Vite
*.local
yarn-debug.log*
yarn-error.log*

View File

@@ -1,41 +0,0 @@
FROM node:18-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
ARG VITE_API_BASE_URL=/api
ARG VITE_APP_NAME=EnCoach
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
ENV VITE_APP_NAME=$VITE_APP_NAME
RUN npm run build
FROM nginx:stable-alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY <<'NGINX' /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location /api/ {
proxy_pass http://backend:8069/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 300s;
}
location / {
try_files $uri $uri/ /index.html;
}
location ~* \.(?:css|js|svg|png|jpg|jpeg|gif|ico|woff2?|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
}
NGINX
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -1,3 +1,24 @@
# EnCoach Frontend — v2
## Branching Workflow
This repo is connected to the staging server via a Git post-receive hook.
**All deployment is automatic — but only after code review approval.**
### How to contribute
1. Never push directly to `main` — branch protection will block it.
2. Push your changes to your feature branch (e.g. `feature/full-frontend-v1`)
3. Open a Pull Request on Gitea targeting `main`
4. Request review from **devops (Talal)**
5. Once approved and merged, the staging server rebuilds and redeploys automatically.
### Environment
The `.env` file is **not committed**. It lives only on the staging server at `/opt/encoach/frontend-v2/.env`.
---
# EnCoach — Adaptive Learning Platform (Frontend)
The frontend application for the EnCoach Adaptive Learning Platform, serving UTAS university students and freelance learners across IELTS, Mathematics, and IT courses.
@@ -115,4 +136,4 @@ Authentication uses JWT tokens stored in `localStorage`, with automatic 401 inte
## License
Proprietary — EnCoach Platform. All rights reserved.
Proprietary — EnCoach Platform. All rights reserved.

9
docker-compose.yml Normal file
View File

@@ -0,0 +1,9 @@
services:
frontend:
build: .
image: encoach-frontend:latest
container_name: encoach-frontend
restart: unless-stopped
ports:
- "3000:3000"
env_file: .env