Skip to content

Commit

Permalink
Merge pull request #1 from joeyyy09/revamp-dev
Browse files Browse the repository at this point in the history
PassMan v2
  • Loading branch information
joeyyy09 authored Nov 18, 2024
2 parents e1976ac + 0107190 commit a7e28f3
Show file tree
Hide file tree
Showing 27 changed files with 1,116 additions and 1,228 deletions.
3 changes: 2 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/node_modules
.env
.env
.vercel
2 changes: 1 addition & 1 deletion backend/controllers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const client = require("../configs/redis");
const NodeRSA = require("node-rsa");
const nodemailer = require("nodemailer");
const key = new NodeRSA({ b: 1024 });
const URL = "http://localhost:3300";
const URL = "https://passman-backend-seven.vercel.app";

// generating accessToken
const accessTokenGenerator = (user) => {
Expand Down
6 changes: 5 additions & 1 deletion backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ app.use(express.json());
app.use(
cors({
credentials: true,
origin: "http://localhost:3000",
origin: "https://passmannn.vercel.app",
})
);

app.use("/auth", authRoutes);
app.use("/pass", passRoutes);
// app.use("/key", keyRoutes);

app.get("/", (req, res) => {
res.send("Backend is running");
});

const PORT = process.env.PORT || 3300;

mongoose.set("strictQuery", false);
Expand Down
20 changes: 20 additions & 0 deletions backend/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 2,
"builds": [
{
"src": "index.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/index.js"
}
],
"env": {
"DB_URL": "mongodb+srv://yushmanth:S77SdrxaewVbNwjf@cluster0.a3z65xb.mongodb.net/?retryWrites=true&w=majority",
"JWT_ACCESS_KEY": "hello world",
"JWT_REFRESH_KEY": "HKJSHJDHSAJK ASHKJHSDJKA"
}
}
1 change: 1 addition & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vercel
92 changes: 92 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"assert": "^2.0.0",
"axios": "^1.3.2",
"buffer": "^6.0.3",
"jwt-decode": "^3.1.2",
"lucide-react": "^0.446.0",
"node-rsa": "^1.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.3.0",
"react-router-dom": "^6.8.1",
"react-scripts": "5.0.1",
"react-toastify": "^10.0.5",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
Binary file removed frontend/public/comp_1.gif
Binary file not shown.
Binary file added frontend/public/hero-vector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="spinner" class="con">
<img style="max-width: 30%; height: auto" src="comp_1.gif" />
</div>
<div id="root"></div>
<!--
This HTML file is a template.
Expand Down
38 changes: 26 additions & 12 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ import {
Navigate,
} from "react-router-dom";
import Home from "./pages/home";
import AddPassword from "./pages/appPassword";
import AddPassword from "./pages/addPassword";
import PrivateKey from "./pages/privateKey";
import Signin from "./pages/signin";
import SignUp from "./pages/signup";
import AllPasswords from "./pages/allPassword";
import { useEffect, useState } from "react";
import ProtectedRoute from "./utils/ProtectedRoutes";
// import ProtectedRoute from "./utils/ProtectedRoutes";
import EditPassword from "./pages/editPassword";
import LandingPage from "./pages/landingPage";
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css"; // Import the CSS

function App() {
const [loading, setLoading] = useState(true);
Expand All @@ -35,6 +37,18 @@ function App() {
return (
<BrowserRouter>
<main>
<ToastContainer
position="top-right"
autoClose={5000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover
theme="colored"
/>
<Routes>
<Route exact path="/" element={<LandingPage />} />
<Route
Expand All @@ -54,46 +68,46 @@ function App() {
<Route
path="/home"
element={
<ProtectedRoute>
// <ProtectedRoute>
<Home />
</ProtectedRoute>
// </ProtectedRoute>
}
/>
<Route
path="/privateKey"
element={
<ProtectedRoute>
// <ProtectedRoute>
<PrivateKey
setPrivateKey={setPrivateKey}
privateKey={privateKey}
/>
</ProtectedRoute>
// </ProtectedRoute>
}
/>
<Route
path="/addPassword"
element={
<ProtectedRoute>
// <ProtectedRoute>
<AddPassword />
</ProtectedRoute>
// </ProtectedRoute>
}
/>

<Route
path="/editPassword"
element={
<ProtectedRoute>
// <ProtectedRoute>
<EditPassword privateKey={privateKey} />
</ProtectedRoute>
// </ProtectedRoute>
}
/>

<Route
path="/allPasswords"
element={
<ProtectedRoute>
// <ProtectedRoute>
<AllPasswords privateKey={privateKey} />
</ProtectedRoute>
// </ProtectedRoute>
}
/>
</Routes>
Expand Down
Loading

0 comments on commit a7e28f3

Please sign in to comment.