Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,26 @@
| Add Elections API (Admin Only) | Delete Elections API (Admin Only) | Get Elections API |
| ------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------ |
| ![Landing](./readme/postman%20apis/add%20elections.png) | ![fsdaf](./readme/postman%20apis/delete%20elections.png) | ![fsdaf](./readme/postman%20apis/get%20elections'.png) |

<br><br>

### To login to the system:

A default admin user is available with the credentials:

email: test@example.com

password: 123456

Admins have full control over the system. They can:

- Create and manage elections
- Add candidate users
- Start and stop elections at any time

Despite their administrative privileges, admins can also participate in voting like regular users.

Candidates can:

- Create and update their campaign profiles
- Participate in elections as voters
2 changes: 1 addition & 1 deletion client/src/Utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const capitalizeTitle = (str) => {
.join(' ');
};

const BASE_URL = "http://127.0.0.1:8000";
const BASE_URL = "http://13.38.84.88:8000";
export default function getProfilePictureUrl(path) {
if (!path) return null;
return `${BASE_URL}/storage/${path}`;
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/PrivateRoute/index.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useContext } from "react";
import { Navigate } from "react-router-dom";
import { AuthContext } from "../Context/AuthorizationContext";
import Loading from "../Loading";

const PrivateRoute = ({ children }) => {
const { user, authLoading } = useContext(AuthContext);

if (authLoading) return <div>Loading...</div>;
if (authLoading) return <Loading />;

return user ? children : <Navigate to="/login" replace />;
};
Expand Down