AI-powered RAG system for Kazakhstan legislation with comprehensive legal code search, JWT authentication, and production-ready deployment infrastructure.
JurystAi is a next-generation LegalTech platform that indexes all 9 Kazakhstan legal codes and provides intelligent search.
- Constitution of Kazakhstan
- Criminal Code
- Civil Code
- Code of Criminal Procedure
- Code of Civil Procedure
- Labour Code
- Family Code
- Administrative Code
- Tax Code
Backend:
- FastAPI 0.104+ (Python 3.11)
- SQLAlchemy ORM
- PostgreSQL/Supabase
- Alembic migrations
- PyJWT with refresh tokens
- Groq AI + Google GenAI
Frontend:
- Next.js 14 with TypeScript
- React 18
- TailwindCSS
- Supabase client
Infrastructure:
- Railway (Backend deployment)
- Vercel (Frontend deployment)
- GitHub Actions (CI/CD)
- Docker & Docker Compose (Local dev)
- Python 3.11+
- Node.js 18+
- Docker & Docker Compose
- PostgreSQL 14+ (or use Supabase)
- Git
git clone https://github.com/K09-0/juristai.git
cd juristaicp .env.example .envdocker-compose up --buildThis starts:
- PostgreSQL on localhost:5432
- Backend on http://localhost:8000
- Frontend on http://localhost:3000
Backend:
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
alembic upgrade head
uvicorn app.main:app --reloadFrontend:
cd frontend
npm install
npm run devDATABASE_URL=postgresql://user:pass@host/db
GROQ_API_KEY=<your-groq-api-key>
GOOGLE_GENAI_API_KEY=<your-google-genai-key>
SECRET_KEY=<your-jwt-secret-key>
ENV=development|production
DEBUG=true|false
PORT=8000
CORS_ORIGINS=http://localhost:3000,https://yourdomain.comalembic revision --autogenerate -m "message"
alembic upgrade head
alembic downgrade -1curl http://localhost:8000/health| Method | Endpoint | Description |
|---|---|---|
| GET | /health | Health check |
| GET | /status | Detailed status |
| GET | /docs | Swagger UI |
| POST | /auth/register | Register user |
| POST | /auth/login | Login |
| POST | /auth/refresh | Refresh token |
| GET | /legislation/codes | List codes |
| GET | /legislation/search | Search legislation |
| POST | /admin/index-legislation | Trigger indexing |
- Connect GitHub account to Railway
- Create project and select repository
- Add environment variables in Railway dashboard
- Railway auto-deploys on push to main
- Import GitHub repo to Vercel
- Configure build: Framework = Next.js, Root = frontend
- Add environment variables
- Vercel auto-deploys on push to main
For juristai.site:
API (api.juristai.site):
- Type: CNAME
- Value: railway-domain.railway.app
Frontend (www.juristai.site):
- Type: CNAME
- Value: cname.vercel-dns.com
- JWT tokens: Access 30min, Refresh 7 days
- Password: bcrypt with 12 salt rounds
- CORS: Production domains only
- Database: SSL/TLS in production
- Audit logging: All user actions tracked
juristai/
├── backend/
│ ├── app/
│ │ ├── main.py
│ │ ├── config.py
│ │ ├── database.py
│ │ ├── models.py
│ │ └── auth/jwt_auth.py
│ ├── alembic/
│ ├── requirements.txt
│ └── Dockerfile
├── frontend/
│ ├── app/
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── next.config.js
│ └── tailwind.config.js
├── .github/workflows/ci.yml
├── docker-compose.yml
└── README.md
Proprietary - JurystAi Project
JurystAi - Making Kazakhstan legislation accessible. 🇰🇿 ⚖️