-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from rotirk20/development
Frontend and Backend bigger changes
- Loading branch information
Showing
108 changed files
with
2,197 additions
and
1,443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,17 @@ | |
"request": "launch", | ||
"name": "Launch Program", | ||
"env": { | ||
"DB_HOST": "localhost", | ||
"DB_USER": "root", | ||
"DB_PASSWORD": "", | ||
"DB_NAME": "smetovi", | ||
"PORT": "4001" | ||
"DATABASE_URL":"postgresql://neondb_owner:nekYVhH8Tzo6@ep-holy-moon-a5i4sdfw-pooler.us-east-2.aws.neon.tech/smetovi?sslmode=require", | ||
"JWT_SECRET":"mysueprsecret", | ||
"JWT_REFRESH_SECRET":"myrefreshsupersecret", | ||
"PORT":"4000", | ||
"SMTP_HOST":"mail.smetovi.ba", | ||
"SMTP_PORT":"465", | ||
"SMTP_USER":"[email protected]", | ||
"SMTP_PASS":"P8es3G[W=7m&", | ||
"DEFAULT_SENDER_EMAIL":"[email protected]", | ||
"DEFAULT_RECEIVER_EMAIL":"[email protected]", | ||
"DEFAULT_RECEIVER_NAME":"Smetovi" | ||
}, | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# Operating System Files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# Editor and IDE Files | ||
.vscode/ | ||
.idea/ | ||
*.swp | ||
*.swo | ||
*~ | ||
|
||
# Build and Dependency Directories | ||
node_modules/ | ||
build/ | ||
dist/ | ||
target/ | ||
out/ | ||
.next/ | ||
|
||
# Logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Environment Variables | ||
.env | ||
.env.local | ||
.env.*.local | ||
|
||
# Compiled Files | ||
*.com | ||
*.class | ||
*.dll | ||
*.exe | ||
*.o | ||
*.so | ||
|
||
# Package Files | ||
*.7z | ||
*.dmg | ||
*.gz | ||
*.iso | ||
*.jar | ||
*.rar | ||
*.tar | ||
*.zip | ||
|
||
# Database Files | ||
*.sqlite | ||
*.db | ||
|
||
# Temporary Files | ||
*.tmp | ||
*.temp | ||
*.bak | ||
|
||
# Python | ||
__pycache__/ | ||
*.py[cod] | ||
*.pyo | ||
*.egg-info/ | ||
.Python | ||
venv/ | ||
env/ | ||
|
||
# Java | ||
*.class | ||
*.jar | ||
*.war | ||
*.ear | ||
*.logs | ||
.gradle/ | ||
|
||
# JavaScript / Node.js | ||
npm-debug.log | ||
yarn-error.log | ||
.pnp/ | ||
.pnp.js | ||
|
||
# Ruby | ||
*.gem | ||
*.rbc | ||
/.config | ||
/coverage/ | ||
/InstalledFiles | ||
/pkg/ | ||
/spec/reports/ | ||
/spec/examples.txt | ||
/test/tmp/ | ||
/test/version_tmp/ | ||
/tmp/ | ||
|
||
# Miscellaneous | ||
*.bak | ||
*.swp | ||
*.swo | ||
*.swn | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db | ||
|
||
# Ignore Angular/Webpack cache and build files | ||
.cache/ | ||
*.cache | ||
*.log | ||
node_modules/ | ||
dist/ | ||
build/ | ||
webpack* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
const mysql = require("mysql2"); | ||
require("dotenv").config(); | ||
|
||
const pool = mysql.createPool({ | ||
host: process.env.DB_HOST, | ||
user: process.env.DB_USER, | ||
password: process.env.DB_PASSWORD, | ||
database: process.env.DB_NAME, | ||
waitForConnections: true, | ||
connectionLimit: 10, | ||
queueLimit: 0, | ||
const { Sequelize } = require('sequelize'); | ||
const dotenv = require('dotenv'); | ||
|
||
dotenv.config(); | ||
|
||
const sequelize = new Sequelize(process.env.DATABASE_URL, { | ||
dialect: 'postgres', | ||
logging: false, | ||
}); | ||
|
||
module.exports = pool.promise(); | ||
const connectDB = async () => { | ||
try { | ||
await sequelize.authenticate(); | ||
console.log('Connection has been established successfully.'); | ||
} catch (error) { | ||
console.error('Unable to connect to the database:', error); | ||
} | ||
}; | ||
|
||
module.exports = { sequelize, connectDB }; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.