Skip to content

Aws backend added for testing #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 4, 2024
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ Go to the source directory and give the following command
```bash
docker compose up --build
```
## To run using AWS Backend (if docker compose fails)
Go to `client\data\apiRoutes` and comment the `first line` and uncomment the second
```js
export const baseUrl = "http://localhost:8585"; // Uncomment to run Locally
// export const baseUrl = "http://13.250.36.61"; // Uncomment to run in AWS
```
When running on AWS the frontend might face some slow network problems which can be fixed by switching speed from no thorttling to fast 3G. [You can check this video to see the demonstration of the problem mentioned here](https://drive.google.com/drive/folders/1B5N5o0ms7mizSYm5HNiAjJj0O82Zb1tq?usp=sharing).

## License

[MIT](https://choosealicense.com/licenses/mit/)
5 changes: 3 additions & 2 deletions client/components/dataTables/BillBySTSId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import EmptyFillContainer from "../dashboard-componenets/cards/EmptyFillContaine
import { getCookie } from "@/lib/cookieFunctions";
import { admin } from "@/data/roles";
import { Button } from "../ui/button";
import { baseUrl } from "@/data/apiRoutes";

const dummyDataArray: ScheduleEntry[] = [
{
Expand Down Expand Up @@ -97,7 +98,7 @@ export function BillBySTSId({ stsId, date }: { stsId: string; date: string }) {
try {
// fetch data from api
const res: any = await axios.get(
"http://localhost:8585/schedules/search?date=" +
baseUrl + "/schedules/search?date=" +
date +
"&stsId=" +
stsId,
Expand Down Expand Up @@ -126,7 +127,7 @@ export function BillBySTSId({ stsId, date }: { stsId: string; date: string }) {
try {
// fetch data from api
const res: any = await axios.post(
"http://localhost:8585/schedules/create/" + date,
baseUrl + "/schedules/create/" + date,
{
headers: {
Authorization: `Bearer ${localStorage.getItem(jwtToken)}`,
Expand Down
3 changes: 2 additions & 1 deletion client/data/apiRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const baseUrl = "http://localhost:8585";
export const baseUrl = "http://localhost:8585"; // Local
// export const baseUrl = "http://13.250.36.61"; // AWS

export const apiRoutes = {
auth: {
Expand Down