Backend server voor de Fysiosim applicatie, inclusief wachtkamer functionaliteit en consult simulaties.
-
Installeer dependencies:
npm install
-
Maak
.envbestand: Kopieer.env.examplenaar.enven vul de waarden in:cp .env.example .env
Vul in
.env:GEMINI_API_KEY: Je Google Gemini API keyCRON_SECRET_KEY: Een willekeurige secret key voor beveiliging
-
Start de server:
npm start
Server draait op:
http://localhost:3001
GET /api/patienten?praktijk=1- Haal patiënten op voor een specifieke praktijkPOST /api/consult/start- Start een nieuw consultPOST /api/consult/vraag- Stel een vraag in een consultPOST /cron/generate-wachtkamer- Genereer nieuwe patiënten (beveiligd met secret key)
Zie index.js voor volledige API documentatie.
| Variabele | Verplicht | Beschrijving |
|---|---|---|
GEMINI_API_KEY |
✅ Ja | Google Gemini API key voor AI functionaliteit |
CRON_SECRET_KEY |
✅ Ja | Secret key voor beveiliging van cron endpoints |
PORT |
❌ Nee | Poort waarop server draait (default: 3001) |
express- Web frameworkcors- Cross-Origin Resource Sharingdotenv- Environment variable managementnode-fetch- HTTP client voor Gemini API calls
Zie GITHUB_UPLOAD_GUIDE.md in de hoofdmap voor instructies over:
- GitHub upload (met veiligheid)
- Deployment naar Render.com, Railway.app, etc.
server/
├── index.js # Main server file
├── package.json # Dependencies
├── .env # Environment variables (NIET in Git!)
├── .env.example # Environment template (WEL in Git)
├── .gitignore # Git ignore rules
├── services/ # Business logic
│ ├── consultService.js # Consult/chat logic
│ └── systemPrompt.js # AI prompt templates
├── storage/ # Data storage
│ └── database.js # JSON file database
└── schemas/ # Data schemas
- NOOIT commit
.envnaar Git - Gebruik
.env.exampleals template - Bewaar
CRON_SECRET_KEYgeheim - Rotate API keys regelmatig
- GitHub Upload:
../../GITHUB_UPLOAD_GUIDE.md - Backend Setup:
../../BACKEND_SETUP_GUIDE.md - Quick Start:
../../BACKEND_QUICK_START.md