diff --git a/compose.yaml b/compose.yaml index bcec386..98dba9e 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,34 +1,35 @@ version: "3" services: - # mongodb: - # image: mongo:bionic - # container_name: mongodb - # ports: - # - "27017:27017" - # environment: - # MONGO_INITDB_ROOT_USERNAME: root - # MONGO_INITDB_ROOT_PASSWORD: password - # MONGO_INITDB_DATABASE: bot - # volumes: - # - mongodb_data:/data/db + mongodb: + image: mongo:bionic + container_name: mongodb + ports: + - "27017:27017" + environment: + MONGO_INITDB_ROOT_USERNAME: root + MONGO_INITDB_ROOT_PASSWORD: password + MONGO_INITDB_DATABASE: bot + volumes: + - ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro + - mongodb_data:/data/db - # bot-api: - # image: oven/bun:1 - # container_name: bot-api - # command: bun run docker-dev - # working_dir: /usr/src/app - # ports: - # - "8080:8080" - # depends_on: - # - mongodb - # environment: - # MONGODB_URI: "mongodb://mongodb:27017/bot" - # MONGODB_USER: "root" - # MONGODB_PASS: "password" - # JWTSECRET: "cooljwtsecret" - # volumes: - # - ./:/usr/src/app:ro + bot-api: + image: oven/bun:1 + container_name: bot-api + command: bun run docker-dev + working_dir: /usr/src/app + ports: + - "8080:8080" + depends_on: + - mongodb + environment: + MONGODB_URI: "mongodb://mongodb:27017/bot" + MONGODB_USER: "root" + MONGODB_PASS: "password" + JWTSECRET: "cooljwtsecret" + volumes: + - ./:/usr/src/app:ro bot-image-moderation-fe: image: oven/bun:1 diff --git a/init-mongo.js b/init-mongo.js new file mode 100644 index 0000000..70dd3a7 --- /dev/null +++ b/init-mongo.js @@ -0,0 +1,10 @@ +db = new Mongo().getDB("bot"); + +db.createCollection('authorizations'); + +db.authorization.insert([ + { + app: "tester", + secret: "test" + } +]) \ No newline at end of file diff --git a/src/App.css b/src/App.css index b9d355d..e69de29 100644 --- a/src/App.css +++ b/src/App.css @@ -1,42 +0,0 @@ -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: filter 300ms; -} -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); -} -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); -} - -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } -} - -.card { - padding: 2em; -} - -.read-the-docs { - color: #888; -} diff --git a/src/App.tsx b/src/App.tsx index afe48ac..03662db 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,33 +1,10 @@ -import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' import './App.css' +import ImageModerator from './components/ImageModerator/ImageModerator' function App() { - const [count, setCount] = useState(0) - return ( <> -
- - Vite logo - - - React logo - -
-

Vite + React

-
- -

- Edit src/App.tsx and save to test HMR -

-
-

- Click on the Vite and React logos to learn more -

+ ) } diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx new file mode 100644 index 0000000..05eb252 --- /dev/null +++ b/src/components/Button/Button.tsx @@ -0,0 +1,8 @@ +export interface ButtonProps { + label: string; + action?: () => void; +} + +export default function ImageViewer(props: ButtonProps) { + return +} \ No newline at end of file diff --git a/src/components/ImageModerator/ImageModerator.tsx b/src/components/ImageModerator/ImageModerator.tsx new file mode 100644 index 0000000..f8d80c3 --- /dev/null +++ b/src/components/ImageModerator/ImageModerator.tsx @@ -0,0 +1,14 @@ +import Button from "../Button/Button"; + +export interface ImageModeratorProps { + url: string; +} + +export default function ImageModerator(props: ImageModeratorProps) { + return
+ +
+} \ No newline at end of file diff --git a/src/index.css b/src/index.css index 6119ad9..332bb71 100644 --- a/src/index.css +++ b/src/index.css @@ -24,10 +24,7 @@ a:hover { body { margin: 0; - display: flex; place-items: center; - min-width: 320px; - min-height: 100vh; } h1 {