Skip to content

Commit

Permalink
migrate auth to backend and remove old server
Browse files Browse the repository at this point in the history
  • Loading branch information
younes200 committed Oct 23, 2023
1 parent 733cb99 commit 9262321
Show file tree
Hide file tree
Showing 123 changed files with 2,384 additions and 5,497 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,6 @@ jobs:
APP=admin
START_COMMAND=start
- name: Build Server
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}/server:${{ github.event.inputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
COMMIT=${{ steps.vars.outputs.sha_short }}
APP=server
START_COMMAND=start
- name: Build Frontend
uses: docker/build-push-action@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ dist/

.vscode
.backups
.ethereal
Binary file modified .yarn/install-state.gz
Binary file not shown.
2 changes: 0 additions & 2 deletions apps/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { openApiDocument } from './openapi';

const trpcApiEndpoint = '/trpc'


async function main() {
// express implementation
const app = express();
Expand Down Expand Up @@ -48,7 +47,6 @@ async function main() {
createContext: createRPCContext,
}),
);

// Handle incoming OpenAPI requests
app.use('/api', createOpenApiExpressMiddleware({ router: appRouter, createContext: createRPCContext }));

Expand Down
3 changes: 0 additions & 3 deletions apps/frontend/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
],
"~/*": [
"src/*"
],
"~login/*": [
"src/components/login/*"
]
}
}
Expand Down
10 changes: 2 additions & 8 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@mui/lab": "^5.0.0-alpha.148",
"@mui/material": "^5.14.13",
"@mui/styles": "^5.14.13",
"@reduxjs/toolkit": "^1.8.6",
"@tanstack/react-query": "^4.36.1",
"@trpc/client": "^10.40.0",
"@trpc/react-query": "^10.40.0",
Expand All @@ -42,7 +41,6 @@
"autosuggest-highlight": "^3.3.4",
"axios": "^1.3.4",
"change-case": "^4.1.2",
"connected-react-router": "6.9.3",
"copy-to-clipboard": "^3.3.3",
"dayjs": "^1.11.10",
"enzyme": "^3.3.0",
Expand All @@ -61,7 +59,6 @@
"notistack": "^3.0.1",
"passport": "^0.6.0",
"passport-local": "^1.0.0",
"prop-types": "^15.6.2",
"query-string": "^6.1.0",
"ramda": "^0.28.0",
"randomcolor": "^0.5.3",
Expand All @@ -73,21 +70,18 @@
"react-error-boundary": "^4.0.11",
"react-full-screen": "^0.2.2",
"react-i18next": "^13.2.2",
"react-redux": "^8.0.4",
"react-router": "^6.17.0",
"react-router-dom": "^6.17.0",
"react-scripts": "5.0.1",
"react-transition-group": "^2.3.1",
"react-use-event": "^1.1.1",
"recoil": "^0.7.7",
"redux": "^4.0.0",
"redux-devtools-extension": "^2.13.5",
"redux-thunk": "^2.3.0",
"rooks": "^7.4.1",
"serve": "^14.2.1",
"shiitake": "^3.0.2",
"typescript": "^5.2.2",
"yup": "^1.3.2"
"yup": "^1.3.2",
"yup-locales": "^1.2.18"
},
"browserslist": {
"production": [
Expand Down
73 changes: 40 additions & 33 deletions apps/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,25 @@ import { ConfirmProvider } from "material-ui-confirm";
import { SnackbarProvider } from "notistack";
import React, { Suspense, useState } from "react";
import { initReactI18next } from "react-i18next";
import { Provider } from "react-redux";
import { BrowserRouter, Route, Routes, useLocation } from "react-router-dom";
import { RecoilRoot } from "recoil";
import { setLocale } from "yup";
import { fr } from "yup-locales";

import { LogintDialog } from "~components/LoginDialog";
import { ConfirmDialog } from "~components/login/ConfirmDialog";
import { ForgotDialog } from "~components/login/ForgotDialog";
import { JoinDialog } from "~components/login/JoinDialog";
import { LoginDialog } from "~components/login/LoginDialog";
import { RecoverDialog } from "~components/login/RecoverDialog";
import { SignupDialog } from "~components/login/SignupDialog";
import { StudentSignupDialog } from "~components/login/StudentSignupDialog";
import { SharedLayout } from "~components/SharedLayout";
import { SignupDialog } from "~components/SignupDialog";
import { trpc } from "~utils/trpc";

import ResetScroll from "./components/ResetScroll";
import UpdateIndicator from "./components/UpdateIndicator";
// import { ConnectedRouter } from "connected-react-router";
import en from "./locales/en/common.json";
import fr from "./locales/fr/common.json";
import { UpdateIndicator } from "./components/UpdateIndicator";
import commonEN from "./locales/en/common.json";
import commonFR from "./locales/fr/common.json";
import { About } from "./pages/about";
import { CreateProjectPage } from "./pages/create";
import { HomePage } from "./pages/home";
Expand All @@ -35,25 +40,26 @@ import UserProfile from "./pages/profile";
import ProjectPage from "./pages/project";
import { SharePage } from "./pages/share";
import { TermsAndConditions } from "./pages/terms";
import createAppStore from "./store";
import { createTheme } from "./theme";

dayjs.extend(relativeTime);
dayjs.extend(isLeapYear); // use plugin
dayjs.extend(duration);
dayjs.locale("fr-fr"); // use locale

setLocale(fr);

i18next
.use(LanguageDetector)
.use(initReactI18next)
.init({
debug: false,
resources: {
en_US: {
translations: en,
translations: commonEN,
},
fr_FR: {
translations: fr,
translations: commonFR,
},
},
ns: ["translations"],
Expand All @@ -64,8 +70,6 @@ i18next
},
} as i18next.InitOptions);

const store = createAppStore();

const AppRouters = () => {
const location = useLocation();
const { state } = location;
Expand All @@ -88,8 +92,13 @@ const AppRouters = () => {
</Routes>
{state?.backgroundLocation && (
<Routes>
<Route path="login" element={<LogintDialog />} />
<Route path="login" element={<LoginDialog />} />
<Route path="forgot" element={<ForgotDialog />} />
<Route path="recover" element={<RecoverDialog />} />
<Route path="confirm" element={<ConfirmDialog />} />
<Route path="signup" element={<SignupDialog />} />
<Route path="signup-student" element={<StudentSignupDialog />} />
<Route path="join" element={<JoinDialog />} />
</Routes>
)}
</div>
Expand All @@ -116,28 +125,26 @@ const App = () => {
return (
<Suspense fallback="loading">
<RecoilRoot>
<Provider store={store}>
<ThemeProvider theme={createTheme()}>
<CssBaseline />
<SnackbarProvider maxSnack={3}>
<trpc.Provider client={trpcClient} queryClient={queryClient}>
<QueryClientProvider client={queryClient}>
<ConfirmProvider>
<ThemeProvider theme={createTheme()}>
<CssBaseline />
<SnackbarProvider maxSnack={3}>
<trpc.Provider client={trpcClient} queryClient={queryClient}>
<QueryClientProvider client={queryClient}>
<ConfirmProvider>
<React.Fragment>
<React.Fragment>
<React.Fragment>
<UpdateIndicator />
<BrowserRouter>
<ResetScroll />
<AppRouters />
</BrowserRouter>
</React.Fragment>
<UpdateIndicator />
<BrowserRouter>
<ResetScroll />
<AppRouters />
</BrowserRouter>
</React.Fragment>
</ConfirmProvider>
</QueryClientProvider>
</trpc.Provider>
</SnackbarProvider>
</ThemeProvider>
</Provider>
</React.Fragment>
</ConfirmProvider>
</QueryClientProvider>
</trpc.Provider>
</SnackbarProvider>
</ThemeProvider>
</RecoilRoot>
</Suspense>
);
Expand Down
4 changes: 0 additions & 4 deletions apps/frontend/src/actions/AppActions.tsx

This file was deleted.

42 changes: 0 additions & 42 deletions apps/frontend/src/actions/Signin/LoginActions.tsx

This file was deleted.

66 changes: 0 additions & 66 deletions apps/frontend/src/actions/Signin/ResetPasswordActions.tsx

This file was deleted.

Loading

0 comments on commit 9262321

Please sign in to comment.