Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline first #142

Merged
merged 41 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
236951e
refactored main page; removed login start page;
FlorianPix Sep 29, 2023
185b2f0
fixed missing login;
FlorianPix Sep 29, 2023
aac3873
removed redundant indexChanger;
FlorianPix Sep 29, 2023
ff14631
renamed package;
FlorianPix Sep 29, 2023
1610288
added own app icon;
FlorianPix Oct 3, 2023
068ba51
refactoring common components;
FlorianPix Oct 3, 2023
8ad200d
only show cache content and sync manually;
FlorianPix Oct 3, 2023
0e4184b
caching for images;
FlorianPix Oct 3, 2023
b03a82c
await sync;
FlorianPix Oct 3, 2023
373849a
added Loading Animation while syncing;
FlorianPix Oct 4, 2023
2868ee3
wip in cache;
FlorianPix Oct 4, 2023
e0da30f
wip trip cache management;
FlorianPix Oct 4, 2023
9c3ba40
wip trip cache management;
FlorianPix Oct 5, 2023
22d8c4d
wip single-pitch-route cache management;
FlorianPix Oct 5, 2023
255bf80
wip cache management;
FlorianPix Oct 5, 2023
2beaeee
wip cache management;
FlorianPix Oct 5, 2023
e9b549e
wip cache management;
FlorianPix Oct 5, 2023
fbd2ad4
wip cache management;
FlorianPix Oct 5, 2023
3aa70e0
wip cache management;
FlorianPix Oct 5, 2023
ca21689
wip cache management;
FlorianPix Oct 5, 2023
dc9b917
wip cache management;
FlorianPix Oct 6, 2023
f4a7ccd
wip cache management;
FlorianPix Oct 6, 2023
cff1c1e
_id is set by frontend; str instead of ObjectId;
FlorianPix Oct 19, 2023
1c0d0f9
removed "updated" API;
FlorianPix Oct 19, 2023
1d731e7
wip;
FlorianPix Oct 20, 2023
412f123
fixed media service;
FlorianPix Oct 20, 2023
2479684
wip;
FlorianPix Oct 20, 2023
2faa69e
fixed duplication error when adding an existing spot to a trip;
FlorianPix Oct 20, 2023
2fa840a
automatically remove media of deleted things in backend;
FlorianPix Oct 20, 2023
ec2a947
do not add media to deletion queue if the parent is deleted (media is…
FlorianPix Oct 23, 2023
dad61ce
wip;
FlorianPix Oct 23, 2023
f83a4f6
wip;
FlorianPix Oct 24, 2023
a9d2986
wip;
FlorianPix Oct 24, 2023
ff01e4e
improved import/export;
FlorianPix Oct 24, 2023
3631a10
wip migration;
FlorianPix Oct 24, 2023
92f08b8
wip migration;
FlorianPix Oct 24, 2023
b84d200
deleted things that were deleted on the server after applying local c…
FlorianPix Oct 25, 2023
11a23b3
adjusted tests to new API;
FlorianPix Oct 25, 2023
7187acb
added missing awaits;
FlorianPix Oct 25, 2023
ce595e5
switched to media-small endpoint in getMedia;
FlorianPix Oct 25, 2023
810a2ad
added migration from objectId to str;
FlorianPix Oct 25, 2023
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
Binary file added promo/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
149 changes: 149 additions & 0 deletions promo/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added src/__init__.py
Empty file.
Empty file added src/climbingAPI/__init__.py
Empty file.
6 changes: 1 addition & 5 deletions src/climbingAPI/app/models/ascent/ascent_model.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from datetime import date, datetime
from pydantic import BaseModel, Field
from bson import ObjectId
from typing import List

from app.models.py_object_id import PyObjectId


class AscentModel(BaseModel):
updated: datetime
media_ids: List[str] = []
ascent_id: PyObjectId = Field(default_factory=PyObjectId, alias="_id")
ascent_id: str = Field(default_factory=str, alias="_id")
user_id: str = Field(...)

comment: str = Field(...)
Expand All @@ -20,7 +17,6 @@ class AscentModel(BaseModel):
class Config:
allow_population_by_field_name = True
arbitrary_types_allowed = True
json_encoders = {ObjectId: str}
schema_extra = {
"example": {
"updated": "2022-10-06T20:13:16.816000",
Expand Down
4 changes: 0 additions & 4 deletions src/climbingAPI/app/models/ascent/create_ascent_model.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from datetime import date
from pydantic import BaseModel, Field
from bson import ObjectId
from typing import List, Optional

from app.models.py_object_id import PyObjectId


class CreateAscentModel(BaseModel):
comment: Optional[str]
Expand All @@ -15,7 +12,6 @@ class CreateAscentModel(BaseModel):
class Config:
allow_population_by_field_name = True
arbitrary_types_allowed = True
json_encoders = {ObjectId: str}
schema_extra = {
"example": {
"comment": "Great ascent",
Expand Down
5 changes: 1 addition & 4 deletions src/climbingAPI/app/models/ascent/update_ascent_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from datetime import date
from pydantic import BaseModel
from bson import ObjectId
from typing import Optional, List
from typing import Optional


class UpdateAscentModel(BaseModel):
Expand All @@ -13,7 +11,6 @@ class UpdateAscentModel(BaseModel):

class Config:
arbitrary_types_allowed = True
json_encoders = {ObjectId: str}
schema_extra = {
"example": {
"media_ids": [],
Expand Down
5 changes: 0 additions & 5 deletions src/climbingAPI/app/models/grade.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
from bson import ObjectId
from datetime import date
from pydantic import BaseModel, Field
from typing import List

from .grading_system import GradingSystem


Expand All @@ -13,7 +9,6 @@ class Grade(BaseModel):
class Config:
allow_population_by_field_name = True
arbitrary_types_allowed = True
json_encoders = {ObjectId: str}
schema_extra = {
"example": {
"grade": "5a",
Expand Down
6 changes: 1 addition & 5 deletions src/climbingAPI/app/models/id_with_datetime.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
from datetime import datetime
from pydantic import BaseModel, Field
from bson import ObjectId

from app.models.py_object_id import PyObjectId


class IdWithDatetime(BaseModel):
updated: datetime
a_id: PyObjectId = Field(default_factory=PyObjectId, alias="_id")
a_id: str = Field(default_factory=str, alias="_id")

class Config:
allow_population_by_field_name = True
arbitrary_types_allowed = True
json_encoders = {ObjectId: str}
schema_extra = {
"example": {
"updated": "2022-10-06T20:13:16.816000",
Expand Down
Empty file.
24 changes: 24 additions & 0 deletions src/climbingAPI/app/models/medium/medium_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from datetime import datetime
from pydantic import BaseModel, Field
from typing import List


class MediumModel(BaseModel):
created_at: datetime
medium_id: str = Field(default_factory=str, alias="_id")
user_id: str = Field(...)
title: str = Field(...)
image: List[int] = []

class Config:
allow_population_by_field_name = True
arbitrary_types_allowed = True
schema_extra = {
"example": {
"created_at": "2022-10-06T20:13:16.816000",
"_id": "",
"user_id": "",
"title": "trip.jpg",
"image": [],
}
}
22 changes: 22 additions & 0 deletions src/climbingAPI/app/models/medium/small_medium_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from datetime import datetime
from pydantic import BaseModel, Field
from typing import List


class SmallMediumModel(BaseModel):
created_at: datetime
medium_id: str = Field(default_factory=str, alias="_id")
user_id: str = Field(...)
title: str = Field(...)

class Config:
allow_population_by_field_name = True
arbitrary_types_allowed = True
schema_extra = {
"example": {
"created_at": "2022-10-06T20:13:16.816000",
"_id": "",
"user_id": "",
"title": "trip.jpg",
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
from datetime import date
from pydantic import BaseModel, Field
from bson import ObjectId
from typing import List, Optional

from app.models.py_object_id import PyObjectId
from app.models.route.create_route_model import CreateRouteModel


class CreateMultiPitchRouteModel(CreateRouteModel):
class Config:
allow_population_by_field_name = True
arbitrary_types_allowed = True
json_encoders = {ObjectId: str}
schema_extra = {
"example": {
"comment": "Top Route",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
from pydantic import Field
from bson import ObjectId
from typing import List

from app.models.py_object_id import PyObjectId
from app.models.route.route_model import RouteModel


class MultiPitchRouteModel(RouteModel):
pitch_ids: List[PyObjectId] = []
pitch_ids: List[str] = []

class Config:
allow_population_by_field_name = True
arbitrary_types_allowed = True
json_encoders = {ObjectId: str}
schema_extra = {
"example": {
"updated": "2022-10-06T20:13:16.816000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
from datetime import date
from pydantic import BaseModel
from bson import ObjectId
from typing import Optional, List

from typing import Optional
from app.models.route.update_route_model import UpdateRouteModel


Expand All @@ -11,7 +7,6 @@ class UpdateMultiPitchRouteModel(UpdateRouteModel):

class Config:
arbitrary_types_allowed = True
json_encoders = {ObjectId: str}
schema_extra = {
"example": {
"media_ids": [],
Expand Down
8 changes: 1 addition & 7 deletions src/climbingAPI/app/models/pitch/create_pitch_model.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
from bson import ObjectId
from datetime import date
from pydantic import BaseModel, Field
from typing import List, Optional

from app.models.py_object_id import PyObjectId

from typing import Optional
from ..grade import Grade


Expand All @@ -19,7 +14,6 @@ class CreatePitchModel(BaseModel):
class Config:
allow_population_by_field_name = True
arbitrary_types_allowed = True
json_encoders = {ObjectId: str}
schema_extra = {
"example": {
"comment": "Top Pitch",
Expand Down
Loading