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

psuh all changes #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion backend/.env
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PROJECT_NAME="Full Stack FastAPI Project"
STACK_NAME=full-stack-fastapi-project

# Backend
BACKEND_CORS_ORIGINS="http://localhost,http://localhost:5173,https://localhost,https://localhost:5173"
BACKEND_CORS_ORIGINS="http://stagetwodevops.chickenkiller.com,http://stagetwodevops.chickenkiller.com:5173,https://stagetwodevops.chickenkiller.com,https://stagetwodevops.chickenkiller.com:5173,http://44.212.35.237,http://3.87.64.254:5173,https://3.87.64.254,https://3.87.64.254:5173"
SECRET_KEY=changethis123
[email protected]
FIRST_SUPERUSER_PASSWORD=devops#HNG11
Expand Down
Empty file modified backend/.gitignore
100644 → 100755
Empty file.
38 changes: 38 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Use the official Python image with the desired version
FROM python:3.11-slim

# Install system dependencies and build tools
RUN apt-get update && \
apt-get install -y curl build-essential && \
rm -rf /var/lib/apt/lists/*

# Install Poetry
RUN pip install poetry

# Add Poetry to PATH
ENV PATH="/root/.local/bin:$PATH"

# Set the working directory in the container
WORKDIR /app

# Copy pyproject.toml and poetry.lock to the working directory
COPY pyproject.toml poetry.lock* /app/

# Install dependencies using Poetry
RUN poetry install --no-root --no-interaction --no-ansi

# Copy the rest of the application code to the container
COPY . /app

# Ensure the application directory is in the Python path
ENV PYTHONPATH=/app

# Ensure the prestart.sh script is executable
RUN chmod +x ./prestart.sh

# Expose the application port
EXPOSE 8000

# Command to run the backend server
CMD poetry run bash ./prestart.sh;poetry run uvicorn app.main:app --host 0.0.0.0 --port 8000

Empty file modified backend/README.md
100644 → 100755
Empty file.
Empty file modified backend/app/__init__.py
100644 → 100755
Empty file.
Empty file modified backend/app/alembic/versions/e2412789c190_initialize_models.py
100644 → 100755
Empty file.
Empty file modified backend/app/api/__init__.py
100644 → 100755
Empty file.
Empty file modified backend/app/api/deps.py
100644 → 100755
Empty file.
Empty file modified backend/app/api/main.py
100644 → 100755
Empty file.
Empty file modified backend/app/api/routes/__init__.py
100644 → 100755
Empty file.
Empty file modified backend/app/api/routes/items.py
100644 → 100755
Empty file.
Empty file modified backend/app/api/routes/login.py
100644 → 100755
Empty file.
Empty file modified backend/app/api/routes/users.py
100644 → 100755
Empty file.
Empty file modified backend/app/api/routes/utils.py
100644 → 100755
Empty file.
Empty file modified backend/app/backend_pre_start.py
100644 → 100755
Empty file.
Empty file modified backend/app/core/__init__.py
100644 → 100755
Empty file.
Empty file modified backend/app/core/config.py
100644 → 100755
Empty file.
Empty file modified backend/app/core/db.py
100644 → 100755
Empty file.
Empty file modified backend/app/core/security.py
100644 → 100755
Empty file.
Empty file modified backend/app/crud.py
100644 → 100755
Empty file.
Empty file modified backend/app/email-templates/build/new_account.html
100644 → 100755
Empty file.
Empty file modified backend/app/email-templates/build/reset_password.html
100644 → 100755
Empty file.
Empty file modified backend/app/email-templates/build/test_email.html
100644 → 100755
Empty file.
Empty file modified backend/app/email-templates/src/new_account.mjml
100644 → 100755
Empty file.
Empty file modified backend/app/email-templates/src/reset_password.mjml
100644 → 100755
Empty file.
Empty file modified backend/app/email-templates/src/test_email.mjml
100644 → 100755
Empty file.
Empty file modified backend/app/initial_data.py
100644 → 100755
Empty file.
Empty file modified backend/app/main.py
100644 → 100755
Empty file.
Empty file modified backend/app/models.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/__init__.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/api/__init__.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/api/routes/__init__.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/api/routes/test_items.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/api/routes/test_login.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/api/routes/test_users.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/conftest.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/crud/__init__.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/crud/test_user.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/scripts/__init__.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/scripts/test_backend_pre_start.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/scripts/test_test_pre_start.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/utils/__init__.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/utils/item.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/utils/user.py
100644 → 100755
Empty file.
Empty file modified backend/app/tests/utils/utils.py
100644 → 100755
Empty file.
Empty file modified backend/app/utils.py
100644 → 100755
Empty file.
Empty file modified backend/poetry.lock
100644 → 100755
Empty file.
Empty file modified backend/prestart.sh
100644 → 100755
Empty file.
Empty file modified backend/pyproject.toml
100644 → 100755
Empty file.
75 changes: 75 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
version: '3.8'

services:
postgres:
image: postgres:13
environment:
POSTGRES_USER: app
POSTGRES_PASSWORD: changethis123
POSTGRES_DB: app
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"

backend:
build: ./backend
volumes:
- ./backend:/app
ports:
- "8000:8000"
depends_on:
- postgres
environment:
- POSTGRES_SERVER=postgres
- POSTGRES_PORT=5432
- POSTGRES_DB=app
- POSTGRES_USER=app
- POSTGRES_PASSWORD=changethis123
- BACKEND_CORS_ORIGINS=http://localhost,http://localhost:5173,https://localhost,https://localhost:5173,http://localhost:8000,https://localhost:8000,http://localhost:8000/api,https://localhost:8000/api,http://localhost:8000/api/
- SECRET_KEY=changethis123
- [email protected]
- FIRST_SUPERUSER_PASSWORD=devops#HNG11
- USERS_OPEN_REGISTRATION=True

frontend:
build: ./frontend
command: ["npm", "run", "dev"]
volumes:
- ./frontend:/app
ports:
- "5173:5173"

nginx:
image: nginx:latest
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
ports:
- "80:80"
- "443:443"
depends_on:
- frontend
- backend

adminer:
image: adminer:latest
restart: always
ports:
- "8080:8080"
environment:
ADMINER_DEFAULT_SERVER: db

proxy-manager:
image: jc21/nginx-proxy-manager:latest
restart: unless-stopped
ports:
- "8090:81"
volumes:
- ./proxy/data:/data
- ./proxy/letsencrypt:/etc/letsencrypt
depends_on:
- nginx


volumes:
postgres_data:
2 changes: 1 addition & 1 deletion frontend/.env
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_API_URL=http://localhost:8000
VITE_API_URL=http://stagetwodevops.chickenkiller.com
Empty file modified frontend/.gitignore
100644 → 100755
Empty file.
26 changes: 26 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use a specific Node.js version for better consistency
FROM node:20

# Set working directory
WORKDIR /app

# Copy package.json and package-lock.json (if you have it)
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application
COPY . .

# Build the Next.js app for production
RUN npm run build

# Expose the port Next.js is expected to run on (usually 3000)
EXPOSE 5173

# Set the working directory to the 'dist' folder
WORKDIR /app/dist

# Start the Next.js server
CMD ["npx", "serve", "-s", "-l", "5173", "-H", "0.0.0.0"]
Empty file modified frontend/README.md
100644 → 100755
Empty file.
Empty file modified frontend/biome.json
100644 → 100755
Empty file.
Empty file modified frontend/index.html
100644 → 100755
Empty file.
Empty file modified frontend/modify-openapi-operationids.js
100644 → 100755
Empty file.
Empty file modified frontend/package-lock.json
100644 → 100755
Empty file.
Empty file modified frontend/package.json
100644 → 100755
Empty file.
Empty file modified frontend/public/assets/images/fastapi-logo.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified frontend/public/assets/images/favicon.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified frontend/src/client/core/ApiError.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/client/core/ApiRequestOptions.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/client/core/ApiResult.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/client/core/CancelablePromise.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/client/core/OpenAPI.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/client/core/request.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/client/core/types.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/client/index.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/client/models.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/client/schemas.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/client/services.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/components/Admin/AddUser.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/Admin/EditUser.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/Common/ActionsMenu.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/Common/DeleteAlert.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/Common/Navbar.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/Common/NotFound.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/Common/Sidebar.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/Common/SidebarItems.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/Common/UserMenu.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/Items/AddItem.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/Items/EditItem.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/UserSettings/Appearance.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/UserSettings/ChangePassword.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/UserSettings/DeleteAccount.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/UserSettings/DeleteConfirmation.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/components/UserSettings/UserInformation.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/hooks/useAuth.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/hooks/useCustomToast.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/main.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/routeTree.gen.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/routes/__root.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/routes/_layout.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/routes/_layout/admin.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/routes/_layout/index.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/routes/_layout/items.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/routes/_layout/settings.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/routes/login.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/routes/recover-password.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/routes/reset-password.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/theme.tsx
100644 → 100755
Empty file.
Empty file modified frontend/src/utils.ts
100644 → 100755
Empty file.
Empty file modified frontend/src/vite-env.d.ts
100644 → 100755
Empty file.
Empty file modified frontend/tsconfig.json
100644 → 100755
Empty file.
Empty file modified frontend/tsconfig.node.json
100644 → 100755
Empty file.
6 changes: 5 additions & 1 deletion frontend/vite.config.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ import { defineConfig } from "vite"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), TanStackRouterVite()],
})
server: {
host: '0.0.0.0',
port: 5173,
},
})
40 changes: 40 additions & 0 deletions nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
server {
listen 80;
server_name stagetwodevops.chickenkiller.com; # Use your IPv4 address here

location / {
proxy_pass http://frontend:5173; # Forward to frontend
}

location /api {
proxy_pass http://backend:8000/api; # Forward to backend API
}

location /docs {
proxy_pass http://backend:8000/docs; # Forward to backend docs
}

location /redoc {
proxy_pass http://backend:8000/redoc; # Forward to backend redoc
}
}

server {
listen 80;
# listen [::]:80;
server_name proxy.stagetwodevops.chickenkiller.com;

location / {
proxy_pass http://proxy-manager:8090;
}
}

server {
listen 80;
# listen [::]:80;
server_name db.stagetwodevops.chickenkiller.com;

location / {
proxy_pass http://adminer:8080;
}
}
Binary file added proxy/data/database.sqlite
Binary file not shown.
4 changes: 4 additions & 0 deletions proxy/data/keys.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAplz4qpFmKupAF8h9+14Gl9V63mB/Maa6hXdc8XzFb6y45eIc\ns0QEbjGKS+2DLHnMMpFaTf+vtHtF5kt871dSxy/MBsRZ7ZryY2szGYAINas2AnSz\nYAgpMPfurIYcRVg3PGFgTTZyoPcH15DkhLNSabAY1MwPgeD5J1gOzqwMhyPv10K/\nnCecjqLvnwbG1Vt8Q982dbqIAGKlnOlbUr6Bcepk1SjdBRLPBdqlXcOvbUpFuUXe\nEig2TCt5ta88uD8HM/b0xHXwD/02SgOf8Wi4ScCsjk3Po6FU3ZJfHaw2Df6sIscR\np38KwVpy5HrjnJVmdA8NpiYxABksaZ1UR/ACEQIDAQABAoIBAEbEaar06sb6moUD\nbkPNPXS9BOUvmyudxt4bZlf7QWk9yfFP+/Ftz4yoWjHuOMxkiy4/knB3gWB+x78t\nAVo2hS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