Skip to content

Commit

Permalink
More pathing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaAutumn committed Dec 19, 2023
1 parent a08723f commit dc90644
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 29 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Run application for development with hot reloading backend and frontend:
```bash
cd appointment
pip install -r backend/requirements.txt
pip install .
touch backend/src/appointment.db # when using sqlite
cp backend/.env.example backend/.env # add your own configuration here
uvicorn --factory backend.src.appointment.main:server --host 0.0.0.0 --port 5000
uvicorn --factory appointment.main:server --host 0.0.0.0 --port 5000
```
You can now access the backend at [localhost:5000](http://localhost:5000).
Expand Down
5 changes: 5 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ COPY .env .
RUN pip install --upgrade pip
RUN pip install .'[deploy]'

# Add this hack to line it up with our dev environment.
# I'll buy whoever fixes this a coffee.
RUN mkdir src
RUN ln -s /app/appointment src/appointment

EXPOSE 5000
CMD ["/bin/sh", "./scripts/dev-entry.sh"]
4 changes: 2 additions & 2 deletions backend/alembic.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[alembic]
# path to migration scripts
script_location = src/appointment/migrations
script_location = appointment/migrations

# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
# Uncomment the line below if you want the files to be prepended with date and time
Expand All @@ -12,7 +12,7 @@ file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(re

# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory.
prepend_sys_path = src/appointment
prepend_sys_path = appointment

# timezone to use when rendering the date within the migration file
# as well as the filename.
Expand Down
16 changes: 0 additions & 16 deletions backend/google_credentials.json.example

This file was deleted.

6 changes: 3 additions & 3 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[project]
name = "appointment_backend"
name = "appointment"
version = "0.2.0"
description = "Backend component to Thunderbird Appointment"
requires-python = ">3.11"
dynamic = ["dependencies"]

[project.scripts]
run-command = "src.appointment.main:cli"
run-command = "appointment.main:cli"

[project.urls]
homepage = "https://appointment.day"
Expand All @@ -26,7 +26,7 @@ test = [
"httpx==0.25.1",
"pytest==7.4.3",
]
deploy = ['appointment_backend[cli]', 'appointment_backend[db]']
deploy = ['appointment[cli]', 'appointment[db]']

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }
Expand Down
3 changes: 0 additions & 3 deletions backend/requirements-test.txt

This file was deleted.

3 changes: 2 additions & 1 deletion backend/scripts/dev-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ run-command update-db
python -u -m smtpd -n -c DebuggingServer localhost:8050 &

# Start up real webserver
uvicorn --factory src.appointment.main:server --reload --host 0.0.0.0 --port 5173
uvicorn --factory appointment.main:server --reload --host 0.0.0.0 --port 5173

2 changes: 1 addition & 1 deletion backend/scripts/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

run-command update-db

uvicorn --factory src.appointment.main:server --host 0.0.0.0 --port 5000
uvicorn --factory appointment.main:server --host 0.0.0.0 --port 5000
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
ports:
- 5173:5173
volumes:
- ./backend/src:/app/src
- ./backend/src/appointment:/app/appointment
environment:
- DATABASE_URL=mysql+mysqldb://tba:tba@mysql:3306/appointment
depends_on:
Expand Down

0 comments on commit dc90644

Please sign in to comment.