Skip to content

Commit

Permalink
Merge pull request #5 from TheWitcher1991/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
TheWitcher1991 authored Nov 12, 2024
2 parents f6c05ce + 939984e commit f56d83e
Show file tree
Hide file tree
Showing 412 changed files with 5,914 additions and 1,082 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/.fleet/
/venv/
/media/
/frontend/node_modules
/backend/crud.txt
/node_modules/
*.sqlite3
/frontend-old
/old
/old/
Binary file removed backend/business/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed backend/business/__pycache__/apps.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file removed backend/business/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file removed backend/business/__pycache__/views.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed backend/config/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed backend/config/__pycache__/celery.cpython-312.pyc
Binary file not shown.
Binary file removed backend/config/__pycache__/settings.cpython-312.pyc
Binary file not shown.
Binary file removed backend/config/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file removed backend/config/__pycache__/wsgi.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/apps.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file removed backend/core/__pycache__/decorators.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/defines.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/managers.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/middleware.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/mixins.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/paginations.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/serializers.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/throttling.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/utils.cpython-312.pyc
Binary file not shown.
Binary file removed backend/core/__pycache__/views.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed backend/employee/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed backend/employee/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file removed backend/employee/__pycache__/apps.cpython-312.pyc
Binary file not shown.
Binary file removed backend/employee/__pycache__/managers.cpython-312.pyc
Binary file not shown.
Binary file removed backend/employee/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file removed backend/employee/__pycache__/signals.cpython-312.pyc
Binary file not shown.
Binary file removed backend/employee/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file removed backend/employee/__pycache__/views.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed backend/patient/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed backend/patient/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file removed backend/patient/__pycache__/apps.cpython-312.pyc
Binary file not shown.
Binary file removed backend/patient/__pycache__/defines.cpython-312.pyc
Binary file not shown.
Binary file removed backend/patient/__pycache__/managers.cpython-312.pyc
Binary file not shown.
Binary file removed backend/patient/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file removed backend/patient/__pycache__/signals.cpython-312.pyc
Binary file not shown.
Binary file removed backend/patient/__pycache__/tasks.cpython-312.pyc
Binary file not shown.
Binary file removed backend/patient/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file removed backend/patient/__pycache__/views.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions cluster/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
__pycache__
venv
.venv
.git
.gitattributes
.github
.idea
docs
scripts
bin
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 21 additions & 21 deletions docker-compose.yml → cluster/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: hospital-prod
name: hospital-cluster

services:
nginx:
Expand All @@ -17,61 +17,61 @@ services:

postgres:
extends:
file: ./docker-compose.base.yml
file: docker-compose.base.yml
service: postgres
env_file:
- ./backend/.env.prod
- ../backend/.env.prod

redis:
extends:
file: ./docker-compose.base.yml
file: docker-compose.base.yml
service: redis
command:
- /bin/sh
- -c
- redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}"
env_file:
- ./backend/.env.prod
- ../backend/.env.prod

rabbitmq:
extends:
file: ./docker-compose.base.yml
file: docker-compose.base.yml
service: rabbitmq
env_file:
- ./backend/.env.prod
- ../backend/.env.prod

zookeeper:
extends:
file: ./docker-compose.base.yml
file: docker-compose.base.yml
service: zookeeper
env_file:
- ./backend/.env.kafka
- ../backend/.env.kafka

kafka:
extends:
file: ./docker-compose.base.yml
file: docker-compose.base.yml
service: kafka
depends_on:
- zookeeper:
condition: service_started
env_file:
- ./backend/.env.kafka
- ../backend/.env.kafka

kafka_ui:
extends:
file: ./docker-compose.base.yml
file: docker-compose.base.yml
service: kafka_ui
depends_on:
- kafka:
condition: service_started

backend:
extends:
file: ./docker-compose.base.yml
file: docker-compose.base.yml
service: backend
build:
context: ./backend
dockerfile: ./Dockerfile
context: ../backend
dockerfile: ../backend/Dockerfile
depends_on:
postgres:
condition: service_healthy
Expand All @@ -84,24 +84,24 @@ services:

frontend:
extends:
file: ./docker-compose.base.yml
file: docker-compose.base.yml
service: frontend
build:
context: ./frontend
dockerfile: ./Dockerfile
context: microfrontends/frontend
dockerfile: microfrontends/frontend/Dockerfile
depends_on:
backend:
condition: service_started

redisinsight:
extends:
file: ./docker-compose.base.yml
file: docker-compose.base.yml
service: redisinsight
depends_on:
redis:
condition: service_healthy
env_file:
- ./backend/.env.prod
- ../backend/.env.prod

pgadmin:
image: dpage/pgadmin4:8.11.0
Expand All @@ -110,7 +110,7 @@ services:
postgres:
condition: service_healthy
env_file:
- backend/.env.prod
- ../backend/.env.prod
networks:
- default-network
restart: on-failure
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ yarn-error.log*

# typescript
*.tsbuildinfo
next-env.d.ts
../../../old/414/next-env.d.ts
1 change: 1 addition & 0 deletions cluster/microfrontends/hospital-patient/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.1
File renamed without changes.
File renamed without changes.
55 changes: 55 additions & 0 deletions cluster/microfrontends/hospital-patient/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Dockerfile for production mode

#
# ---------------------------------------------------------
#
FROM node:20-alpine AS deps

RUN apk add --no-cache libc6-compat

WORKDIR /app

COPY package.json yarn.lock ./
RUN yarn install

#
# ---------------------------------------------------------
#
FROM node:20-alpine AS builder

WORKDIR /app

COPY --from=deps /app/node_modules ./node_modules
COPY . .

ENV NEXT_TELEMETRY_DISABLED 1

RUN yarn build

#
# ---------------------------------------------------------
#
FROM node:20-alpine AS runner

WORKDIR /app

ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/next.config.ts ./next.config.ts

USER nextjs

EXPOSE 3000

ENV PORT 3000

ENV HOSTNAME "0.0.0.0"

CMD ["yarn", "start"]
36 changes: 36 additions & 0 deletions cluster/microfrontends/hospital-patient/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
5 changes: 5 additions & 0 deletions cluster/microfrontends/hospital-patient/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
38 changes: 38 additions & 0 deletions cluster/microfrontends/hospital-patient/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
reactStrictMode: true,
swcMinify: true,
poweredByHeader: false,
output: 'standalone',
env: {
API_URL: process.env.API_URL,
API_VERSION: process.env.API_VERSION,
WS_URL: process.env.WS_URL,
},
images: {
domains: ['https://www.minobrnauki.gov.ru/', 'localhost'],
},
async rewrites() {
return [
{
source: '/api/core/:path*',
destination: 'http://localhost:8000/api/:path*',
},
{
source: '/api/patient/:path*',
destination: 'http://localhost:8001/api/:path*',
},
{
source: '/api/employee/:path*',
destination: 'http://localhost:8002/api/:path*',
},
{
source: '/api/business/:path*',
destination: 'http://localhost:8003/api/:path*',
},
]
},
}

export default nextConfig
Loading

0 comments on commit f56d83e

Please sign in to comment.