- Express backend with PostgreSQL (JWT auth, full CRUD) - React + Vite + TailwindCSS frontend in Hebrew (RTL) - Features: Digital Booking System, Guest Management, Smart Budget Management - Docker Compose with postgres healthcheck - Auto-runs migrations on startup Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
38 lines
983 B
JavaScript
38 lines
983 B
JavaScript
const express = require('express');
|
|
const cors = require('cors');
|
|
const path = require('path');
|
|
require('dotenv').config();
|
|
|
|
const app = express();
|
|
const PORT = process.env.PORT || 3000;
|
|
|
|
app.use(cors());
|
|
app.use(express.json());
|
|
|
|
// Health check
|
|
app.get('/health', (req, res) => {
|
|
res.json({
|
|
status: 'ok',
|
|
app: 'airewit',
|
|
timestamp: new Date().toISOString(),
|
|
commit: process.env.COMMIT_SHA || 'local'
|
|
});
|
|
});
|
|
|
|
// API routes
|
|
app.use('/api/events', require('./routes/events'));
|
|
app.use('/api/guests', require('./routes/guests'));
|
|
app.use('/api/bookings', require('./routes/bookings'));
|
|
app.use('/api/budget', require('./routes/budget'));
|
|
app.use('/api/auth', require('./routes/auth'));
|
|
|
|
// Serve React frontend
|
|
app.use(express.static(path.join(__dirname, 'client/dist')));
|
|
app.get('*', (req, res) => {
|
|
res.sendFile(path.join(__dirname, 'client/dist/index.html'));
|
|
});
|
|
|
|
app.listen(PORT, () => {
|
|
console.log(`אירועית server running on port ${PORT}`);
|
|
});
|