Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Underdogs.pptx
Binary file not shown.
14 changes: 14 additions & 0 deletions Underdogs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Patient DB Manager
Team - Underdogs

DESCRIPTION
Our web app provides features to make establishment management easier and efficient for medical practitioners. It functions as a health data record for patients.

The project is still very much a work in progress.

.env variables -
DB_CONNECT
TOKEN_SECRET



1 change: 1 addition & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# PatientDB-prototype
40 changes: 40 additions & 0 deletions backend/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const express = require("express");
const mongoose = require("mongoose");
const dotenv = require("dotenv");
const cors = require("cors");

//Import Routes
const postRoute = require("./routes/posts");
const authRoute = require("./routes/auth");
const doctorAuthRoute = require("./routes/doctorAuth");

//dotenv
dotenv.config();

//Create Express App
const app = express();

//Connect to MongoDB
mongoose.connect(
process.env.DB_CONNECT,
{ useNewUrlParser: true, useUnifiedTopology: true },
() => console.log("Connected to mongodb server")
);

//Middlewares
app.use(express.json());
app.use(cors());
app.use("/posts", postRoute);
app.use("/api/user", authRoute);
app.use("/api/doctor", doctorAuthRoute);

//Routes
app.get("/", (req, res) => {
res.send("We are at home");
});

//Listen
const port = process.env.PORT || 5000;
app.listen(port, () => {
console.log(`Listening to http://localhost:${port}`);
});
35 changes: 35 additions & 0 deletions backend/models/Doctors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const { boolean, bool } = require("joi");
const mongoose = require("mongoose");

const doctorSchema = mongoose.Schema({
name: {
type: String,
required: true,
min: 2,
max: 255,
},
email: {
type: String,
required: true,
min: 2,
max: 255,
},
address: {
type: String,
max: 255,
},
specialization: {
type: String,
required: true,
min: 2,
max: 255,
},
password: {
type: String,
required: true,
min: 8,
max: 1024,
},
});

module.exports = mongoose.model("Doctor", doctorSchema);
24 changes: 24 additions & 0 deletions backend/models/User.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const mongoose = require("mongoose");

const userSchema = mongoose.Schema({
name: {
type: String,
required: true,
min: 2,
max: 255,
},
email: {
type: String,
required: true,
min: 2,
max: 255,
},
password: {
type: String,
required: true,
min: 8,
max: 1024,
},
});

module.exports = mongoose.model("User", userSchema);
Loading