Initial fullstack scaffold: Events, Guests, Budget, Bookings
- 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>
This commit is contained in:
37
server.js
Normal file
37
server.js
Normal file
@@ -0,0 +1,37 @@
|
||||
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}`);
|
||||
});
|
||||
Reference in New Issue
Block a user