Skip to content

Commit

Permalink
Fixed merge conflicts in App.jsx and Documentation.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Kostya-59benz committed Dec 22, 2024
2 parents 833c6b0 + b63b08d commit 34464b5
Show file tree
Hide file tree
Showing 173 changed files with 8,338 additions and 8,820 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
DB_USER: postgres
DB_PASSWORD: password
DB_HOST: db
STARKNET_NODE_URL: http://178.32.172.148:6060
STARKNET_NODE_URL: http://51.195.57.196:6060/v0_7
REDIS_HOST: redis
REDIS_PORT: 6379
ENV_VERSION: DEV
Expand All @@ -37,7 +37,7 @@ jobs:

- name: Create .env file
run: |
cat << EOF > .env.dev
cat << EOF > /home/runner/work/spotnet/spotnet/.env
ENV_VERSION=DEV
STARKNET_NODE_URL=${{ env.STARKNET_NODE_URL }}
DB_USER=${{ env.DB_USER }}
Expand Down Expand Up @@ -65,30 +65,30 @@ jobs:
run: |
while ! curl -s http://localhost:8000/health > /dev/null; do
echo "Waiting for backend service..."
sleep 10
sleep 30
# Check if the container is still running before logging
if ! docker ps | grep -q backend_dev; then
if ! docker ps | grep -q backend; then
echo "Backend container is not running!"
docker compose -f docker-compose.dev.yaml logs backend_dev || true
docker compose -f docker-compose.dev.yaml logs backend || true
exit 1
fi
# Log the backend service status for debugging purposes.
docker compose -f docker-compose.dev.yaml logs backend_dev || true
docker compose -f docker-compose.dev.yaml logs backend || true
done
- name: Apply Migrations
run: |
docker exec backend_dev alembic -c web_app/alembic.ini upgrade head || {
echo "Migration failed. Showing backend logs:"
docker compose -f docker-compose.dev.yaml logs backend_dev || true
docker compose -f docker-compose.dev.yaml logs backend || true
exit 1
}
- name: Run Integration Tests with Coverage
run: |
docker exec backend_dev bash -c "cd /app && python -m pytest web_app/test_integration/ -v"
docker compose exec backend bash -c "cd /app && python -m pytest web_app/test_integration/ -v"
- name: Clean Up
Expand Down
44 changes: 44 additions & 0 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

FROM python:3.12-slim

# Environment settings
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1

# Set PATH for Poetry
ENV PATH="/root/.local/bin:$PATH"

# Add system-level dependencies (including gcc and npm)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpq-dev gcc g++ make libffi-dev build-essential \
curl nodejs npm \
dos2unix \
&& rm -rf /var/lib/apt/lists/*

# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -

# Create app directory
RUN mkdir /app
WORKDIR /app

# Copy the pyproject.toml and poetry.lock files into container's /app/ directory
COPY pyproject.toml poetry.lock /app/

# Install dependencies from the poetry.lock file
RUN poetry config virtualenvs.create false \
&& poetry install --no-dev --no-interaction --no-root

# Copy the rest of the application code
ADD . /app

# Install StarknetKit via npm with legacy-peer-deps flag
RUN npm install @argent/get-starknet --legacy-peer-deps --save

# Set the entrypoint script as executable
# Copy the rest of the application code and set the entrypoint
COPY . /app
RUN dos2unix /app/entrypoint.sh

EXPOSE 8000
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ This guide explains how to start the development environment for the project usi
docker-compose -f docker-compose.dev.yaml up --build
```

For Windows users, use this command to build and start the development environment:

```sh
docker-compose -f docker-compose.dev-windows.yaml up --build
```

This command will:
- Build the backend and frontend Docker images.
- Start the backend, frontend, and PostgreSQL database containers.
Expand All @@ -60,6 +66,10 @@ This guide explains how to start the development environment for the project usi
```sh
docker-compose -f docker-compose.dev.yaml build --no-cache
```
Windows users:
```sh
docker-compose -f docker-compose.dev-windows.yaml build --no-cache
```

## How to run test cases
In root folder run next commands:
Expand All @@ -82,6 +92,11 @@ To stop the environment and remove containers, use:
```sh
docker-compose -f docker-compose.dev.yaml down
```
windows users:

```sh
docker-compose -f docker-compose.dev-windows.yaml down
```

This command stops all running containers and removes them, but the data volumes will persist.

Expand All @@ -92,6 +107,10 @@ If you have made changes to the code or Docker configuration, rebuild the contai
```sh
docker-compose -f docker-compose.dev.yaml up --build
```
windows users:
```sh
docker-compose -f docker-compose.dev-windows.yaml up --build
```

## About Celery

Expand Down Expand Up @@ -129,6 +148,10 @@ docker-compose run --rm celery celery -A spotnet_tracker.celery_config purge
```
docker-compose -f docker-compose.dev.yaml up --build
```
windows only:
```
docker-compose -f docker-compose.dev-windows.yaml up --build
```
2. In new terminal window run command to populate db
```
docker exec -ti backend_dev python -m web_app.db.seed_data
Expand All @@ -140,6 +163,10 @@ Run up docker containers
```bash
docker-compose -f docker-compose.dev.yaml up --build
```
Windows users:
```bash
docker-compose -f docker-compose.dev-windows.yaml up --build
```
Go to backend container in new terminal window
```bash
docker exec -ti backend_dev bash
Expand Down
67 changes: 67 additions & 0 deletions docker-compose.dev-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

version: '3.8'

networks:
app_network:
driver: bridge

services:
backend:
build:
context: .
dockerfile: Dockerfile.windows
command: ["/bin/bash", "-c", "chmod +x /app/entrypoint.sh && /app/entrypoint.sh"]
container_name: backend_dev
volumes:
- .:/app
env_file:
- .env.dev
ports:
- "8000:8000"
networks:
- app_network
depends_on:
- db
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=spotnet
- DB_USER=postgres
- DB_PASSWORD=password

db:
image: postgres:16
container_name: postgres_dev
environment:
POSTGRES_DB: spotnet
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
volumes:
- postgres_data_dev:/var/lib/postgresql/data
- ./init-db:/docker-entrypoint-initdb.d
networks:
- app_network
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5

frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
container_name: frontend_dev
volumes:
- ./frontend:/app
ports:
- "3000:80"
networks:
- app_network
depends_on:
- backend

volumes:
postgres_data_dev:
1 change: 1 addition & 0 deletions frontend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
},
moduleNameMapper: {
'\\.svg$': '<rootDir>/test/__mocks__/svgMock.js',
'\\.css$': '<rootDir>/test/__mocks__/styleMock.js',
'^src/(.*)$': ['<rootDir>/src/$1'],
},
transformIgnorePatterns: [
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
},
"devDependencies": {
"@babel/preset-env": "^7.26.0",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@tanstack/eslint-plugin-query": "^5.60.1",
"@testing-library/jest-dom": "^6.6.2",
"@types/jest": "^29.5.14",
Expand Down
Binary file removed frontend/public/Form-bg.png
Binary file not shown.
Binary file removed frontend/public/Windowbackground Vault.png
Binary file not shown.
File renamed without changes
Binary file added frontend/public/mobile-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed frontend/public/mobilebackground.png
Binary file not shown.
Loading

0 comments on commit 34464b5

Please sign in to comment.