Skip to content

Commit aaa5bb3

Browse files
committed
merging database into develop
2 parents d73b99c + ff41dec commit aaa5bb3

28 files changed

Lines changed: 445 additions & 161274 deletions

.github/workflows/backend-ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Backend CI
5+
6+
on:
7+
push:
8+
branches: [ "develop", "main" ]
9+
pull_request:
10+
branches: [ "develop" ]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
lint:
17+
name: Lint Python Code (PEP8)
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: "3.10"
28+
29+
- name: Install dependencies
30+
run: |
31+
cd server
32+
python -m pip install --upgrade pip
33+
pip install flake8 black
34+
- name: Run flake8 (Linting)
35+
run: |
36+
cd server
37+
flake8 src/ tests/
38+
- name: Run Black (Formatting Check)
39+
run: |
40+
cd server
41+
black --check --diff src/ tests/
42+
test:
43+
name: Run Backend Tests
44+
runs-on: ubuntu-latest
45+
needs: lint # Ensures linting passes before running tests
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v3
50+
51+
- name: Set up Python
52+
uses: actions/setup-python@v4
53+
with:
54+
python-version: "3.10"
55+
56+
- name: Install dependencies
57+
run: |
58+
cd server
59+
python -m pip install --upgrade pip
60+
pip install -r requirements.txt
61+
62+
- name: Create .env file in CI
63+
run: |
64+
cd server
65+
touch .env
66+
echo "SUPABASE_URL=${{ secrets.SUPABASE_URL }}" >> .env
67+
echo "SUPABASE_URL=${{ secrets.SUPABASE_KEY }}" >> .env
68+
echo "GOOGLE_MAPS_API_KEY=${{ secrets.GOOGLE_MAPS_API_KEY }}" >> .env
69+
70+
- name: Run Tests
71+
run: |
72+
cd server
73+
pytest tests/ --ignore=tests/test_database_connection.py

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
./assets/stops.txt
33
./assets/stop_times.txt
44

5+
.vscode/
56
*.pyc
67
*.env
78

client/Map.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function MapScreen({ navigation }) {
88
const [location, setLocation] = useState(null); // No hardcoded initial location
99
const [errorMessage, setErrorMessage] = useState('');
1010
const mapRef = useRef(null); // Reference to the MapView
11-
11+
1212
// WebSocket Setup
1313
useEffect(() => {
1414
const wsUrl = `${process.env.EXPO_PUBLIC_API_URL.replace(/^http/, 'ws')}/ws/location`;
@@ -147,7 +147,6 @@ export default function MapScreen({ navigation }) {
147147
</View>
148148
);
149149
}
150-
151150
const styles = StyleSheet.create({
152151
container: {
153152
flex: 1,

server/.gitignore

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Server Code .gitignore
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# Installer logs
29+
pip-log.txt
30+
pip-delete-this-directory.txt
31+
32+
# Unit test / coverage reports
33+
.coverage
34+
.coverage.*
35+
.cache
36+
pytest_cache/
37+
nosetests.xml
38+
coverage.xml
39+
*.cover
40+
*.py,cover
41+
htmlcov/
42+
43+
# Virtual environment folders
44+
venv/
45+
.venv/
46+
ENV/
47+
env/
48+
.envrc
49+
50+
# IDE / editor settings
51+
.vscode/
52+
.idea/
53+
*.swp
54+
55+
# macOS / Windows
56+
.DS_Store
57+
Thumbs.db
58+
59+
# Environment variables
60+
.env
61+
.env.*
62+
63+
# Logs
64+
*.log
65+
logs/
66+
67+
# Docker-related (optional)
68+
docker-compose.override.yml

server/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ COPY requirements.txt .
99
RUN pip install --no-cache-dir -r requirements.txt
1010

1111
# Copy the application code
12-
COPY . .
12+
COPY src/ src/
13+
COPY tests/ tests/
14+
15+
# Copy environment vars
16+
COPY .env .env
1317

1418
# Expose the FastAPI port
1519
EXPOSE 8000
1620

1721
# Command to run the FastAPI app
18-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
22+
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"]
-4.52 KB
Binary file not shown.

server/apis/__init__.py

Whitespace-only changes.

server/apis/luas_api.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

server/apis/weatherApi.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

server/assets/GTFS_Realtime/agency.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)