Skip to content

Commit

Permalink
Add frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpro2022 committed Mar 24, 2024
1 parent 5c758cb commit 9105f2d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 25 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# hrspace-request-builder-backend
[![CI/CD](https://github.com/hrspace-request-builder/hrspace-request-builder-backend/actions/workflows/main.yml/badge.svg)](https://github.com/hrspace-request-builder/hrspace-request-builder-backend/actions/workflows/main.yml)

Проект развернут на удаленном сервере по адресу http://185.221.162.231/hrspace:
- админ панель доступна по адресу http://185.221.162.231/admin
- Swagger доступен по адресу http://185.221.162.231/docs
- Redoc доступен по адресу http://185.221.162.231/redoc
Проект развернут на удаленном сервере по адресу http://185.221.162.231:
- админ панель доступна по адресу http://185.221.162.231:81/admin
- Swagger доступен по адресу http://185.221.162.231:81/docs
- Redoc доступен по адресу http://185.221.162.231:81/redoc

<br>

Expand Down Expand Up @@ -38,15 +38,15 @@ nano .env
```bash
docker compose -f docker/docker-compose.yml --env-file .env up -d --build
```
Проект будет развернут в docker-контейнерах по адресу http://localhost/hrspace
Проект будет развернут в docker-контейнерах по адресу http://localhost

Администрирование приложения может быть осуществлено:
- через Swagger доступный по адресу http://localhost/docs
- через админ панель по адресу http://localhost/admin
- через Swagger доступный по адресу http://localhost:81/docs
- через админ панель по адресу http://localhost:81/admin

Техническая документация:
- Swagger доступен по адресу http://localhost/docs
- Redoc доступен по адресу http://localhost/redoc
- Swagger доступен по адресу http://localhost:81/docs
- Redoc доступен по адресу http://localhost:81/redoc

<br>
2. Остановить docker и удалить контейнеры можно командой из корневой директории проекта:
Expand Down
4 changes: 2 additions & 2 deletions app/admin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from starlette_admin.contrib.sqla import Admin
from app.core.dependencies import engine

from .views import City, CityView

admin = Admin(
engine,
"💾 База данных HRSpace",
)

# admin.add_view(CityView(City))
admin.add_view(CityView(City))
# admin.add_view(VacancyView(VacancyName))
6 changes: 3 additions & 3 deletions app/api/endpoints/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ async def get_all_categories(session: async_session):


@router.get(
"/specializations/{spec_id}",
"/specializations/{vacancy_name_id}",
response_model=schemas.FullSpecialization,
responses={**responses.get_404("menu")},
summary=SUM_SPECIALIZATION,
description=(f"{settings.ALL_USERS} {SUM_SPECIALIZATION}"),
)
async def get_spec(spec_id: int, session: async_session):
return await crud.get_or_404(session, models.Specialization, spec_id)
async def get_spec(vacancy_name_id: int, session: async_session):
return await crud.get_or_404(session, models.Specialization, vacancy_name_id)


@router.get(
Expand Down
3 changes: 2 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from fastapi import FastAPI

from app.admin import admin
from app.api.routers import main_router
from app.core.config import settings
from app.core.dependencies import engine
Expand All @@ -24,4 +25,4 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, Any]:
)

app.include_router(main_router)
# admin.mount_to(app)
admin.mount_to(app)
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ services:
depends_on:
db:
condition: service_healthy
expose:
- 8000
ports:
- 81:8000
env_file:
- ../.env

Expand Down
9 changes: 1 addition & 8 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@ server {
server_name "$hostname";
server_tokens off;

location /hrspace {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_pass http://frontend:3000;
}

location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_pass http://backend:8000;
proxy_pass http://frontend:3000;
}
}

0 comments on commit 9105f2d

Please sign in to comment.