Skip to content

Commit

Permalink
Merge pull request #10 from chimobi-justice/auth-api
Browse files Browse the repository at this point in the history
integrated with  auth api
  • Loading branch information
chimobi-justice authored Jul 30, 2024
2 parents a16d5fa + e0fa979 commit 9f3c1d0
Show file tree
Hide file tree
Showing 34 changed files with 825 additions and 167 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL=http://learn-hub-backend.test/api/v1
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL=
209 changes: 208 additions & 1 deletion package-lock.json

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

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@tanstack/react-query": "^5.50.1",
"axios": "^1.7.2",
"formik": "^2.4.6",
"framer-motion": "^11.2.13",
"highlight.js": "^11.10.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.2.1",
"react-markdown": "^9.0.1",
"react-quill": "^2.0.0",
"react-router-dom": "^6.24.1"
"react-router-dom": "^6.24.1",
"react-toastify": "^10.0.5",
"yup": "^1.4.0"
},
"devDependencies": {
"@types/react": "^18.3.3",
Expand Down
15 changes: 9 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import UserViews from '@pages/Users/UserViews'

import Login from '@pages/Auth/Login'
import Register from '@pages/Auth/Register'
import PrivateRoutes from './Route/privateRoute'

const routes = createBrowserRouter(
createRoutesFromElements(
Expand All @@ -29,15 +30,17 @@ const routes = createBrowserRouter(
<Route index path='/' element={<Home />} />
<Route index path='/forum' element={<Forum />} />
<Route index path='/forum/:slug' element={<ShowForum />} />
<Route index path='/forum/new' element={<CreateForum />} />

<Route index path='/articles' element={<Articles />} />
<Route index path='/articles/:slug' element={<ShowArticle />} />
<Route index path='/articles/new' element={<CreateArticle />} />

<Route index path='/me/:username' element={<Profile />} />
<Route index path='/me/settings/account/edit' element={<ProfileEdit />} />
<Route index path='/me/views/:username' element={<UserViews />} />
{/* private route */}
<Route path="/articles/new" element={<PrivateRoutes element={<CreateArticle />} />} />
<Route path="/forum/new" element={<PrivateRoutes element={<CreateForum />} />} />
<Route path="/me/:username" element={<PrivateRoutes element={<Profile />} />} />
<Route path="/me/settings/account/edit" element={<PrivateRoutes element={<ProfileEdit />} />} />
<Route path="/me/views/:username" element={<PrivateRoutes element={<UserViews />} />} />
{/* end private route */}

<Route index path='/auth/login' element={<Login />} />
<Route index path='/auth/register' element={<Register />} />
Expand All @@ -50,7 +53,7 @@ const routes = createBrowserRouter(

const App = () => {
return (
<RouterProvider router={routes}/>
<RouterProvider router={routes} />
)
}

Expand Down
Loading

0 comments on commit 9f3c1d0

Please sign in to comment.