Skip to content

Commit c656736

Browse files
Merge branch 'main' into pr-904
2 parents 368c308 + 38cee7f commit c656736

123 files changed

Lines changed: 27264 additions & 7069 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.DS_Store‎

8 KB
Binary file not shown.

‎.github/workflows/ci.yml‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI – Run Tests
2+
3+
on:
4+
push:
5+
branches: ["main", "master"]
6+
pull_request:
7+
branches: ["main", "master"]
8+
9+
jobs:
10+
test:
11+
name: pytest
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.11"
20+
cache: "pip"
21+
22+
- name: Install dependencies
23+
run: |
24+
pip install --upgrade pip
25+
pip install -r backend/requirements.txt
26+
pip install pytest pytest-cov
27+
pip install flask-wtf bleach Pillow beautifulsoup4 "pydantic[email]" pytest pytest-cov
28+
29+
- name: Run pytest
30+
env:
31+
GOOGLE_BOOKS_API_KEY: "ci-fake-key"
32+
OPENAI_API_KEY: "ci-fake-key"
33+
GROQ_API_KEY: "ci-fake-key"
34+
GEMINI_API_KEY: "ci-fake-key"
35+
FLASK_ENV: testing
36+
PYTHONPATH: ".:backend"
37+
run: |
38+
python -m pytest tests/ \
39+
--ignore=tests/test_llm.py \
40+
--ignore=tests/test_mood_improvements.py \
41+
--ignore=tests/test_mood_cache_db.py \
42+
--ignore=tests/test_category_cache.py \
43+
--ignore=tests/test_env_validation.py \
44+
--ignore=tests/test_purchase_links.py \
45+
-v --tb=short --cov=backend
46+
47+
- name: Install dependencies
48+
run: |
49+
pip install --upgrade pip
50+
pip install torch --index-url https://download.pytorch.org/whl/cpu
51+
pip install -r backend/requirements.txt
52+
pip install flask-wtf bleach Pillow pytest pytest-cov
53+
54+
- name: Install dependencies
55+
run: |
56+
pip install --upgrade pip
57+
pip install torch --index-url https://download.pytorch.org/whl/cpu
58+
pip install -r backend/requirements.txt
59+
pip install flask-wtf bleach Pillow beautifulsoup4 pytest pytest-cov
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Generate Contributors
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
schedule:
7+
- cron: '0 0,8,16 * * *' # three times a day at 00:00, 08:00, and 16:00 UTC
8+
workflow_dispatch: {}
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
generate:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
persist-credentials: true
21+
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '18'
26+
27+
- name: Install (none required)
28+
run: node -v
29+
30+
- name: Run generator
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
OWNER: devanshi14malhotra
34+
REPO: BiblioDrift
35+
PER_PAGE: '100'
36+
run: |
37+
node scripts/generate_contributors.js
38+
39+
- name: Commit and push if changed
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
git add frontend/data/contributors.json
44+
if ! git diff --cached --quiet; then
45+
git commit -m "chore: update contributors.json"
46+
git push
47+
else
48+
echo "No changes to commit"
49+
fi

‎.gitignore‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ mood_analysis/mood_cache.json
66
*.cache
77

88
# Environment variables
9-
.env
10-
.env.local
11-
.env.production
12-
.env.development
9+
*/.env
10+
*/.env.local
11+
*/.env.production
12+
*/.env.development
1313

1414
# Sensitive local files
1515
*.token
@@ -32,3 +32,9 @@ instance/
3232
*.db
3333
# Virtual Environment
3434
venv/
35+
36+
node_modules/
37+
.venv/
38+
39+
# Local untracked scripts folder
40+
untracked/

‎Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM python:3.11-slim
44
# Set environment variables
55
ENV PYTHONDONTWRITEBYTECODE=1
66
ENV PYTHONUNBUFFERED=1
7-
ENV FLASK_APP=app.py
7+
ENV FLASK_APP=backend/app.py
88
ENV FLASK_HOST=0.0.0.0
99
ENV PORT=5000
1010

@@ -28,4 +28,4 @@ COPY . .
2828
EXPOSE 5000
2929

3030
# Run the application
31-
CMD ["python", "app.py"]
31+
CMD ["python", "backend/app.py"]

‎Dockerfile.frontend‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM nginx:alpine
2+
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
3+
COPY ./frontend /usr/share/nginx/html
4+
EXPOSE 80
5+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)