Skip to content

Commit

Permalink
Documentation and editorconfig (#134)
Browse files Browse the repository at this point in the history
* πŸ“œ update readme with latest restructuring

* βž• provide editorconfig

* ❌ remove unused migration code
  • Loading branch information
devmount authored Oct 4, 2023
1 parent ff0dd5c commit 9e774bc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.py]
charset = utf-8
indent_style = space
indent_size = 4

[*.{vue,html,css,js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ cd appointment
docker-compose up -d --build
```

A Mysql database will be accessible via `localhost:3306` with username and password set to: `tba`
A MySQL database will be accessible via `localhost:3306` with username and password set to: `tba`

To init database or run migrations, the backend offers a cimple CLI interface:

```bash
run-command update-db
```

### Manual Setup

Expand All @@ -40,7 +46,7 @@ Run application for development with hot reloading backend and frontend:
pip install -r backend/requirements.txt
touch backend/src/appointment.db # when using sqlite
cp backend/.env.example backend/.env # add your own configuration here
uvicorn backend.src.main:app --reload --port 5000
uvicorn --factory backend.src.appointment.main:server --host 0.0.0.0 --port 5000
```
You can now access the backend at [localhost:5000](http://localhost:5000).
Expand All @@ -58,7 +64,7 @@ Run application for development with hot reloading backend and frontend:
4. (optional) Run database migrations
```bash
cd backend/src
cd backend
cp alembic.ini.example alembic.ini # add your own configuration here
alembic init migrations # init migrations once
alembic current # check database state
Expand Down
1 change: 1 addition & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# -- GENERAL --
# Logging level: DEBUG|INFO|WARNING|ERROR|CRITICAL
LOG_LEVEL=ERROR
LOG_USE_STREAM=1

# -- FRONTEND --
FRONTEND_URL=http://localhost:8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,8 @@ def upgrade() -> None:
sa.Column("time_created", DateTime()),
sa.Column("time_updated", DateTime()),
)
# op.add_column(
# "appointments",
# sa.Column(
# "appointment_type",
# sa.Enum(AppointmentType),
# default=AppointmentType.schedule,
# ),
# )


def downgrade() -> None:
op.drop_table("schedules")
op.drop_table("availabilities")
# op.drop_column("appointments", "appointment_type")
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ def secret():


def upgrade() -> None:
# op.drop_column("appointments", "appointment_type")
#op.drop_constraint("schedules_ibfk_1", "schedules", type_="foreignkey")
op.drop_column("schedules", "appointment_id")
op.add_column("schedules", sa.Column("calendar_id", sa.Integer, sa.ForeignKey("calendars.id")))
op.add_column("schedules", sa.Column("location_type", sa.Enum(LocationType), default=LocationType.online))
Expand Down

0 comments on commit 9e774bc

Please sign in to comment.