Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Secure AI Code Challenge App

A full-stack application that generates interactive coding challenges using AI.
Built with FastAPI, React, OpenAI, and Clerk for secure authentication.


🚀 Features

  • AI-generated coding challenges using OpenAI (GPT-4o)
  • Secure authentication with Clerk
  • Persistent progress tracking with SQLite
  • Fast, async backend using FastAPI
  • Modern frontend with React + Vite

🛠 Tech Stack

Frontend

  • React (Vite)
  • Tailwind CSS
  • Clerk Authentication

Backend

  • Python 3.10+
  • FastAPI
  • SQLAlchemy
  • Pydantic
  • OpenAI API

⚙️ Setup Instructions

Prerequisites

  • Node.js & npm
  • Python 3.10+
  • (Optional) uv package manager

1. Clone the Repository

git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name

2. Backend Setup

Navigate to the backend directory:

cd backend

Install Dependencies

Option A: Using uv (Recommended)

uv sync

Option B: Using standard pip

python -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activate

pip install -r pyproject.toml

Configure Environment Variables

Create a .env file inside the backend folder:

DATABASE_URL=sqlite:///./database.db

OPENAI_API_KEY=your_openai_api_key_here

CLERK_SECRET_KEY=your_clerk_secret_key_here
CLERK_WEBHOOK_SECRET=your_clerk_webhook_secret_here

JWT_KEY="-----BEGIN PUBLIC KEY-----
YOUR_PUBLIC_KEY_CONTENT_HERE
-----END PUBLIC KEY-----"

Run the Backend Server

# Using uv
uv run fastapi dev server.py

# Using standard python
fastapi dev server.py

Backend runs at:

http://127.0.0.1:8000

3. Frontend Setup

Open a new terminal and navigate to the frontend directory:

cd frontend

Install Dependencies

npm install

Configure Environment Variables

Create a .env.local file inside the frontend folder:

VITE_CLERK_PUBLISHABLE_KEY=pk_test_your_publishable_key_here

Run the Frontend

npm run dev

Frontend runs at:

http://localhost:5173

🧪 Usage

  1. Open http://localhost:5173
  2. Sign up or log in using Clerk
  3. Click Generate Challenge
  4. Select an answer
  5. Score updates automatically

📌 Notes

  • Both frontend and backend must be running
  • Valid OpenAI and Clerk keys are required
  • SQLite is used by default

📄 License

MIT License

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages