Skip to content

cloudstackinnovators/Language-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LanguageApp Backend

A FastAPI backend for language learning, featuring authentication, AI prompt integration, and file upload support.

Features

  • User registration and login with JWT authentication
  • Protected routes
  • AI prompt endpoint (OpenAI integration)
  • File upload endpoint

Requirements

Setup Guide

  1. Clone the repository

    git clone <your-repo-url>
    cd languge_backend
  2. Create and activate a virtual environment

    python -m venv venv
    venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure environment variables

    • Create a .env file in languge_backend/app/ (see .gitignore).
    • Add your OpenAI API key and any other secrets:
      OPENAI_API_KEY=your_openai_api_key
      
  5. Configure the database

    • Update the MySQL connection string in app/database.py if needed.
    • Ensure your MySQL server is running and the database (languageapp_db) exists.
  6. Run the server

    uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
  7. API Endpoints

    • Auth: /auth/register, /auth/login
    • Protected: /protected/
    • AI Prompt: /ai-prompt/
    • File Upload: /files/upload

Notes

  • Uploaded files are saved in the uploads/ directory.
  • The OpenAI API key must be set in your environment or .env file.
  • For development, use the --reload flag with uvicorn.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •