This repository has been archived by the owner on Nov 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ⬆️ Upgrade backend dependencies in Dockerfiles * 📝 Update generated docs to use latest integrated /start-reload.sh * 🔧 Add scripts for project generator development * ➕ Add backend development dependencies * 🔥 Remove scripts provided by base image * 🔊 Add logs to starting scripts * 🏗️ Upgrade backend structure, names, dependencies * 🎨 Upgrade linting script to include dead code detection * ⬆️ Upgrade frontend dependencies * 🏗️ Upgrade vuex integration and standardize layout * 🐛 Fix backend logic to update users * 🎨 Format frontend code
- Loading branch information
Showing
68 changed files
with
743 additions
and
686 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Run this script from outside the project, to integrate a dev-fsfcb project with changes and review modifications | ||
|
||
# Exit in case of error | ||
set -e | ||
|
||
if [ $(uname -s) = "Linux" ]; then | ||
echo "Remove __pycache__ files" | ||
sudo find ./dev-fsfcb/ -type d -name __pycache__ -exec rm -r {} \+ | ||
fi | ||
|
||
rm -rf ./full-stack-fastapi-couchbase/\{\{cookiecutter.project_slug\}\}/* | ||
|
||
rsync -a --exclude=node_modules ./dev-fsfcb/* ./full-stack-fastapi-couchbase/\{\{cookiecutter.project_slug\}\}/ | ||
|
||
rsync -a ./dev-fsfcb/{.env,.gitignore,.gitlab-ci.yml} ./full-stack-fastapi-couchbase/\{\{cookiecutter.project_slug\}\}/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
default_context: | ||
"project_name": "Dev FSFCB" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Run this script from outside the project, to generate a dev-fsfcb project | ||
|
||
# Exit in case of error | ||
set -e | ||
|
||
rm -rf ./dev-fsfcb | ||
|
||
cookiecutter --config-file ./full-stack-fastapi-couchbase/dev-fsfcb-config.yml --no-input -f ./full-stack-fastapi-couchbase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 5 additions & 8 deletions
13
{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/api.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
from fastapi import APIRouter | ||
|
||
from app.api.api_v1.endpoints.role import router as roles_router | ||
from app.api.api_v1.endpoints.token import router as token_router | ||
from app.api.api_v1.endpoints.user import router as user_router | ||
from app.api.api_v1.endpoints.utils import router as utils_router | ||
from app.api.api_v1.endpoints import role, token, user, utils | ||
|
||
api_router = APIRouter() | ||
api_router.include_router(roles_router) | ||
api_router.include_router(token_router) | ||
api_router.include_router(user_router) | ||
api_router.include_router(utils_router) | ||
api_router.include_router(role.router) | ||
api_router.include_router(token.router) | ||
api_router.include_router(user.router) | ||
api_router.include_router(utils.router) |
16 changes: 4 additions & 12 deletions
16
{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/role.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,17 @@ | ||
from fastapi import APIRouter, Depends | ||
from starlette.exceptions import HTTPException | ||
|
||
from app.core.jwt import get_current_user | ||
from app.crud.user import check_if_user_is_active, check_if_user_is_superuser | ||
from app.crud.utils import ensure_enums_to_strs | ||
from app import crud | ||
from app.api.utils.security import get_current_active_superuser | ||
from app.models.role import RoleEnum, Roles | ||
from app.models.user import UserInDB | ||
|
||
router = APIRouter() | ||
|
||
|
||
@router.get("/roles/", response_model=Roles) | ||
def route_roles_get(current_user: UserInDB = Depends(get_current_user)): | ||
def read_roles(current_user: UserInDB = Depends(get_current_active_superuser)): | ||
""" | ||
Retrieve roles | ||
""" | ||
if not check_if_user_is_active(current_user): | ||
raise HTTPException(status_code=400, detail="Inactive user") | ||
elif not (check_if_user_is_superuser(current_user)): | ||
raise HTTPException( | ||
status_code=400, detail="The current user does not have enogh privileges" | ||
) | ||
roles = ensure_enums_to_strs(RoleEnum) | ||
roles = crud.utils.ensure_enums_to_strs(RoleEnum) | ||
return {"roles": roles} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.