diff --git a/.gitignore b/.gitignore index c7eb341..df503d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ node_modules/ tokens/ -package-lock.json -dist/ \ No newline at end of file +package-lock.json \ No newline at end of file diff --git a/app/Dockerfile b/app/Dockerfile deleted file mode 100644 index 85f56f4..0000000 --- a/app/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM node -WORKDIR /app -COPY . . -WORKDIR /app/client -RUN npm install --silent -RUN npm run build -WORKDIR /app -RUN npm install --silent -CMD npm start \ No newline at end of file diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..9ece736 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,5 @@ +FROM node +WORKDIR /app +COPY . . +RUN npm install --silent +CMD npm start \ No newline at end of file diff --git a/app/app.js b/backend/app.js similarity index 62% rename from app/app.js rename to backend/app.js index d123cc8..e0d090b 100644 --- a/app/app.js +++ b/backend/app.js @@ -1,7 +1,11 @@ const express = require("express"); const app = express(); -const port = 5000; -app.use(express.static("client/dist")); +const port = 5001; + +app.get("/", (req, res) => { + res.send("Backend Working"); +}); + app.listen(port, () => { console.log(`Backend Working at http://localhost:${port}`); -}); \ No newline at end of file +}); diff --git a/app/package.json b/backend/package.json similarity index 99% rename from app/package.json rename to backend/package.json index c2f68e3..0802d9c 100644 --- a/app/package.json +++ b/backend/package.json @@ -9,4 +9,4 @@ "@wppconnect-team/wppconnect": "^1.30.1", "express": "^4.19.2" } -} \ No newline at end of file +} diff --git a/app/wpp.js b/backend/wpp.js similarity index 100% rename from app/wpp.js rename to backend/wpp.js diff --git a/compose.yml b/compose.yml index bfefee1..2ac102a 100644 --- a/compose.yml +++ b/compose.yml @@ -1,23 +1,45 @@ version: '3.9' +networks: + webapp: + driver: bridge + database: + driver: bridge services: - ## APP ## - app: - container_name: app +## FRONTEND ## + frontend: + container_name: frontend build: - context: ./app + context: ./frontend + networks: + - webapp ports: - 5000:5000 depends_on: - - postgres + - backend + restart: always + ## BACKEND ## + backend: + container_name: backend + build: + context: ./backend + networks: + - webapp + - database + ports: + - 5001:5001 + depends_on: + - postgres_db restart: always ## POSTGRES ## - postgres: - container_name: postgres + postgres_db: + container_name: postgres_db image: postgres environment: - POSTGRES_USER=postgres_user - POSTGRES_PASSWORD=postgres_password - - POSTGRES_DB=postgres + - POSTGRES_DB=postgres_db volumes: - - ./app/database:/docker-entrypoint-initdb.d + - ./database:/docker-entrypoint-initdb.d + networks: + - database restart: always \ No newline at end of file diff --git a/app/database/00_schema.sql b/database/00_schema.sql similarity index 100% rename from app/database/00_schema.sql rename to database/00_schema.sql diff --git a/app/database/01_seed.sql b/database/01_seed.sql similarity index 100% rename from app/database/01_seed.sql rename to database/01_seed.sql diff --git a/app/client/.gitignore b/frontend/.gitignore similarity index 100% rename from app/client/.gitignore rename to frontend/.gitignore diff --git a/app/client/.vscode/extensions.json b/frontend/.vscode/extensions.json similarity index 100% rename from app/client/.vscode/extensions.json rename to frontend/.vscode/extensions.json diff --git a/app/client/Dockerfile b/frontend/Dockerfile similarity index 100% rename from app/client/Dockerfile rename to frontend/Dockerfile diff --git a/app/client/README.md b/frontend/README.md similarity index 100% rename from app/client/README.md rename to frontend/README.md diff --git a/app/client/index.html b/frontend/index.html similarity index 100% rename from app/client/index.html rename to frontend/index.html diff --git a/app/client/jsconfig.json b/frontend/jsconfig.json similarity index 100% rename from app/client/jsconfig.json rename to frontend/jsconfig.json diff --git a/app/client/package.json b/frontend/package.json similarity index 100% rename from app/client/package.json rename to frontend/package.json diff --git a/app/client/postcss.config.js b/frontend/postcss.config.js similarity index 100% rename from app/client/postcss.config.js rename to frontend/postcss.config.js diff --git a/app/client/public/favicon.ico b/frontend/public/favicon.ico similarity index 100% rename from app/client/public/favicon.ico rename to frontend/public/favicon.ico diff --git a/app/client/src/App.vue b/frontend/src/App.vue similarity index 100% rename from app/client/src/App.vue rename to frontend/src/App.vue diff --git a/app/client/src/assets/base.css b/frontend/src/assets/base.css similarity index 100% rename from app/client/src/assets/base.css rename to frontend/src/assets/base.css diff --git a/app/client/src/assets/logo.svg b/frontend/src/assets/logo.svg similarity index 100% rename from app/client/src/assets/logo.svg rename to frontend/src/assets/logo.svg diff --git a/app/client/src/assets/main.css b/frontend/src/assets/main.css similarity index 100% rename from app/client/src/assets/main.css rename to frontend/src/assets/main.css diff --git a/app/client/src/components/HelloWorld.vue b/frontend/src/components/HelloWorld.vue similarity index 100% rename from app/client/src/components/HelloWorld.vue rename to frontend/src/components/HelloWorld.vue diff --git a/app/client/src/components/TheWelcome.vue b/frontend/src/components/TheWelcome.vue similarity index 100% rename from app/client/src/components/TheWelcome.vue rename to frontend/src/components/TheWelcome.vue diff --git a/app/client/src/components/WelcomeItem.vue b/frontend/src/components/WelcomeItem.vue similarity index 100% rename from app/client/src/components/WelcomeItem.vue rename to frontend/src/components/WelcomeItem.vue diff --git a/app/client/src/components/icons/IconCommunity.vue b/frontend/src/components/icons/IconCommunity.vue similarity index 100% rename from app/client/src/components/icons/IconCommunity.vue rename to frontend/src/components/icons/IconCommunity.vue diff --git a/app/client/src/components/icons/IconDocumentation.vue b/frontend/src/components/icons/IconDocumentation.vue similarity index 100% rename from app/client/src/components/icons/IconDocumentation.vue rename to frontend/src/components/icons/IconDocumentation.vue diff --git a/app/client/src/components/icons/IconEcosystem.vue b/frontend/src/components/icons/IconEcosystem.vue similarity index 100% rename from app/client/src/components/icons/IconEcosystem.vue rename to frontend/src/components/icons/IconEcosystem.vue diff --git a/app/client/src/components/icons/IconSupport.vue b/frontend/src/components/icons/IconSupport.vue similarity index 100% rename from app/client/src/components/icons/IconSupport.vue rename to frontend/src/components/icons/IconSupport.vue diff --git a/app/client/src/components/icons/IconTooling.vue b/frontend/src/components/icons/IconTooling.vue similarity index 100% rename from app/client/src/components/icons/IconTooling.vue rename to frontend/src/components/icons/IconTooling.vue diff --git a/app/client/src/main.js b/frontend/src/main.js similarity index 100% rename from app/client/src/main.js rename to frontend/src/main.js diff --git a/app/client/src/router/index.js b/frontend/src/router/index.js similarity index 100% rename from app/client/src/router/index.js rename to frontend/src/router/index.js diff --git a/app/client/src/views/AboutView.vue b/frontend/src/views/AboutView.vue similarity index 100% rename from app/client/src/views/AboutView.vue rename to frontend/src/views/AboutView.vue diff --git a/app/client/src/views/HomeView.vue b/frontend/src/views/HomeView.vue similarity index 100% rename from app/client/src/views/HomeView.vue rename to frontend/src/views/HomeView.vue diff --git a/app/client/src/views/InicioView.vue b/frontend/src/views/InicioView.vue similarity index 100% rename from app/client/src/views/InicioView.vue rename to frontend/src/views/InicioView.vue diff --git a/app/client/src/views/LoginView.vue b/frontend/src/views/LoginView.vue similarity index 100% rename from app/client/src/views/LoginView.vue rename to frontend/src/views/LoginView.vue diff --git a/app/client/tailwind.config.js b/frontend/tailwind.config.js similarity index 100% rename from app/client/tailwind.config.js rename to frontend/tailwind.config.js diff --git a/app/client/vite.config.js b/frontend/vite.config.js similarity index 100% rename from app/client/vite.config.js rename to frontend/vite.config.js