Skip to content

Commit b1f1f7f

Browse files
committed
docker file setup
1 parent 3a0d9dc commit b1f1f7f

File tree

12 files changed

+349
-49
lines changed

12 files changed

+349
-49
lines changed

.dockerignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Version control
2+
.git
3+
.gitignore
4+
5+
# Dependencies
6+
node_modules
7+
venv
8+
__pycache__
9+
*.pyc
10+
*.pyo
11+
*.pyd
12+
13+
# Environment
14+
.env
15+
.env.local
16+
.env.*.local
17+
18+
# Development
19+
.vscode
20+
.idea
21+
*.log
22+
npm-debug.log*
23+
24+
# Build
25+
client/build
26+
client/dist
27+
28+
# Docker
29+
Dockerfile
30+
docker-compose.yml
31+
.dockerignore
32+
33+
# Documentation
34+
README.md
35+
*.md
36+
wiki/
37+
38+
# Test
39+
coverage/
40+
.pytest_cache/
41+
__tests__/
42+
test/
43+
tests/
44+
45+
# Misc
46+
.DS_Store
47+
*.swp
48+
*.swo

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use Python 3.11 slim image
2+
FROM python:3.11-slim
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Install system dependencies
8+
RUN apt-get update && apt-get install -y \
9+
build-essential \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
# Copy requirements file
13+
COPY requirements.txt .
14+
15+
# Install Python dependencies
16+
RUN pip install --no-cache-dir -r requirements.txt
17+
18+
# Copy source code
19+
COPY . .
20+
21+
# Expose port
22+
EXPOSE 8000
23+
24+
# Start the application
25+
CMD ["python", "main.py"]

client/Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Build stage
2+
FROM node:18-alpine as build
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Copy package files
8+
COPY package*.json ./
9+
10+
# Install dependencies
11+
RUN npm install
12+
13+
# Copy source code
14+
COPY . .
15+
16+
# Build the application
17+
RUN npm run build
18+
19+
# Production stage
20+
FROM nginx:alpine
21+
22+
# Copy built assets from build stage
23+
COPY --from=build /app/build /usr/share/nginx/html
24+
25+
# Copy nginx configuration
26+
COPY nginx.conf /etc/nginx/conf.d/default.conf
27+
28+
# Expose port 80
29+
EXPOSE 80
30+
31+
# Start nginx
32+
CMD ["nginx", "-g", "daemon off;"]

client/nginx.conf

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
5+
location / {
6+
root /usr/share/nginx/html;
7+
index index.html;
8+
try_files $uri $uri/ /index.html;
9+
}
10+
11+
# Proxy API requests to backend
12+
location /api {
13+
proxy_pass http://backend:8000;
14+
proxy_http_version 1.1;
15+
proxy_set_header Upgrade $http_upgrade;
16+
proxy_set_header Connection 'upgrade';
17+
proxy_set_header Host $host;
18+
proxy_cache_bypass $http_upgrade;
19+
}
20+
21+
# Proxy WebSocket connections
22+
location /ws {
23+
proxy_pass http://backend:8000;
24+
proxy_http_version 1.1;
25+
proxy_set_header Upgrade $http_upgrade;
26+
proxy_set_header Connection "Upgrade";
27+
proxy_set_header Host $host;
28+
}
29+
}

client/src/App.css

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.App {
22
min-height: 100vh;
3-
background-color: #f5f5f5;
3+
background-color: var(--bg-primary);
44
display: flex;
55
flex-direction: column;
66
}
@@ -10,7 +10,7 @@
1010
}
1111

1212
.App-header {
13-
background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%);
13+
background: var(--header-bg);
1414
min-height: 60vh;
1515
display: flex;
1616
flex-direction: column;
@@ -27,13 +27,13 @@
2727
.header-logo img {
2828
width: 500px;
2929
height: auto;
30-
filter: drop-shadow(0 0 25px rgba(74, 144, 226, 0.4));
30+
filter: drop-shadow(0 0 25px var(--shadow-color));
3131
transition: all 0.5s ease;
3232
}
3333

3434
.header-logo img:hover {
3535
transform: scale(1.05);
36-
filter: drop-shadow(0 0 40px rgba(74, 144, 226, 0.8));
36+
filter: drop-shadow(0 0 40px var(--accent-color));
3737
}
3838

3939
@keyframes pulse {
@@ -68,18 +68,18 @@
6868
}
6969

7070
.domain-card {
71-
background: white;
71+
background: var(--card-bg);
7272
padding: 2rem;
7373
border-radius: 8px;
74-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
74+
box-shadow: 0 2px 4px var(--shadow-color);
7575
text-align: center;
7676
cursor: pointer;
7777
transition: transform 0.3s ease, box-shadow 0.3s ease;
7878
}
7979

8080
.domain-card:hover {
8181
transform: translateY(-5px);
82-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
82+
box-shadow: 0 4px 8px var(--shadow-color);
8383
}
8484

8585
.domain-card .domain-icon {
@@ -88,21 +88,21 @@
8888
}
8989

9090
.domain-card h2 {
91-
color: #2c3e50;
91+
color: var(--text-primary);
9292
margin: 0 0 1rem;
9393
font-family: 'Montserrat', sans-serif;
9494
}
9595

9696
.domain-card p {
97-
color: #666;
97+
color: var(--text-secondary);
9898
margin: 0;
9999
line-height: 1.5;
100100
}
101101

