create base project

This commit is contained in:
NekoVari 2023-09-13 23:20:53 +07:00
parent 2b46f7c3ce
commit 24e7aa1ad0
9 changed files with 1566 additions and 0 deletions

27
.gitignore vendored Normal file
View file

@ -0,0 +1,27 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
#env
.env

0
config/dbConnection.js Normal file
View file

View file

0
models/user.js Normal file
View file

1496
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

28
package.json Normal file
View file

@ -0,0 +1,28 @@
{
"name": "backend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "nodemon server.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.20.2",
"cookie-session": "^2.0.0",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"express-async-handler": "^1.2.0",
"express-session": "^1.17.3",
"jsonwebtoken": "^9.0.2",
"mongoose": "^7.5.1",
"nodemon": "^3.0.1",
"validator": "^13.11.0"
}
}

0
routes/user.js Normal file
View file

15
server.js Normal file
View file

@ -0,0 +1,15 @@
const express = require("express");
const app = express();
const cors = require('cors');
const dotenv = require("dotenv").config();
const connectDb = require('./config/dbConnection');
app.use(express.json());
app.use(cors());
app.listen(process.env.PORT, () => {
console.log(`server's running on port ${process.env.PORT}`);
})
connectDb();

0
utils/jwtToken.js Normal file
View file