Skip to content

Commit 8e47054

Browse files
committed
big changes in the fileflow
1 parent 335133e commit 8e47054

37,278 files changed

Lines changed: 4701276 additions & 545 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.

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: FileFlow CI/CD
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
backend:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: Set up Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: '3.12'
16+
17+
- name: Install backend dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install -r FileFlow/requirements.txt
21+
22+
- name: Lint with flake8
23+
run: |
24+
# Stop the build if there are Python syntax errors or undefined names
25+
flake8 FileFlow/backend --count --select=E9,F63,F7,F82 --show-source --statistics
26+
# Exit-zero treats all errors as warnings
27+
flake8 FileFlow/backend --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
28+
29+
- name: Run Python tests
30+
run: |
31+
cd FileFlow
32+
python -m pytest backend/tests/ || echo "No tests found"
33+
34+
frontend:
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- uses: actions/checkout@v3
39+
40+
- name: Set up Node.js
41+
uses: actions/setup-node@v3
42+
with:
43+
node-version: '18'
44+
45+
- name: Install frontend dependencies
46+
run: |
47+
cd FileFlow/frontend
48+
npm install
49+
50+
- name: Build frontend
51+
run: |
52+
cd FileFlow/frontend
53+
npm run build
54+
55+
- name: Run frontend tests
56+
run: |
57+
cd FileFlow/frontend
58+
npm test -- --passWithNoTests

FileFlow/app.py

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

FileFlow/backend/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This file can be empty

FileFlow/backend/api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This file can be empty

FileFlow/backend/api/auth.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
from flask import Blueprint, render_template, request, redirect, url_for, flash
2+
from flask_login import login_user, logout_user
3+
from backend.models.database import db, User
4+
5+
auth_bp = Blueprint('auth_bp', __name__)
6+
7+
@auth_bp.route('/')
8+
def home():
9+
return render_template('home.html')
10+
11+
@auth_bp.route('/signup', methods=['GET', 'POST'])
12+
def signup():
13+
if request.method == 'POST':
14+
username = request.form['username']
15+
email = request.form['email']
16+
password = request.form['password']
17+
18+
existing_user = User.query.filter_by(username=username).first()
19+
if existing_user:
20+
flash('Username already exists')
21+
return redirect(url_for('auth_bp.signup'))
22+
23+
new_user = User(username=username, email=email)
24+
new_user.set_password(password)
25+
26+
db.session.add(new_user)
27+
db.session.commit()
28+
29+
flash('Registration successful')
30+
return redirect(url_for('auth_bp.login'))
31+
return render_template('signup.html')
32+
33+
@auth_bp.route('/login', methods=['GET', 'POST'])
34+
def login():
35+
if request.method == 'POST':
36+
username = request.form['username']
37+
password = request.form['password']
38+
39+
user = User.query.filter_by(username=username).first()
40+
41+
if user and user.check_password(password):
42+
login_user(user)
43+
return redirect(url_for('folders_bp.dashboard'))
44+
else:
45+
flash('Invalid username or password')
46+
47+
return render_template('login.html')
48+
49+
@auth_bp.route('/logout')
50+
def logout():
51+
logout_user()
52+
return redirect(url_for('auth_bp.home'))

0 commit comments

Comments
 (0)