Skip to content

Commit

Permalink
Merge pull request #28 from rotirk20/development
Browse files Browse the repository at this point in the history
Frontend and Backend bigger changes
  • Loading branch information
rotirk20 authored Oct 18, 2024
2 parents 6990cb5 + 04e1bd2 commit f0b4536
Show file tree
Hide file tree
Showing 108 changed files with 2,197 additions and 1,443 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
# Copy Backend Files to VM using scp
- name: Copy Backend to VM
run: |
scp -v -o StrictHostKeyChecking=no -r ./backend/* ${{ secrets.VM_USER }}@${{ secrets.VM_IP }}:~/smetovi/backend
scp -o StrictHostKeyChecking=no -r ./backend/* ${{ secrets.VM_USER }}@${{ secrets.VM_IP }}:~/smetovi/backend
# Restart Node.js Backend on VM
- name: Restart Backend on VM
Expand Down
16 changes: 11 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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>/**"
Expand Down
113 changes: 113 additions & 0 deletions backend/.gitignore
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*
95 changes: 0 additions & 95 deletions backend/api_test/locations_enpoints.http

This file was deleted.

30 changes: 18 additions & 12 deletions backend/config/db.js
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 };
107 changes: 0 additions & 107 deletions backend/config/dbInit.js

This file was deleted.

Loading

0 comments on commit f0b4536

Please sign in to comment.