Skip to content

Bridgeconn/vachan-admin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

971 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vachan-Admin — Run Backend + Frontend using Docker

This guide explains how to run the Vachan-Admin backend (FastAPI + DB + SuperTokens) and frontend (React/Vite + SuperTokens UI) using Docker.


1. Clone the repository

git clone https://github.com/Bridgeconn/vachan-admin.git
cd vachan-admin

2. Create a common Docker network

Both backend and frontend docker-compose files use the same external network: va-network.

docker network create va-network

If you get an error like “already exists”, that’s fine — it means the network is already created.

3. Run Backend (FastAPI + Postgres + SuperTokens)

3.1 Update backend .env

Go to the backend docker folder and update the .env file used by backend services:

cd docker/docker_backend

Update .env with the following:

# =========================
# SuperTokens DB Config
# =========================
SUPERTOKENS_DB_USER=supertokens_user
SUPERTOKENS_DB_PASSWORD=somePassword
SUPERTOKENS_DB_NAME=supertokens
SUPERTOKENS_DB_CONNECTION_URI=postgresql://${SUPERTOKENS_DB_USER}:${SUPERTOKENS_DB_PASSWORD}@supertokens-db:5432/${SUPERTOKENS_DB_NAME}

# =========================
# SuperTokens App Info (Local)
# =========================
SUPERTOKENS_API_DOMAIN=http://localhost:8000
SUPERTOKENS_WEBSITE_DOMAIN=http://localhost:5174

# Optional: for Swagger / local testing
SUPERTOKENS_ANTI_CSRF=NONE

# =========================
# Cookie settings
# =========================
# NOTE:
# - For local http testing, secure cookies may not work unless you're using https.
# - Keep as-is if your setup expects it.
SUPERTOKENS_COOKIE_SECURE=true
SUPERTOKENS_COOKIE_DOMAIN=api.dev-admin.vachanengine.org
SUPERTOKENS_COOKIE_SAME_SITE=lax

# =========================
# SuperTokens Core Config
# =========================
SUPERTOKENS_CONNECTION_URI=http://supertokens:3567
SUPERTOKENS_API_KEY=your-api-key

# =========================
# Vachan Admin DB Config
# =========================
VACHAN_ADMIN_POSTGRES_HOST=vachan-admin-db
VACHAN_ADMIN_POSTGRES_PORT=5432
VACHAN_ADMIN_POSTGRES_USER=user
VACHAN_ADMIN_POSTGRES_PASSWORD=secret
VACHAN_ADMIN_POSTGRES_DATABASE=db

# =========================
# SMTP Config
# =========================
SMTP_HOST=your-host
SMTP_PORT=your-port
SMTP_NAME=Vachan Admin
SMTP_EMAIL=your-email
SMTP_PASSWORD=your-password
SMTP_SECURE=True

3.2 Start backend containers

Run docker compose in detached mode:

docker compose up --build -d

4. Run Frontend (React + Vite)

4.1 Update frontend .env

Go to the frontend docker folder:

cd ../docker_frontend

Update the frontend .env with the following:

VITE_FASTAPI_BASE_URL=https://api.dev-admin.vachanengine.org
VITE_SUPERTOKENS_API_DOMAIN=https://api.dev-admin.vachanengine.org
VITE_SUPERTOKENS_WEBSITE_DOMAIN=http://localhost:5174

4.2 Start frontend container

Run docker compose in detached mode:

docker compose up --build -d

5. Access URLs (Local)

Backend: http://localhost:8000

Frontend: http://localhost:5174

6. Stop containers (Optional)

To stop backend:

cd ../docker_backend
docker compose down

To stop frontend:

cd ../docker_frontend
docker compose down

About

A tool for adminstration of the Vachan API

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors