Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ FLASK_APP=src/app.py
FLASK_DEBUG=1
DEBUG=TRUE


# Front-End Variables
VITE_BASENAME=/
#VITE_BACKEND_URL=
VITE_BACKEND_URL=http://127.0.0.1:3001
BACKEND_URL=http://127.0.0.1:3001
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dist/*
!.gitkeep
!.htaccess
!.eslintrc
!.env.example
!.env
.now

# backend stuff
Expand All @@ -80,3 +80,4 @@ database.database
database.db
diagram.png
__pycache__/
.env
4 changes: 3 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ verify_ssl = true

[packages]
flask = "*"
flask-sqlalchemy = "*"
flask-migrate = "*"
flask-swagger = "*"
psycopg2-binary = "*"
Expand All @@ -20,6 +19,8 @@ typing-extensions = "*"
flask-jwt-extended = "==4.6.0"
wtforms = "==3.1.2"
sqlalchemy = "*"
flask-sqlalchemy = "*"
flask-bcrypt = "*"

[requires]
python_version = "3.13"
Expand All @@ -34,3 +35,4 @@ downgrade="flask db downgrade"
insert-test-data="flask insert-test-data"
reset_db="bash ./docs/assets/reset_migrations.bash"
deploy="echo 'Please follow this 3 steps to deploy: https://github.com/4GeeksAcademy/flask-rest-hello/blob/master/README.md#deploy-your-website-to-heroku' "

561 changes: 336 additions & 225 deletions Pipfile.lock

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,15 @@ This boilerplate it's 100% read to deploy with Render.com and Heroku in a matter
This template was built as part of the 4Geeks Academy [Coding Bootcamp](https://4geeksacademy.com/us/coding-bootcamp) by [Alejandro Sanchez](https://twitter.com/alesanchezr) and many other contributors. Find out more about our [Full Stack Developer Course](https://4geeksacademy.com/us/coding-bootcamps/part-time-full-stack-developer), and [Data Science Bootcamp](https://4geeksacademy.com/us/coding-bootcamps/datascience-machine-learning).

You can find other templates and resources like this at the [school github page](https://github.com/4geeksacademy/).


##-------------------------------------------------------------

## Pasos para correr el backend projecto kevin.michelle.gia

- git clone URL_DEL_REPO
- cd final.project.kevin.michelle.gia
- pipenv install
- pipenv run flask --app src/app.py db upgrade
- cd src
- pipenv run python app.py
10 changes: 10 additions & 0 deletions Workshop API/opencollection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
opencollection: 1.0.0

info:
name: Workshop API
bundled: false
extensions:
bruno:
ignore:
- node_modules
- .git
35 changes: 0 additions & 35 deletions migrations/versions/0763d677d453_.py

This file was deleted.

165 changes: 165 additions & 0 deletions migrations/versions/e67db382851a_initial_workshop_schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
"""initial workshop schema

Revision ID: e67db382851a
Revises:
Create Date: 2026-06-25 17:53:01.732922

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'e67db382851a'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('workshops',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('company_name', sa.String(length=120), nullable=False),
sa.Column('cif', sa.String(length=50), nullable=False),
sa.Column('phone', sa.String(length=20), nullable=False),
sa.Column('email', sa.String(length=120), nullable=False),
sa.Column('address', sa.String(length=200), nullable=True),
sa.Column('city', sa.String(length=80), nullable=True),
sa.Column('postal_code', sa.String(length=20), nullable=True),
sa.Column('is_active', sa.Boolean(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('cif'),
sa.UniqueConstraint('email')
)
op.create_table('customers',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('first_name', sa.String(length=80), nullable=False),
sa.Column('last_name', sa.String(length=120), nullable=False),
sa.Column('dni', sa.String(length=20), nullable=False),
sa.Column('driving_license', sa.String(length=20), nullable=False),
sa.Column('phone', sa.String(length=20), nullable=False),
sa.Column('email', sa.String(length=120), nullable=True),
sa.Column('address', sa.String(length=200), nullable=True),
sa.Column('workshop_id', sa.Integer(), nullable=False),
sa.Column('is_active', sa.Boolean(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['workshop_id'], ['workshops.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('dni'),
sa.UniqueConstraint('driving_license')
)
op.create_table('employees',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('first_name', sa.String(length=80), nullable=False),
sa.Column('last_name', sa.String(length=120), nullable=False),
sa.Column('dni', sa.String(length=20), nullable=False),
sa.Column('phone', sa.String(length=20), nullable=False),
sa.Column('address', sa.String(length=200), nullable=True),
sa.Column('city', sa.String(length=80), nullable=True),
sa.Column('postal_code', sa.String(length=20), nullable=True),
sa.Column('role', sa.String(length=20), nullable=False),
sa.Column('job_position', sa.String(length=80), nullable=True),
sa.Column('specialty', sa.String(length=120), nullable=True),
sa.Column('workshop_id', sa.Integer(), nullable=False),
sa.Column('is_active', sa.Boolean(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['workshop_id'], ['workshops.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('dni')
)
op.create_table('users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(length=120), nullable=False),
sa.Column('password_hash', sa.String(length=255), nullable=False),
sa.Column('employee_id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['employee_id'], ['employees.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email'),
sa.UniqueConstraint('employee_id')
)
op.create_table('vehicles',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('plate', sa.String(length=20), nullable=False),
sa.Column('vin', sa.String(length=50), nullable=True),
sa.Column('brand', sa.String(length=80), nullable=False),
sa.Column('model', sa.String(length=80), nullable=False),
sa.Column('version', sa.String(length=80), nullable=True),
sa.Column('year', sa.Integer(), nullable=True),
sa.Column('fuel_type', sa.String(length=30), nullable=False),
sa.Column('power_hp', sa.Integer(), nullable=True),
sa.Column('engine_cc', sa.Integer(), nullable=True),
sa.Column('color', sa.String(length=50), nullable=True),
sa.Column('mileage', sa.Integer(), nullable=False),
sa.Column('first_registration_date', sa.Date(), nullable=True),
sa.Column('customer_id', sa.Integer(), nullable=False),
sa.Column('workshop_id', sa.Integer(), nullable=False),
sa.Column('is_active', sa.Boolean(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['customer_id'], ['customers.id'], ),
sa.ForeignKeyConstraint(['workshop_id'], ['workshops.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('plate'),
sa.UniqueConstraint('vin')
)
op.create_table('services',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('title', sa.String(length=120), nullable=False),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('service_type', sa.String(length=50), nullable=False),
sa.Column('status', sa.String(length=30), nullable=False),
sa.Column('priority', sa.String(length=20), nullable=False),
sa.Column('entry_mileage', sa.Integer(), nullable=True),
sa.Column('start_date', sa.DateTime(), nullable=True),
sa.Column('end_date', sa.DateTime(), nullable=True),
sa.Column('observations', sa.Text(), nullable=True),
sa.Column('workshop_id', sa.Integer(), nullable=False),
sa.Column('customer_id', sa.Integer(), nullable=False),
sa.Column('vehicle_id', sa.Integer(), nullable=False),
sa.Column('employee_id', sa.Integer(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['customer_id'], ['customers.id'], ),
sa.ForeignKeyConstraint(['employee_id'], ['employees.id'], ),
sa.ForeignKeyConstraint(['vehicle_id'], ['vehicles.id'], ),
sa.ForeignKeyConstraint(['workshop_id'], ['workshops.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('service_comments',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('comment', sa.Text(), nullable=False),
sa.Column('comment_type', sa.String(length=50), nullable=False),
sa.Column('service_id', sa.Integer(), nullable=False),
sa.Column('employee_id', sa.Integer(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['employee_id'], ['employees.id'], ),
sa.ForeignKeyConstraint(['service_id'], ['services.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('service_status_logs',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('service_id', sa.Integer(), nullable=False),
sa.Column('from_status', sa.String(length=30), nullable=True),
sa.Column('to_status', sa.String(length=30), nullable=False),
sa.Column('employee_id', sa.Integer(), nullable=True),
sa.Column('note', sa.Text(), nullable=True),
sa.Column('changed_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['employee_id'], ['employees.id'], ),
sa.ForeignKeyConstraint(['service_id'], ['services.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('service_status_logs')
op.drop_table('service_comments')
op.drop_table('services')
op.drop_table('vehicles')
op.drop_table('users')
op.drop_table('employees')
op.drop_table('customers')
op.drop_table('workshops')
# ### end Alembic commands ###
Loading