Skip to content

SuchitArtal/hackathon-project

Repository files navigation

#Educational Skill Assessment Platform

A full-stack platform for personalized skill assessment and learning roadmap generation.

Tech Stack

  • Frontend: React.js (TypeScript) + Zustand + Tailwind CSS
  • Backend: Express.js + Prisma ORM + PostgreSQL
  • Auth Service: FastAPI + SQLModel + Alembic + JWT
  • AI Service: FastAPI + GPT-4 Integration
  • Database: PostgreSQL + Redis
  • Infrastructure: Docker + Docker Compose + GitHub Actions

Prerequisites

  • Docker and Docker Compose
  • Node.js (v18+) (for local frontend dev)
  • Python (v3.11+) (for local FastAPI dev)

Setup & Usage (Docker Compose)

  1. Clone the repository:

    git clone https://github.com/yourusername/hackathon-project.git
    cd hackthon-project
  2. Configure environment variables:

    • Copy .env.example to .env and fill in your secrets:
      cp .env.example .env
      # Edit .env with your DATABASE_URL, JWT_SECRET, GOOGLE_CLIENT_ID, etc.
    • Example for Postgres:
      DATABASE_URL=postgresql://bhaktisn:IDRP_jnanasetu@postgres:5432/bhaktisn
      JWT_SECRET=your_jwt_secret
      GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
  3. Start all services with Docker:

    docker-compose up -d --build

    This will start Postgres, Redis, backend, frontend, auth-service, and ai-service.

  4. Run database migrations:

    • Backend (Prisma):
      docker-compose exec backend npx prisma migrate deploy
    • Auth Service (Alembic):
      docker-compose exec auth-service alembic upgrade head
  5. Access the app:

Running All Services Locally (Hot Reload)

If you want to run all services locally with hot-reloading:

  1. Stop all Docker containers:

    docker-compose down
  2. Start Postgres and Redis in Docker:

    docker-compose up -d postgres redis
  3. Run the backend locally:

    cd backend
    npm install
    npm run dev

    The backend will be available at http://localhost:3000.

  4. Run the auth-service locally:

    cd auth-service
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
    uvicorn main:app --reload --port 8000

    The auth-service will be available at http://localhost:8000.

  5. Run the ai-service locally:

    cd ai-service
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
    uvicorn main:app --reload --port 8001

    The ai-service will be available at http://localhost:8001.

  6. Run the frontend locally:

    cd frontend
    npm install
    npm run dev

    The frontend will be available at http://localhost:5173 and will reload on code changes.

Inspecting Users in PostgreSQL

To check user details in the Postgres container:

docker-compose exec postgres psql -U bhaktisn -d bhaktisn

Then in the psql prompt:

SELECT * FROM "user";

Project Structure


├── frontend/           # React + TypeScript frontend
├── backend/            # Express.js backend
├── auth-service/       # FastAPI Auth service
├── ai-service/         # FastAPI AI service
├── docker/             # Docker configuration
└── docs/               # API documentation

Troubleshooting

  • Database connection errors:
    • Ensure DATABASE_URL uses postgres as the host, not localhost.
    • If you change the DB name, run docker-compose down -v to reset volumes.
  • Migrations not running:
    • Make sure the service is healthy and the DB exists.
  • Environment variables not updating:
    • Rebuild containers after changing .env: docker-compose up -d --build

Development Guidelines

  • Use feature branches and pull requests for all changes
  • Follow TypeScript and Python best practices
  • Implement proper error handling and validation
  • Write unit tests for critical components
  • Follow RESTful API design principles

VS Code Extensions

Recommended extensions for development:

  • ESLint
  • Prettier
  • TypeScript
  • Docker
  • PostgreSQL
  • Python
  • REST Client

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published