Skip to content
Merged

Main #17

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
e160fac
feat: database init
virus231 Sep 16, 2025
b0b4b7e
Merge pull request #6 from virus231/feature/database-schema
virus231 Sep 16, 2025
12b641e
chore(release): 1.1.0-beta.1 [skip ci]
semantic-release-bot Sep 16, 2025
acefc83
feat: auth endpoints
virus231 Sep 16, 2025
d4156b4
fix: type errors
virus231 Sep 16, 2025
16bd6bc
Merge pull request #7 from virus231/feature/auth-endpoints
virus231 Sep 16, 2025
5e3031a
chore(release): 1.1.0-beta.2 [skip ci]
semantic-release-bot Sep 16, 2025
81a9534
feat: connect full Express app to Vercel for production auth
virus231 Sep 16, 2025
16c9561
Merge pull request #8 from virus231/feature/auth-endpoints
virus231 Sep 16, 2025
2a77bb0
chore(release): 1.1.0-beta.3 [skip ci]
semantic-release-bot Sep 16, 2025
b9bb60a
Update index.ts
virus231 Sep 16, 2025
fc49461
Merge pull request #9 from virus231/feature/auth-endpoints
virus231 Sep 16, 2025
7b46172
test: api request
virus231 Sep 16, 2025
cf93b12
chore(release): 1.1.0-beta.4 [skip ci]
semantic-release-bot Sep 16, 2025
28c4ae3
test: fix api
virus231 Sep 16, 2025
3858b33
chore(release): 1.1.0-beta.5 [skip ci]
semantic-release-bot Sep 16, 2025
2f641b5
test: fix api
virus231 Sep 16, 2025
e130106
Merge branch 'develop' of https://github.com/virus231/tech-stack into…
virus231 Sep 16, 2025
19a9cc4
chore(release): 1.1.0-beta.6 [skip ci]
semantic-release-bot Sep 16, 2025
6ff87b1
fix: api
virus231 Sep 16, 2025
4ac9a29
Merge branch 'develop' of https://github.com/virus231/tech-stack into…
virus231 Sep 16, 2025
e64bbe1
chore(release): 1.1.0-beta.7 [skip ci]
semantic-release-bot Sep 16, 2025
492e246
fix: api path url
virus231 Sep 16, 2025
a7f90c8
chore(release): 1.1.0-beta.8 [skip ci]
semantic-release-bot Sep 16, 2025
58aa7b0
fix: change folder
virus231 Sep 17, 2025
94f770c
chore(release): 1.1.0-beta.9 [skip ci]
semantic-release-bot Sep 17, 2025
e315985
fix: releaser config
virus231 Sep 17, 2025
93ab796
Merge branch 'develop' of https://github.com/virus231/tech-stack into…
virus231 Sep 17, 2025
ebbadb4
chore(release): 1.1.0-beta.10 [skip ci]
semantic-release-bot Sep 17, 2025
f97fad7
feat: posts api
virus231 Sep 17, 2025
f0a0dce
Merge pull request #10 from virus231/feat/api-posts
virus231 Sep 17, 2025
143830f
chore(release): 1.1.0-beta.11 [skip ci]
semantic-release-bot Sep 17, 2025
fab05d5
feat: users api
virus231 Sep 17, 2025
5ebd0b1
Merge pull request #11 from virus231/feat/users-api
virus231 Sep 17, 2025
a8dd8ea
chore(release): 1.1.0-beta.12 [skip ci]
semantic-release-bot Sep 17, 2025
469894a
add: env var
virus231 Sep 17, 2025
c71aaf5
Merge pull request #12 from virus231/feat/auth-middleware
virus231 Sep 17, 2025
d2b9ce5
feat: shadcn setup, auth setup with tanstack query and axios
virus231 Sep 17, 2025
f4bd0a6
Merge pull request #13 from virus231/feat/auth-system-front
virus231 Sep 17, 2025
2f4c470
chore(release): 1.1.0-beta.13 [skip ci]
semantic-release-bot Sep 17, 2025
dab04b3
feat: posts ui CRUD
virus231 Sep 17, 2025
2ad5e8c
Merge pull request #14 from virus231/feat/posts-service-front
virus231 Sep 17, 2025
6670107
chore(release): 1.1.0-beta.14 [skip ci]
semantic-release-bot Sep 17, 2025
43ef77c
feat: create post form
virus231 Sep 17, 2025
e40c1ab
Merge pull request #15 from virus231/feat/posts-service-front
virus231 Sep 17, 2025
b2331ab
chore(release): 1.1.0-beta.15 [skip ci]
semantic-release-bot Sep 17, 2025
2a4a28e
feat: improvements
virus231 Sep 17, 2025
e12a9ff
Merge pull request #16 from virus231/feat/user-edit-profile
virus231 Sep 17, 2025
06dd0d3
chore(release): 1.1.0-beta.16 [skip ci]
semantic-release-bot Sep 17, 2025
34db9e8
remove: field name
virus231 Sep 17, 2025
571e00b
fix: error env var
virus231 Sep 17, 2025
84ec801
chore(release): 1.1.0-beta.17 [skip ci]
semantic-release-bot Sep 17, 2025
09be55b
fixes
virus231 Sep 17, 2025
341c60f
fix: error page promiseo
virus231 Sep 17, 2025
3dfa7cc
chore(release): 1.1.0-beta.18 [skip ci]
semantic-release-bot Sep 17, 2025
f56e590
fix: static post page
virus231 Sep 17, 2025
4bb0daf
Merge branch 'develop' of https://github.com/virus231/tech-stack into…
virus231 Sep 17, 2025
9575053
chore(release): 1.1.0-beta.19 [skip ci]
semantic-release-bot Sep 17, 2025
13806c2
feat: edit post
virus231 Sep 17, 2025
6ef3b94
Merge branch 'develop' of https://github.com/virus231/tech-stack into…
virus231 Sep 17, 2025
8cd848e
chore(release): 1.1.0-beta.20 [skip ci]
semantic-release-bot Sep 17, 2025
c331e43
fix: ui space
virus231 Sep 17, 2025
3332627
Merge branch 'develop' of https://github.com/virus231/tech-stack into…
virus231 Sep 17, 2025
196b953
chore(release): 1.1.0-beta.21 [skip ci]
semantic-release-bot Sep 17, 2025
aa11e0f
Merge branch 'main' into develop
virus231 Sep 17, 2025
b03535a
chore(release): 1.1.0-beta.22 [skip ci]
semantic-release-bot Sep 17, 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
13 changes: 3 additions & 10 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,9 @@
[
"@semantic-release/github",
{
"assets": [
{
"path": "backend/dist/**/*",
"label": "Backend Build"
},
{
"path": "frontend/dist/**/*",
"label": "Frontend Build"
}
]
"failComment": false,
"failTitle": false,
"successComment": false
}
],
[
Expand Down
130 changes: 129 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,132 @@
## [1.0.5](https://github.com/virus231/tech-stack/compare/v1.0.4...v1.0.5) (2025-09-16)
## [1.1.0-beta.22](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.21...v1.1.0-beta.22) (2025-09-17)

### ♻️ Chores

* **release:** 1.0.5 [skip ci] ([6a443fa](https://github.com/virus231/tech-stack/commit/6a443fa4447ee42a9dd1a67d88fcd42e84f0ee35))

## [1.1.0-beta.20](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.19...v1.1.0-beta.20) (2025-09-17)

### ✨ Features

* edit post ([13806c2](https://github.com/virus231/tech-stack/commit/13806c2e19582b013425193cda25b157d8eaf245))

## [1.1.0-beta.19](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.18...v1.1.0-beta.19) (2025-09-17)

### 🐛 Bug Fixes

* static post page ([f56e590](https://github.com/virus231/tech-stack/commit/f56e5907f80bf419c9df3c5f759e4decc9be1b5f))

## [1.1.0-beta.18](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.17...v1.1.0-beta.18) (2025-09-17)

### 🐛 Bug Fixes

* error page promiseo ([341c60f](https://github.com/virus231/tech-stack/commit/341c60fc61a9b059eb837e1be40767201434045a))

## [1.1.0-beta.17](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.16...v1.1.0-beta.17) (2025-09-17)

### 🐛 Bug Fixes

* error env var ([571e00b](https://github.com/virus231/tech-stack/commit/571e00b96548769d4a31f5e032cabcdf693607a5))

## [1.1.0-beta.16](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.15...v1.1.0-beta.16) (2025-09-17)

### ✨ Features

* improvements ([2a4a28e](https://github.com/virus231/tech-stack/commit/2a4a28ee691617ca08f39362d5b36bc2be8ca5ed))

## [1.1.0-beta.15](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.14...v1.1.0-beta.15) (2025-09-17)

### ✨ Features

* create post form ([43ef77c](https://github.com/virus231/tech-stack/commit/43ef77cf433bbf5f787ba0a8f1a6f65fe08c501e))

## [1.1.0-beta.14](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.13...v1.1.0-beta.14) (2025-09-17)

### ✨ Features

* posts ui CRUD ([dab04b3](https://github.com/virus231/tech-stack/commit/dab04b3e1c4e2a5c361609f09b4acb4956ad9924))

## [1.1.0-beta.13](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.12...v1.1.0-beta.13) (2025-09-17)

### ✨ Features

* shadcn setup, auth setup with tanstack query and axios ([d2b9ce5](https://github.com/virus231/tech-stack/commit/d2b9ce5002917ea1f25dc1b0332c587cb49b703f))

## [1.1.0-beta.12](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.11...v1.1.0-beta.12) (2025-09-17)

### ✨ Features

* users api ([fab05d5](https://github.com/virus231/tech-stack/commit/fab05d5bedea427442a8cc78d384f0e25d1a1cf0))

## [1.1.0-beta.11](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.10...v1.1.0-beta.11) (2025-09-17)

### ✨ Features

* posts api ([f97fad7](https://github.com/virus231/tech-stack/commit/f97fad778935223a4392c8fd7a513c3580700056))

## [1.1.0-beta.10](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.9...v1.1.0-beta.10) (2025-09-17)

### 🐛 Bug Fixes

* releaser config ([e315985](https://github.com/virus231/tech-stack/commit/e3159854bdf33b155920a3a36b95c8ca1f15eadc))

## [1.1.0-beta.9](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.8...v1.1.0-beta.9) (2025-09-17)

### 🐛 Bug Fixes

* change folder ([58aa7b0](https://github.com/virus231/tech-stack/commit/58aa7b03a8e4fd7e465a5b3ebce5d3cdae5ce4ac))

## [1.1.0-beta.8](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.7...v1.1.0-beta.8) (2025-09-16)

### 🐛 Bug Fixes

* api path url ([492e246](https://github.com/virus231/tech-stack/commit/492e2461c6fc095242c49002109837615df35308))

## [1.1.0-beta.7](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.6...v1.1.0-beta.7) (2025-09-16)

### 🐛 Bug Fixes

* api ([6ff87b1](https://github.com/virus231/tech-stack/commit/6ff87b174ce711deca43853a879458d72943a6d3))

## [1.1.0-beta.6](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.5...v1.1.0-beta.6) (2025-09-16)

### 🚨 Tests

* fix api ([2f641b5](https://github.com/virus231/tech-stack/commit/2f641b5a3ee320a1dc72594459c52382088d15a8))

## [1.1.0-beta.5](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.4...v1.1.0-beta.5) (2025-09-16)

### 🚨 Tests

* fix api ([28c4ae3](https://github.com/virus231/tech-stack/commit/28c4ae364c1ef8ec09f65b83cb63ecf17ba15dca))

## [1.1.0-beta.4](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.3...v1.1.0-beta.4) (2025-09-16)

### 🚨 Tests

* api request ([7b46172](https://github.com/virus231/tech-stack/commit/7b4617253321b0b65d8def99d0c66957d4c94eb3))

## [1.1.0-beta.3](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.2...v1.1.0-beta.3) (2025-09-16)

### ✨ Features

* connect full Express app to Vercel for production auth ([81a9534](https://github.com/virus231/tech-stack/commit/81a953462b343fba7cfd4c4e4d2c181394f06bf3))

## [1.1.0-beta.2](https://github.com/virus231/tech-stack/compare/v1.1.0-beta.1...v1.1.0-beta.2) (2025-09-16)

### ✨ Features

* auth endpoints ([acefc83](https://github.com/virus231/tech-stack/commit/acefc83ea98a610d05f633845ac5ae51653c761c))

### 🐛 Bug Fixes

* type errors ([d4156b4](https://github.com/virus231/tech-stack/commit/d4156b47ee468b7ae2e352ff8767512a1204c51b))

## [1.1.0-beta.1](https://github.com/virus231/tech-stack/compare/v1.0.4...v1.1.0-beta.1) (2025-09-16)

### ✨ Features

* database init ([e160fac](https://github.com/virus231/tech-stack/commit/e160fac0ab056e27d72b0097dc3729194a8ef40c))

### 🐛 Bug Fixes

Expand Down
19 changes: 0 additions & 19 deletions backend/api/index.ts

This file was deleted.

Empty file removed backend/index.ts
Empty file.
8 changes: 6 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"prisma:migrate": "prisma migrate dev",
"prisma:migrate:prod": "ts-node prisma/migrate-prod.ts",
"prisma:studio": "prisma studio",
"vercel-build": "pnpm prisma:generate && pnpm build",
"test": "echo \"Error: no test specified\" && exit 1"
"vercel-build": "pnpm prisma:generate && tsc && tsc-alias"
},
"keywords": [],
"author": "",
Expand All @@ -23,20 +22,25 @@
"dependencies": {
"@prisma/client": "^6.16.1",
"@vercel/node": "^3.0.31",
"bcryptjs": "^3.0.2",
"cors": "^2.8.5",
"dotenv": "^17.2.2",
"express": "^5.1.0",
"helmet": "^8.1.0",
"jsonwebtoken": "^9.0.2",
"morgan": "^1.10.1"
},
"devDependencies": {
"@types/bcryptjs": "^3.0.0",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.3",
"@types/jsonwebtoken": "^9.0.10",
"@types/morgan": "^1.9.10",
"@types/node": "^24.5.0",
"nodemon": "^3.1.10",
"prisma": "^6.16.1",
"ts-node": "^10.9.2",
"tsc-alias": "^1.8.8",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.9.2"
}
Expand Down
30 changes: 30 additions & 0 deletions backend/prisma/migrations/20250916210727_init/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-- CreateTable
CREATE TABLE "public"."User" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"email" TEXT NOT NULL,
"name" TEXT,
"password" TEXT NOT NULL,

CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "public"."Post" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"title" TEXT NOT NULL,
"content" TEXT NOT NULL,
"description" TEXT,
"authorId" INTEGER NOT NULL,

CONSTRAINT "Post_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "public"."User"("email");

-- AddForeignKey
ALTER TABLE "public"."Post" ADD CONSTRAINT "Post_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "public"."User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
3 changes: 3 additions & 0 deletions backend/prisma/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "postgresql"
30 changes: 27 additions & 3 deletions backend/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init

generator client {
provider = "prisma-client-js"
}
Expand All @@ -12,3 +9,30 @@ datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

// User model for authentication
model User {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
email String @unique
name String?
password String

// Relations
posts Post[]
}

// Post model for blog posts
model Post {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
content String
description String?

// Relations
authorId Int
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
}
16 changes: 14 additions & 2 deletions backend/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { config } from "@/config/config";
import { config } from "./config/config";
import cors from "cors";
import express, { type Express } from "express";
import helmet from "helmet";
import morgan from "morgan";
import authRoutes from "./routes/auth";
import postsRoutes from "./routes/posts";
import usersRoutes from "./routes/users";

const app: Express = express();

Expand All @@ -25,14 +28,23 @@ app.use(express.json({ limit: "10mb" }));
app.use(express.urlencoded({ extended: true, limit: "10mb" }));

// Health check endpoint
app.get("/health", (_req, res) => {
app.get("/api/health", (_req, res) => {
res.status(200).json({
status: "OK",
timestamp: new Date().toISOString(),
environment: config.nodeEnv,
});
});

// Auth routes
app.use("/api/auth", authRoutes);

// Posts routes
app.use("/api/posts", postsRoutes);

// Users routes
app.use("/api/users", usersRoutes);

// API routes
app.use("/api", (_req, res) => {
res.json({ message: "API is working" });
Expand Down
5 changes: 5 additions & 0 deletions backend/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ for (const envVar of requiredEnvVars) {
throw new Error(`Missing required environment variable: ${envVar}`);
}
}

// Warn if using fallback JWT secret in production
if (!process.env.JWT_SECRET && config.nodeEnv === "production") {
console.warn("⚠️ Warning: Using fallback JWT secret in production! Please set JWT_SECRET environment variable.");
}
Loading