Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

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

jobs:
test-and-build:
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install root dependencies
run: pnpm install --frozen-lockfile

- name: Install backend dependencies
run: |
cd backend
pnpm install
pnpm prisma:generate

- name: Install frontend dependencies
run: |
cd frontend
pnpm install || echo "Frontend not ready yet"

- name: Lint backend
run: |
cd backend
pnpm lint || echo "Lint not configured yet"

- name: Type check backend
run: |
cd backend
pnpm type-check || echo "Type check not configured yet"

- name: Build backend
run: |
cd backend
pnpm build

- name: Build frontend
run: |
cd frontend
pnpm build || echo "Frontend build not ready yet"
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy to Vercel

on:
push:
branches: [main]
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install dependencies
run: |
pnpm install --frozen-lockfile
cd backend && pnpm install
cd ../frontend && pnpm install

- name: Build backend
run: |
cd backend
pnpm prisma:generate
pnpm build

- name: Build frontend
run: |
cd frontend
pnpm build

- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
working-directory: ./
53 changes: 53 additions & 0 deletions .github/workflows/pr-to-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: PR to Main

on:
pull_request:
branches: [main, master]
types: [opened, synchronize, reopened]

jobs:
validate-pr:
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install backend dependencies
run: |
cd backend
pnpm install
pnpm prisma:generate

- name: Install frontend dependencies
run: |
cd frontend
pnpm install || echo "Frontend not ready yet"

- name: Build backend
run: |
cd backend
pnpm build

- name: Build frontend
run: |
cd frontend
pnpm build || echo "Frontend build not ready yet"

- name: Validate commit messages
run: |
echo "Validating PR commits follow conventional commit format"
# This will be enhanced when we add commitlint back if needed
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- master
- develop

permissions:
contents: read
Expand Down Expand Up @@ -39,12 +40,13 @@ jobs:
- name: Install backend dependencies
run: |
cd backend
pnpm install --frozen-lockfile
pnpm install
pnpm prisma:generate

- name: Install frontend dependencies
run: |
cd frontend
pnpm install --frozen-lockfile
pnpm install || echo "Frontend not ready yet"

- name: Build backend
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
.vercel
7 changes: 5 additions & 2 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"branches": [
"main",
"master"
"master",
{
"name": "develop",
"prerelease": "beta"
}
],
"repositoryUrl": "https://github.com/your-username/tech-test",
"plugins": [
[
"@semantic-release/commit-analyzer",
Expand Down
13 changes: 13 additions & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules
.env
.env.local
.env.*.local
.git
.gitignore
README.md
docker-compose.yml
backend/dist
backend/node_modules
frontend/node_modules
frontend/.next
*.log
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## [1.0.0-beta.2](https://github.com/virus231/tech-stack/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2025-09-16)

### ✨ Features

* add Vercel deployment configuration ([27ed269](https://github.com/virus231/tech-stack/commit/27ed269e88f759e76e19bd8a238a403e825c1010))

## 1.0.0-beta.1 (2025-09-16)

### ✨ Features

* add CI/CD workflow with semantic-release ([1001430](https://github.com/virus231/tech-stack/commit/10014303229e59c9f15646e0b7adeb7a414592cc))
* add Git Flow CI/CD with develop branch support ([6c7dab9](https://github.com/virus231/tech-stack/commit/6c7dab90595c3f93c89badb95ae092a447536c52))

### 🐛 Bug Fixes

* ci ([050bbcc](https://github.com/virus231/tech-stack/commit/050bbccbfa8fe73440d3499ed2bafd2870444456))
* ci cd ([25950ae](https://github.com/virus231/tech-stack/commit/25950ae294a01c088d76b91ffd58ed505155d9b6))
* express, ci cd ([8791d34](https://github.com/virus231/tech-stack/commit/8791d349906f80f641973a691f97e70f01077cf5))

### ⚙️ Continuous Integrations

* prisma fix ([6a81c73](https://github.com/virus231/tech-stack/commit/6a81c7329d494963dd7b9f7c10c8e42a46490661))
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,52 @@ pnpm build # Production build
pnpm start # Start production server
```

## Git Workflow & Branching Strategy

### Branching Model
Проект використовує **Git Flow** стратегію з автоматизацією через GitHub Actions:

```
main/master ←── Production releases (stable)
develop ←── Integration branch (beta releases)
feature/* ←── Feature development
hotfix/* ←── Urgent production fixes
```

### Branch Rules
- **main/master**: Тільки стабільні релізи (v1.0.0, v1.1.0)
- **develop**: Beta релізи для тестування (v1.1.0-beta.1)
- **feature/**: Розробка нових функцій
- **hotfix/**: Термінові виправлення для production

### Workflow
1. **Розробка**: `feature/auth-system` ← branch з develop
2. **Code Review**: PR feature → develop
3. **Integration**: PR develop → main (release готовий)
4. **Hotfix**: `hotfix/critical-bug` ← branch з main

## CI/CD & Releases

### GitHub Actions Workflows

#### 1. **CI Pipeline** (`.github/workflows/ci.yml`)
- **Triggers**: Push до develop, feature/*, hotfix/*
- **Triggers**: PR до main, master, develop
- **Actions**: Build, lint, type-check (без deploy)

#### 2. **Release Pipeline** (`.github/workflows/release.yml`)
- **Triggers**: Push до main, master, develop
- **Actions**: Build + semantic-release + deploy
- **Outputs**:
- main → stable release (v1.0.0)
- develop → beta release (v1.1.0-beta.1)

#### 3. **PR Validation** (`.github/workflows/pr-to-main.yml`)
- **Triggers**: PR до main/master
- **Actions**: Повна валідація перед merge

### Semantic Release
Проект використовує [semantic-release](https://semantic-release.gitbook.io/) для автоматичних релізів:

Expand Down
31 changes: 31 additions & 0 deletions TASK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Тестове завдання: Fullstack Developer
Завдання
Реалізувати простий застосунок «Міні-блог з авторизацією».
Функціонал
Фронтенд (Next.js + TypeScript):
Сторінка реєстрації / входу (email + пароль).
Сторінка зі списком постів (назва + короткий опис).
Сторінка одного поста (заголовок, текст, дата створення).
Сторінка створення нового поста (доступна тільки після авторизації).
Простий дизайн (Tailwind та будь-яку UI-бібліотеку).
-застосувати охайні базові стилі (TailwindCSS чи інша UI-бібліотека);
Сторінка редагування інформації про користувача (ім’я, email, пароль).

Бекенд (Express.js + TypeScript):
Авторизація (JWT або сесії):
POST /auth/register — реєстрація.
POST /auth/login — вхід.

API для постів:
GET /posts — отримати всі пости.
GET /posts/:id — отримати конкретний пост.
POST /posts — створити новий пост (тільки авторизований користувач).

API для користувачів:
GET /users/me — отримати інформацію про поточного авторизованого користувача.
PUT /users/me — оновити інформацію (ім’я, email, пароль).

(опціонально) DELETE /users/me — видалити свій акаунт.
Зберігання даних:
Використати PostgreSQL як базу даних.
Роботу з БД реалізувати через Prisma.
Loading