Skip to content
Open
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
114 changes: 11 additions & 103 deletions README
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
Welcome to TA-Bot!

Welcome to **TA-Bot**! This repository contains everything you need to set up and run the TA-Bot development environment. Stay tuned for updates as we continue to enhance this documentation.

Check out the current state of TA-Bot at: [http://tabot.sh](http://tabot.sh).
Welcome to **TA-Bot**!

---

Expand All @@ -12,6 +8,10 @@ Check out the current state of TA-Bot at: [http://tabot.sh](http://tabot.sh).

---

## Dependencies

- Docker Desktop (windows and mac)

## :bulb: Workaround for Windows Users

To run the TA-Bot Docker development environment on Windows, you will need to:
Expand All @@ -25,108 +25,16 @@ Follow [this guide](https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windo

## :rocket: Steps to Running the TA-Bot Docker Development Environment

Clone the Repository

```bash
git clone <repository-url>
cd <repository-directory>

The Active Branch is multi-filechanges

---

2. In the main directory run "git submodule update --init --recursive"

---

3. Download and install Docker runner.

Mac and Linux follow similar steps:

### Mac

execute
1. `brew install docker` - Installs Docker CLI tools
2. `brew install --cask docker` - Installs Docker VM Damien


often, this won't include the `docker compose` command, so a few additional steps may be required.

run `docker compose version`, if you get a response skip the following steps.

1. Make a docker config directory
- `mkdir -p ~/.docker `
2. Create a docker config file
- `vim ~/.docker/config.json`
- Place the following snippet into the file:
```{
"cliPluginsExtraDirs": [
"/opt/homebrew/lib/docker/cli-plugins"
]
}
```
3. You can verify this worked via `docker compose version`


Launch Docker via applications, or via cli via:
`open /Applications/Docker.app`


### WSL - ubuntu Linux

Install Docker Desktop in Windows, enable wsl connection via resources -> wsl connections -> enable integration with ubuntu
- Note: similar steps for any linux distro

Install docker in WSL client
https://dev.to/bartr/install-docker-on-windows-subsystem-for-linux-v2-ubuntu-5dl7

---


## 3. Install the correct version of Node using nvm
- Node can be installed via
- Mac: `brew install node`
- Linux: TODO

- Nvm Can be installed via:
- Mac: `brew install nvm`
- Follow the install steps output by the cli


### Mac M Chips:
Node 14 requires a special command to run on ARM Mac machines:

`NVM_NODEJS_ORG_MIRROR=https://nodejs.raccoon-tw.dev/release nvm install v14.21.3`

If you are not on mac, run:
- `nvm install 14`


`npm install --legacy-peer-deps`

### Linux:

sudo apt install nodejs

https://github.com/nvm-sh/nvm

##4. Install Yarn

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn -y



## 4. Run `yarn install` from ui directory
## 5. In the main directory, run `docker compose up`


1. Clone the repository.
2. Navigate to the /ui directory.
3. Run yarn install.
4. Download and install Docker.
Note for WSL Users: If you are using WSL, follow the instructions at https://medium.com/geekculture/run-docker-in-windows-10-11-wsl-without-docker-desktop-a2a7eb90556d to install Docker in your WSL environment.
Note for WSL Users: To enable port forwarding from the WSL environment to your localhost, follow the instructions at https://dev.to/vishnumohanrk/wsl-port-forwarding-2e22
Note: Make sure to edit the shell script to include 3000


5. Run docker compose up from the main directory.
5. Run `docker compose up` from the main directory.

The Development environment should now be up on localhost:3000

Expand Down
4 changes: 1 addition & 3 deletions api/src/services/authentication_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ def placeholder(self, username: str, password: str) -> bool:
class PAMAuthenticationService(AuthenticationService):
"""This class utalizes the PAM library to authenticate users"""
def login(self, username, password):
# when in debug mode, we don't want to authenticate with azure.
if os.getenv('FLASK_DEBUG', False):
return True

return True

url = os.getenv('AUTH_URL')
data = {'username': json.dumps(username),
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ services:
container_name: frontend
restart: unless-stopped
environment:
REACT_APP_BASE_API_URL: http://127.0.0.1:5001/api
REACT_APP_BASE_API_URL: http://localhost:5000/api
CHOKIDAR_USEPOLLING: true
build:
context: ui
volumes:
- "./ui:/app"
- "/app/node_modules"
ports:
- "3000:3000"
depends_on:
Expand Down
10 changes: 5 additions & 5 deletions init-db/init.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- MySQL dump 10.13 Distrib 9.1.0, for macos15.1 (arm64)
-- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: autota
-- ------------------------------------------------------
Expand Down Expand Up @@ -211,11 +211,11 @@ CREATE TABLE `LoginAttempts` (
`IPAddress` varchar(39) NOT NULL,
`Username` varchar(45) NOT NULL,
PRIMARY KEY (`Id`),
KEY `fk_LoginAttempts_1_idx` (`Username`),
CONSTRAINT `fk_LoginAttempts` FOREIGN KEY (`Username`) REFERENCES `Users` (`Username`) ON DELETE RESTRICT ON UPDATE RESTRICT
KEY `fk_LoginAttempts_1_idx` (`Username`)
) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `Projects`
--
Expand Down Expand Up @@ -405,7 +405,7 @@ CREATE TABLE `SubmissionCharges` (
`BaseCharge` int DEFAULT NULL,
`RewardCharge` int DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
Expand Down Expand Up @@ -521,4 +521,4 @@ CREATE TABLE `Users` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2025-01-07 21:47:13
-- Dump completed on 2025-03-11 13:13:47
Binary file added ui/.yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions ui/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
21 changes: 11 additions & 10 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# Use Node.js 14 base image
FROM node:14
# Use official Node.js image
FROM node:20.11.1

# Set environment variable to handle file system polling
# Enable polling for file changes in Docker
ENV CHOKIDAR_USEPOLLING=true
ENV NODE_OPTIONS=--openssl-legacy-provider

# Set working directory in the container
# Set working directory
WORKDIR /app

# Copy package.json and yarn.lock first (to leverage Docker's caching mechanism)
# Copy package.json and yarn.lock first (to leverage caching)
COPY package.json yarn.lock ./

# Install dependencies
RUN yarn install
# Install dependencies inside the container
RUN yarn install --check-files

# Copy the rest of the application files
COPY . .

# Expose port 3000
# Expose the port the app runs on
EXPOSE 3000

# Start the development server
CMD ["yarn", "start"]
# Start the React app
CMD ["yarn", "start"]
23 changes: 14 additions & 9 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react-dom": "^18.0.6",
"@types/react": "17",
"@types/react-dom": "17",
"@types/react-helmet": "^6.1.2",
"@types/react-syntax-highlighter": "^13.5.0",
"@types/styled-components": "^5.1.9",
"@types/tap": "^15.0.5",
"ace-builds": "^1.32.5",
"apexcharts": "^3.45.2",
"apexcharts": "^4.5.0",
"axios": "^0.21.1",
"moment": "^2.30.1",
"react": "^17.0.2",
Expand All @@ -25,18 +27,20 @@
"react-diff-viewer": "^3.1.1",
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-helmet-async": "^2.0.5",
"react-is": "17",
"react-router-dom": "6.22.3",
"react-scripts": "^5.0.1",
"react-split": "^2.0.11",
"react-split-pane": "^0.1.92",
"react-syntax-highlighter": "^15.4.3",
"sass": "^1.83.1",
"sass": "^1.85.1",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^2.1.3",
"styled-components": "^5.3.0",
"tap": "^15.0.9",
"tap-parser": "^10.1.0",
"typescript": "^4.1.2",
"tap": "15.0.9",
"tap-parser": "10.1.0",
"typescript": "4.9.5",
"web-vitals": "^1.0.1",
"yarn": "^1.22.19"
},
Expand Down Expand Up @@ -65,6 +69,7 @@
]
},
"devDependencies": {
"@types/react-router-dom": "^5.1.7"
"@babel/core": "7.16.0",
"@types/react-is": "17"
}
}
45 changes: 27 additions & 18 deletions ui/src/AdminPages/AdminLanding.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
import { Component } from 'react';
import 'semantic-ui-css/semantic.min.css'
import { Grid } from 'semantic-ui-react'
import React, { Component } from 'react';
import 'semantic-ui-css/semantic.min.css';
import { Grid } from 'semantic-ui-react';
import MenuComponent from '../components/MenuComponent';
import '../css/AdminComponent.scss'
import { Helmet } from 'react-helmet';
import '../css/AdminComponent.scss';
import { Helmet } from "react-helmet";
import AdminLandingComponent from '../components/AdminLandingComponent';

class AdminLanding extends Component<{}, {}> {

render() {
return (
<div>
<Helmet>
<title>[Admin] Projects | TA-Bot</title>
</Helmet>
<MenuComponent showUpload={false} showAdminUpload={false} showHelp={false} showCreate={false} showLast={false} showReviewButton={false} ></MenuComponent>
<Grid className="main-grid">
<AdminLandingComponent></AdminLandingComponent>
</Grid>
</div>
);
const SafeHelmet: any = Helmet;

class AdminLanding extends Component<{}, {}> {
render() {
return (
<div>
<SafeHelmet>
<title>[Admin] Projects | TA-Bot</title>
</SafeHelmet>
<MenuComponent
showUpload={false}
showAdminUpload={false}
showHelp={false}
showCreate={false}
showLast={false}
showReviewButton={false}
/>
<Grid className="main-grid">
<AdminLandingComponent />
</Grid>
</div>
);
}
}

Expand Down
Loading