102102
.code-features {
103103
margin-top: 1.5rem;
104104
padding-top: 1.5rem;
105-
border-top: 1px solid #eee;
105+
border-top: 1px solid var(--border-color);
106106
}
107107

108108
.code-features ul {
@@ -115,7 +115,7 @@
115115
}
116116

117117
.code-features li {
118-
color: #4a90e2;
118+
color: var(--accent-color);
119119
font-size: 0.95rem;
120120
display: flex;
121121
align-items: center;
@@ -162,4 +162,33 @@
162162

163163
.menu-toggle:hover {
164164
transform: scale(1.1);
165+
}
166+
167+
/* Theme toggle button */
168+
.theme-toggle {
169+
position: fixed;
170+
top: 1rem;
171+
right: 1rem;
172+
background: var(--bg-secondary);
173+
border: none;
174+
border-radius: 50%;
175+
width: 40px;
176+
height: 40px;
177+
display: flex;
178+
align-items: center;
179+
justify-content: center;
180+
cursor: pointer;
181+
box-shadow: 0 2px 4px var(--shadow-color);
182+
z-index: 1000;
183+
transition: all 0.3s ease;
184+
}
185+
186+
.theme-toggle:hover {
187+
transform: scale(1.1);
188+
}
189+
190+
.theme-toggle svg {
191+
width: 20px;
192+
height: 20px;
193+
color: var(--text-primary);
165194
}

client/src/App.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useState } from 'react';
22
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
3+
import { ThemeProvider, useTheme } from './context/ThemeContext';
34
import Navbar from './components/Navbar';
45
import Footer from './components/Footer';
56
import DomainPage from './pages/DomainPage';
@@ -35,7 +36,24 @@ const domainDisplayNames = {
3536
ecommerce: 'E-commerce'
3637
};
3738

38-
function App() {
39+
const ThemeToggle = () => {
40+
const { isDarkMode, toggleTheme } = useTheme();
41+
return (
42+
<button className="theme-toggle" onClick={toggleTheme}>
43+
{isDarkMode ? (
44+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
45+
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1-8.313-12.454z"/>
46+
</svg>
47+
) : (
48+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
49+
<path d="M12 2.25a.75.75 0 01.75.75v2.25a.75.75 0 01-1.5 0V3a.75.75 0 01.75-.75zM7.5 12a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM18.894 6.166a.75.75 0 00-1.06-1.06l-1.591 1.59a.75.75 0 101.06 1.061l1.591-1.59zM21.75 12a.75.75 0 01-.75.75h-2.25a.75.75 0 010-1.5H21a.75.75 0 01.75.75zM17.834 18.894a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 10-1.061 1.06l1.59 1.591zM12 18a.75.75 0 01.75.75V21a.75.75 0 01-1.5 0v-2.25A.75.75 0 0112 18zM7.758 17.303a.75.75 0 00-1.061-1.06l-1.591 1.59a.75.75 0 001.06 1.061l1.591-1.59zM6 12a.75.75 0 01-.75.75H3a.75.75 0 010-1.5h2.25A.75.75 0 016 12zM6.697 7.757a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 00-1.061 1.06l1.59 1.591z"/>
50+
</svg>
51+
)}
52+
</button>
53+
);
54+
};
55+
56+
function AppContent() {
3957
const [isSideMenuOpen, setIsSideMenuOpen] = useState(false);
4058

4159
const toggleSideMenu = () => {
@@ -53,6 +71,7 @@ function App() {
5371
<img src={logo} alt="M.A.D.H.A.V.A. Logo" />
5472
</div>
5573
</header>
74+
<ThemeToggle />
5675
<SideMenu isOpen={isSideMenuOpen} onClose={() => setIsSideMenuOpen(false)} />
5776
<div className="content">
5877
<Routes>
@@ -102,4 +121,12 @@ function App() {
102121
);
103122
}
104123

124+
function App() {
125+
return (
126+
<ThemeProvider>
127+
<AppContent />
128+
</ThemeProvider>
129+
);
130+
}
131+
105132
export default App;

client/src/components/Footer.css

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,31 @@
88
.footer-content {
99
max-width: 1400px;
1010
margin: 0 auto;
11-
display: grid;
12-
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
11+
display: flex;
12+
flex-wrap: wrap;
13+
justify-content: space-between;
14+
align-items: center;
1315
gap: 2rem;
1416
}
1517

16-
.footer-section {
17-
padding: 0 1rem;
18-
}
19-
2018
.footer-logo {
21-
margin-bottom: 1.5rem;
19+
margin-bottom: 0;
2220
display: flex;
23-
justify-content: center;
21+
align-items: center;
2422
}
2523

2624
.footer-logo img {
27-
width: 120px;
25+
width: 100px;
2826
height: auto;
2927
object-fit: contain;
3028
}
3129

30+
.footer-section {
31+
flex: 1;
32+
min-width: 150px;
33+
padding: 0 1rem;
34+
}
35+
3236
.footer-section h3 {
3337
color: #4a90e2;
3438
font-size: 1.5rem;
@@ -86,15 +90,11 @@
8690
}
8791

8892
.footer-content {
89-
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
90-
gap: 1.5rem;
91-
}
92-
93-
.footer-section {
94-
padding: 0;
93+
flex-direction: column;
94+
align-items: center;
9595
}
9696

9797
.footer-logo img {
98-
width: 100px;
98+
width: 80px;
9999
}
100100
}

0 commit comments

Comments
 (0)