diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml
new file mode 100644
index 0000000..10be08e
--- /dev/null
+++ b/.github/workflows/workflow.yaml
@@ -0,0 +1,20 @@
+
+name: Continuos Integration
+
+on: pull_request
+
+jobs:
+ continuos-integration:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Using Node.js
+ uses: actions/setup-node@v2
+ with:
+ node-version: 16.
+ - name: run install and dev
+ run: |
+ npm install
+ npm run dev
+
diff --git a/.gitignore b/.gitignore
index 9d8f737..fadc622 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
.env
node_modules
routes
-yarn.lock
\ No newline at end of file
+yarn.lock
+package-lock.json
diff --git a/package.json b/package.json
index 510cc97..eabe0fb 100644
--- a/package.json
+++ b/package.json
@@ -12,6 +12,7 @@
"dotenv": "^16.3.1",
"express": "^4.18.2",
"express-handlebars": "^7.1.2",
+ "mongodb": "^6.5.0",
"nodemon": "^3.0.2"
}
}
diff --git a/src/main.js b/src/main.js
index 7ecea99..59c7671 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,7 +1,7 @@
const express = require("express");
const { engine } = require("express-handlebars");
const dotenv = require("dotenv");
-
+const { MongoClient } = require("mongodb");
// set config
let app = express();
app.engine("handlebars", engine());
@@ -10,23 +10,56 @@ app.set("views", __dirname+"/views");
dotenv.config();
app.use(express.static(__dirname+"/static"));
-app.get("/", (req, res) => {
- res.render("index", {layout: false});
+async function getProducts(){
+ let client = new MongoClient(process.env.MONGO_URL);
+ let store = client.db("store");
+ let all = store.collection("cripto");
+ let data = await all.find({}).limit(15).toArray();
+ return data;
+}
+let data;
+
+
+getProducts().then(async (d) => {
+ data = d;
+});
+
+
+app.get("/", async (req, res) => {
+ console.log(data);
+ if(data.length == 0){
+ res.render("error", {layout: false});
+ }else {
+ res.render("index", {layout: false, data: data});
+ }
});
app.get("/about", (req, res) => {
res.render("about", {layout: false});
});
-app.get("/account", (req, res)=> {
- res.render("account", {layout: false});
+app.get("/create", (req, res)=> {
+ res.render("create", {layout: false});
+});
+app.get("/login", (req, res)=> {
+ res.render("login", {layout: false});
});
app.get("/buy", (req, res) => {
res.render("temp", {layout: false});
});
-app.listen(Number(process.env.PORT), process.env.HOST, () => {
+app.post("/create", (req, res) => {
+ let user = req.query;
+ console.log(user);
+});
+app.get("/check", (req, res) => {
+ res.send("Teste").end()
+})
+
+app.listen(Number(8080),"localhost", () => {
console.log(`Listerner in http://${process.env.HOST}:${process.env.PORT}`)
});
+
+
module.exports = app;
\ No newline at end of file
diff --git a/src/static/css/global.css b/src/static/css/global.css
index 28d6e2d..5a7d46e 100644
--- a/src/static/css/global.css
+++ b/src/static/css/global.css
@@ -12,4 +12,23 @@ body {
#logo {
width: 50px;
+}
+
+.brand {
+ width: 50px;
+ margin-bottom: 10px;
+}
+.cripto {
+ font-size: 25pt;
+}
+
+header {
+ text-align: center;
+}
+
+#cart {
+ width: 50px;
+}
+#cart:hover {
+ cursor: pointer;
}
\ No newline at end of file
diff --git a/src/static/css/index.css b/src/static/css/index.css
index ca969fe..798e1ae 100644
--- a/src/static/css/index.css
+++ b/src/static/css/index.css
@@ -6,46 +6,39 @@ article {
border-radius: 15px;
background-color: #646E78;
}
-img {
- display: block;
- width: 10vw;
-}
-
-.btn {
- display: block;
- margin-top: 5px;
- width: 100%;
- background-color: #8D98A7;
- color: #fff;
- font-size: 15pt;
- font-family: Arial, Helvetica, sans-serif;
-}
label {
font-size: 15pt;
}
-#add {
- font-size: 150pt;
- background-color: #646E78;
- color: #fff;
- width: 25vw;
- height: 41vh;
+nav {
+ width: 100vw;
}
-#add > img {
- width: 80%;
+.product {
+ list-style: none;
}
-#logo {
- width: 50px;
+ul {
+ margin: 0;
+ padding: 0;
}
-p, label {
+.product {
+ background-color: #464B52;
+ width: 300px;
+ padding: 15px;
+ margin: 10px;
+ border-radius: 15px;
font-size: 15pt;
color: #fff;
}
-.exclude {
- text-decoration: line-through;
-}
\ No newline at end of file
+.product .name {
+ font-size: 25pt;
+}
+
+.product img {
+ width: 90%;
+ border-radius: 15px;
+}
diff --git a/src/static/img/CurseForge - Installer.exe b/src/static/img/CurseForge - Installer.exe
deleted file mode 100644
index 48e9ba8..0000000
Binary files a/src/static/img/CurseForge - Installer.exe and /dev/null differ
diff --git a/src/static/img/add.png b/src/static/img/add.png
deleted file mode 100644
index c6b3c56..0000000
Binary files a/src/static/img/add.png and /dev/null differ
diff --git a/src/static/img/cart.png b/src/static/img/cart.png
new file mode 100644
index 0000000..3e63d5d
Binary files /dev/null and b/src/static/img/cart.png differ
diff --git a/src/static/script.js b/src/static/script.js
new file mode 100644
index 0000000..d2622ba
--- /dev/null
+++ b/src/static/script.js
@@ -0,0 +1,5 @@
+const cart = document.querySelector("#cart");
+
+cart.addEventListener("click", () => {
+ window.location.href = "/deploy"
+});
\ No newline at end of file
diff --git a/src/views/about.handlebars b/src/views/about.handlebars
index f133d07..a44e7fe 100644
--- a/src/views/about.handlebars
+++ b/src/views/about.handlebars
@@ -1,78 +1,94 @@
-
-
-
-
-
-
-
-
- Sobre Nós
-
-
-
-
-
-
-
-
-
Quem Somos
-
- Somos estudantes do curso de Desenvolvimento de Sistemas na Instituição Proz Educação,
- localizada em Belo Horizonte, Minas Gerais.
- Nosso site tem como foco principal compra e venda de moedas.
-
-
-
-
- Informaçoes uteis
- O site foi feito utilizando bootstrap, mas tecnologias basicas e semanticas do html e css
-
-
-
-
- Site feito por Joao Vitor Soares dos Reis
- Site feito por Eduardo Oliveira Delo Bócio
- Site feito por Adalberto França
- Site feito por Esheley
- Site feito por Guilherme
- Visite o Repositorio Oficial
+
+
+
+
+
+
+
+
+ Sobre Nós
+
+
+
+
+
+ Cripto Store
+
+
+
+
+
+
+
+
+
+
+
+
Quem Somos
+
+ Somos estudantes do curso de Desenvolvimento de Sistemas na Instituição Proz Educação,
+ localizada em Belo Horizonte, Minas Gerais.
+ Nosso site tem como foco principal compra e venda de moedas.
+
+
+
+
+ Informaçoes uteis
+ O site foi feito utilizando bootstrap, mas tecnologias basicas e semanticas do html e css
+
+
+
+
+
+
- © 2023 Cripto Store
-
-
-
-
\ No newline at end of file
diff --git a/src/views/account.handlebars b/src/views/account.handlebars
deleted file mode 100644
index a00f51f..0000000
--- a/src/views/account.handlebars
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-
-
- Formulário de cadastro
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/views/create.handlebars b/src/views/create.handlebars
new file mode 100644
index 0000000..b32a4be
--- /dev/null
+++ b/src/views/create.handlebars
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+ Formulário de cadastro
+
+
+
+
+
+ Cripto Store
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/error.handlebars b/src/views/error.handlebars
new file mode 100644
index 0000000..9f9a1de
--- /dev/null
+++ b/src/views/error.handlebars
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cripto Store - Home - 5% off
+
+
+
+
+
+ Cripto Store
+
+
+
+
+
+
+
+
+ Erro No servidor por favor volte mais tarde
+
+
diff --git a/src/views/index.handlebars b/src/views/index.handlebars
index 6c30781..ab4723b 100644
--- a/src/views/index.handlebars
+++ b/src/views/index.handlebars
@@ -1,129 +1,81 @@
-
-
-
-
-
-
-
-
-
-
- Cripto Store - Home - 5% off
-
-
-
-
-
-
- Cripto Store
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ Cripto Store - Home - 5% off
+
+
+
+
+
+
+ Cripto Store
+
+
+
+
+
+
+
+
+
+
+
+ {{#each data}}
-
-
-
+
+ {{this.name}}
+ R$ {{this.price}}
+
+
-
+ {{/each}}
-
-
-
-
+
+
+
+
+