feat: initial project structure — Express/TS/TypeORM + React/TS + Docker + Gitea CI
Some checks failed
CI/CD — Build & Deploy / Build (push) Failing after 1m47s
CI/CD — Build & Deploy / Deploy to VPS (push) Has been skipped

This commit is contained in:
2026-03-14 04:13:58 +01:00
commit 4a3be2a323
18 changed files with 396 additions and 0 deletions

29
backend/src/index.ts Normal file
View File

@@ -0,0 +1,29 @@
import "reflect-metadata";
import express from "express";
import cors from "cors";
import dotenv from "dotenv";
import { AppDataSource } from "./config/data-source";
dotenv.config();
const app = express();
const PORT = parseInt(process.env.PORT ?? "4000");
app.use(cors());
app.use(express.json());
app.get("/api/health", (_req, res) => {
res.json({ status: "ok", timestamp: new Date().toISOString() });
});
AppDataSource.initialize()
.then(() => {
console.log("Database connected");
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
})
.catch((err) => {
console.error("Database connection failed:", err);
process.exit(1);
});