create-jinmankn-app 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +76 -0
- package/package.json +20 -0
- package/templates/blueprint/BLUEPRINT_REPRODUCTION_PROMPT.md +996 -0
- package/templates/blueprint/HOW_IT_WORKS.md +286 -0
- package/templates/blueprint/README.md +123 -0
- package/templates/blueprint/backend/config/db.js +12 -0
- package/templates/blueprint/backend/controllers/authController.js +90 -0
- package/templates/blueprint/backend/controllers/itemController.js +74 -0
- package/templates/blueprint/backend/middleware/auth.js +32 -0
- package/templates/blueprint/backend/middleware/errorHandler.js +23 -0
- package/templates/blueprint/backend/models/Item.js +26 -0
- package/templates/blueprint/backend/models/User.js +28 -0
- package/templates/blueprint/backend/package-lock.json +2190 -0
- package/templates/blueprint/backend/package.json +23 -0
- package/templates/blueprint/backend/routes/authRoutes.js +11 -0
- package/templates/blueprint/backend/routes/healthRoutes.js +9 -0
- package/templates/blueprint/backend/routes/itemRoutes.js +21 -0
- package/templates/blueprint/backend/server.js +29 -0
- package/templates/blueprint/frontend/.env.example +1 -0
- package/templates/blueprint/frontend/index.html +13 -0
- package/templates/blueprint/frontend/package-lock.json +2844 -0
- package/templates/blueprint/frontend/package.json +23 -0
- package/templates/blueprint/frontend/public/favicon.svg +4 -0
- package/templates/blueprint/frontend/src/App.jsx +78 -0
- package/templates/blueprint/frontend/src/assets/logo.svg +4 -0
- package/templates/blueprint/frontend/src/components/DashboardLayout.jsx +103 -0
- package/templates/blueprint/frontend/src/components/ProtectedRoute.jsx +18 -0
- package/templates/blueprint/frontend/src/index.css +1 -0
- package/templates/blueprint/frontend/src/main.jsx +13 -0
- package/templates/blueprint/frontend/src/pages/DashboardHome.jsx +74 -0
- package/templates/blueprint/frontend/src/pages/Items.jsx +243 -0
- package/templates/blueprint/frontend/src/pages/Login.jsx +101 -0
- package/templates/blueprint/frontend/src/pages/Profile.jsx +79 -0
- package/templates/blueprint/frontend/src/pages/Register.jsx +122 -0
- package/templates/blueprint/frontend/src/pages/Report.jsx +124 -0
- package/templates/blueprint/frontend/vite.config.js +10 -0
- package/templates/blueprint/package.json +13 -0
- package/templates/blueprint/scripts/pack-blueprint.ps1 +18 -0
- package/templates/chom/Backend/app.js +25 -0
- package/templates/chom/Backend/package-lock.json +1551 -0
- package/templates/chom/Backend/package.json +23 -0
- package/templates/chom/Backend/seedAdmin.js +21 -0
- package/templates/chom/Backend/src/controllers/payment.c.js +57 -0
- package/templates/chom/Backend/src/controllers/students.c.js +58 -0
- package/templates/chom/Backend/src/controllers/users.c.js +62 -0
- package/templates/chom/Backend/src/middleware/authentication.js +18 -0
- package/templates/chom/Backend/src/models/payment.m.js +13 -0
- package/templates/chom/Backend/src/models/students.m.js +10 -0
- package/templates/chom/Backend/src/models/users.m.js +11 -0
- package/templates/chom/Backend/src/routes/users.r.js +21 -0
- package/templates/chom/Frontend/README.md +16 -0
- package/templates/chom/Frontend/eslint.config.js +21 -0
- package/templates/chom/Frontend/index.html +13 -0
- package/templates/chom/Frontend/package-lock.json +3075 -0
- package/templates/chom/Frontend/package.json +31 -0
- package/templates/chom/Frontend/public/favicon.svg +1 -0
- package/templates/chom/Frontend/public/icons.svg +24 -0
- package/templates/chom/Frontend/src/App.css +189 -0
- package/templates/chom/Frontend/src/App.jsx +28 -0
- package/templates/chom/Frontend/src/api/api.jsx +27 -0
- package/templates/chom/Frontend/src/assets/hero.png +0 -0
- package/templates/chom/Frontend/src/assets/react.svg +1 -0
- package/templates/chom/Frontend/src/assets/vite.svg +1 -0
- package/templates/chom/Frontend/src/components/Navbar.jsx +21 -0
- package/templates/chom/Frontend/src/index.css +8 -0
- package/templates/chom/Frontend/src/main.jsx +10 -0
- package/templates/chom/Frontend/src/pages/Dashboard.jsx +21 -0
- package/templates/chom/Frontend/src/pages/Landing.jsx +39 -0
- package/templates/chom/Frontend/src/pages/Login.jsx +49 -0
- package/templates/chom/Frontend/src/pages/Overview.jsx +42 -0
- package/templates/chom/Frontend/src/pages/Register.jsx +76 -0
- package/templates/chom/Frontend/src/pages/Students.jsx +14 -0
- package/templates/chom/Frontend/vite.config.js +8 -0
- package/templates/chom/package.json +13 -0
- package/templates/hospital-faisal/backend/.env.example +9 -0
- package/templates/hospital-faisal/backend/config/db.js +96 -0
- package/templates/hospital-faisal/backend/controllers/appointmentController.js +164 -0
- package/templates/hospital-faisal/backend/controllers/authController.js +106 -0
- package/templates/hospital-faisal/backend/controllers/hospitalReportController.js +72 -0
- package/templates/hospital-faisal/backend/controllers/medicalReportController.js +105 -0
- package/templates/hospital-faisal/backend/controllers/patientController.js +98 -0
- package/templates/hospital-faisal/backend/database/schema.sql +47 -0
- package/templates/hospital-faisal/backend/middleware/auth.js +30 -0
- package/templates/hospital-faisal/backend/middleware/errorHandler.js +23 -0
- package/templates/hospital-faisal/backend/middleware/role.js +6 -0
- package/templates/hospital-faisal/backend/package-lock.json +2092 -0
- package/templates/hospital-faisal/backend/package.json +23 -0
- package/templates/hospital-faisal/backend/routes/appointmentRoutes.js +25 -0
- package/templates/hospital-faisal/backend/routes/authRoutes.js +12 -0
- package/templates/hospital-faisal/backend/routes/healthRoutes.js +9 -0
- package/templates/hospital-faisal/backend/routes/hospitalReportRoutes.js +10 -0
- package/templates/hospital-faisal/backend/routes/medicalReportRoutes.js +16 -0
- package/templates/hospital-faisal/backend/routes/patientRoutes.js +22 -0
- package/templates/hospital-faisal/backend/server.js +46 -0
- package/templates/hospital-faisal/frontend/.env.example +1 -0
- package/templates/hospital-faisal/frontend/index.html +10 -0
- package/templates/hospital-faisal/frontend/package-lock.json +2844 -0
- package/templates/hospital-faisal/frontend/package.json +23 -0
- package/templates/hospital-faisal/frontend/public/favicon.svg +4 -0
- package/templates/hospital-faisal/frontend/src/App.jsx +56 -0
- package/templates/hospital-faisal/frontend/src/api.js +20 -0
- package/templates/hospital-faisal/frontend/src/assets/logo.svg +4 -0
- package/templates/hospital-faisal/frontend/src/components/DashboardLayout.jsx +114 -0
- package/templates/hospital-faisal/frontend/src/components/ProtectedRoute.jsx +18 -0
- package/templates/hospital-faisal/frontend/src/components/RoleRoute.jsx +14 -0
- package/templates/hospital-faisal/frontend/src/index.css +1 -0
- package/templates/hospital-faisal/frontend/src/main.jsx +13 -0
- package/templates/hospital-faisal/frontend/src/pages/Appointments.jsx +305 -0
- package/templates/hospital-faisal/frontend/src/pages/DashboardHome.jsx +105 -0
- package/templates/hospital-faisal/frontend/src/pages/Login.jsx +98 -0
- package/templates/hospital-faisal/frontend/src/pages/MedicalReports.jsx +182 -0
- package/templates/hospital-faisal/frontend/src/pages/Patients.jsx +237 -0
- package/templates/hospital-faisal/frontend/src/pages/Profile.jsx +78 -0
- package/templates/hospital-faisal/frontend/src/pages/Register.jsx +133 -0
- package/templates/hospital-faisal/frontend/src/pages/Report.jsx +167 -0
- package/templates/hospital-faisal/frontend/vite.config.js +10 -0
- package/templates/hospital-faisal/package.json +13 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kf-hospital-backend",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "King Faisal Hospital Rwanda — Node, Express, MySQL",
|
|
5
|
+
"main": "server.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "nodemon server.js",
|
|
8
|
+
"start": "node server.js"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"bcrypt": "^5.1.1",
|
|
14
|
+
"cors": "^2.8.5",
|
|
15
|
+
"dotenv": "^16.4.7",
|
|
16
|
+
"express": "^4.21.2",
|
|
17
|
+
"jsonwebtoken": "^9.0.2",
|
|
18
|
+
"mysql2": "^3.22.3"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"nodemon": "^3.1.9"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const {
|
|
3
|
+
getAppointments,
|
|
4
|
+
getAppointment,
|
|
5
|
+
createAppointment,
|
|
6
|
+
updateAppointment,
|
|
7
|
+
cancelAppointment,
|
|
8
|
+
deleteAppointment,
|
|
9
|
+
} = require('../controllers/appointmentController');
|
|
10
|
+
const { protect } = require('../middleware/auth');
|
|
11
|
+
const { requireRole } = require('../middleware/role');
|
|
12
|
+
|
|
13
|
+
const router = express.Router();
|
|
14
|
+
|
|
15
|
+
router.use(protect);
|
|
16
|
+
|
|
17
|
+
router.get('/', getAppointments);
|
|
18
|
+
router.get('/:id', getAppointment);
|
|
19
|
+
|
|
20
|
+
router.post('/', requireRole('receptionist'), createAppointment);
|
|
21
|
+
router.put('/:id', requireRole('receptionist'), updateAppointment);
|
|
22
|
+
router.patch('/:id/cancel', requireRole('receptionist'), cancelAppointment);
|
|
23
|
+
router.delete('/:id', requireRole('receptionist'), deleteAppointment);
|
|
24
|
+
|
|
25
|
+
module.exports = router;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const { register, login, getMe, getDoctors } = require('../controllers/authController');
|
|
3
|
+
const { protect } = require('../middleware/auth');
|
|
4
|
+
|
|
5
|
+
const router = express.Router();
|
|
6
|
+
|
|
7
|
+
router.post('/register', register);
|
|
8
|
+
router.post('/login', login);
|
|
9
|
+
router.get('/me', protect, getMe);
|
|
10
|
+
router.get('/doctors', protect, getDoctors);
|
|
11
|
+
|
|
12
|
+
module.exports = router;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const { generateReport } = require('../controllers/hospitalReportController');
|
|
3
|
+
const { protect } = require('../middleware/auth');
|
|
4
|
+
|
|
5
|
+
const router = express.Router();
|
|
6
|
+
|
|
7
|
+
router.use(protect);
|
|
8
|
+
router.get('/', generateReport);
|
|
9
|
+
|
|
10
|
+
module.exports = router;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const {
|
|
3
|
+
getMedicalReports,
|
|
4
|
+
createMedicalReport,
|
|
5
|
+
} = require('../controllers/medicalReportController');
|
|
6
|
+
const { protect } = require('../middleware/auth');
|
|
7
|
+
const { requireRole } = require('../middleware/role');
|
|
8
|
+
|
|
9
|
+
const router = express.Router();
|
|
10
|
+
|
|
11
|
+
router.use(protect);
|
|
12
|
+
|
|
13
|
+
router.get('/', getMedicalReports);
|
|
14
|
+
router.post('/', requireRole('doctor'), createMedicalReport);
|
|
15
|
+
|
|
16
|
+
module.exports = router;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const {
|
|
3
|
+
getPatients,
|
|
4
|
+
getPatient,
|
|
5
|
+
createPatient,
|
|
6
|
+
updatePatient,
|
|
7
|
+
deletePatient,
|
|
8
|
+
} = require('../controllers/patientController');
|
|
9
|
+
const { protect } = require('../middleware/auth');
|
|
10
|
+
const { requireRole } = require('../middleware/role');
|
|
11
|
+
|
|
12
|
+
const router = express.Router();
|
|
13
|
+
|
|
14
|
+
router.use(protect, requireRole('receptionist'));
|
|
15
|
+
|
|
16
|
+
router.get('/', getPatients);
|
|
17
|
+
router.get('/:id', getPatient);
|
|
18
|
+
router.post('/', createPatient);
|
|
19
|
+
router.put('/:id', updatePatient);
|
|
20
|
+
router.delete('/:id', deletePatient);
|
|
21
|
+
|
|
22
|
+
module.exports = router;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require('dotenv').config();
|
|
2
|
+
const express = require('express');
|
|
3
|
+
const cors = require('cors');
|
|
4
|
+
const { initDatabase } = require('./config/db');
|
|
5
|
+
const authRoutes = require('./routes/authRoutes');
|
|
6
|
+
const patientRoutes = require('./routes/patientRoutes');
|
|
7
|
+
const appointmentRoutes = require('./routes/appointmentRoutes');
|
|
8
|
+
const medicalReportRoutes = require('./routes/medicalReportRoutes');
|
|
9
|
+
const hospitalReportRoutes = require('./routes/hospitalReportRoutes');
|
|
10
|
+
const healthRoutes = require('./routes/healthRoutes');
|
|
11
|
+
const { notFound, errorHandler } = require('./middleware/errorHandler');
|
|
12
|
+
|
|
13
|
+
const app = express();
|
|
14
|
+
|
|
15
|
+
app.use(
|
|
16
|
+
cors({
|
|
17
|
+
origin: process.env.CLIENT_URL || 'http://localhost:5173',
|
|
18
|
+
}),
|
|
19
|
+
);
|
|
20
|
+
app.use(express.json());
|
|
21
|
+
|
|
22
|
+
app.use('/api/health', healthRoutes);
|
|
23
|
+
app.use('/api/auth', authRoutes);
|
|
24
|
+
app.use('/api/patients', patientRoutes);
|
|
25
|
+
app.use('/api/appointments', appointmentRoutes);
|
|
26
|
+
app.use('/api/medical-reports', medicalReportRoutes);
|
|
27
|
+
app.use('/api/reports', hospitalReportRoutes);
|
|
28
|
+
|
|
29
|
+
app.use(notFound);
|
|
30
|
+
app.use(errorHandler);
|
|
31
|
+
|
|
32
|
+
const PORT = process.env.PORT || 5000;
|
|
33
|
+
|
|
34
|
+
async function startServer() {
|
|
35
|
+
try {
|
|
36
|
+
await initDatabase();
|
|
37
|
+
app.listen(PORT, () => {
|
|
38
|
+
console.log(`King Faisal Hospital API running on http://localhost:${PORT}`);
|
|
39
|
+
});
|
|
40
|
+
} catch (err) {
|
|
41
|
+
console.error('Failed to start server:', err.message || err);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
startServer();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VITE_API_URL=http://localhost:5000/api
|