Skip to content

Commit

Permalink
Add navbar and starter DB code
Browse files Browse the repository at this point in the history
  • Loading branch information
yumstar committed Jan 20, 2023
1 parent 8cd9e7c commit 3466f62
Show file tree
Hide file tree
Showing 20 changed files with 18,558 additions and 12,072 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

server/.env
# dependencies
/node_modules
server/node_modules
/.pnp
.pnp.js

Expand All @@ -21,3 +22,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
server/.env
26,990 changes: 14,936 additions & 12,054 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"bootstrap": "^5.2.3",
"mongoose": "^6.8.4",
"react": "^18.2.0",
"react-bootstrap": "^2.7.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.6.2",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Expand Down
33 changes: 33 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import app from "./server.js"
import mongodb from "mongodb"
import dotenv from "dotenv"
import mongoose from "mongoose"
dotenv.config()
// const dbClient = mongodb.MongoClient



function connectToDB() {
mongoose.connect(process.env.INVITATIONS_DB_URI,
{maxPoolSize: 10,useNewUrlParser: true}
)
const dbConnection = mongoose.connection
dbConnection.once('open', () => {
console.log("database connected");
})
}

const port = process.env.PORT || 8000
connectToDB();
app.listen(port, () => {
console.log(`App running on port: ${port}`)
})
// connectToDB()
// .catch(
// error => {console.log(err)}
// )
// .then(

// );


4 changes: 4 additions & 0 deletions server/models/contact.model.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import mongoose from "mongoose";
import contactSchema from "../schema/contact.schema.js"
const Contact = mongoose.model('Contact', contactSchema)
module.exports = Contact
3 changes: 3 additions & 0 deletions server/models/eventInfo.model.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import mongoose from "mongoose";
import eventInfoSchema from "../schema/contact.schema"
export const EventInfo = mongoose.model('Contact', eventInfoSchema)
Loading

0 comments on commit 3466f62

Please sign in to comment.