This directory contains the backend service for CommitFill.
The backend handles:
- GitHub OAuth authentication
- Commit creation logic
- Interaction with the GitHub API
- Flask
- SQLAlchemy
- JWT
- GitPython
- NeonDB
- GitHub OAuth
- Navigate to the backend directory:
cd backend - Create virtual environment:
uv venv
- Install dependencies:
uv sync
- Create environment variables:
cp .env.example .env
- Initialize the environment variables in .env file
- Create database ->
uv run python >>> from app import app,db >>> with app.app_context(): ... db.create_all()
- Start the backend server:
uv run flask run
To set up GitHub OAuth for this backend application, follow these steps:
- Navigate to your GitHub account settings.
- Go to "Developer settings" > "OAuth Apps".
- Click on "New OAuth App".
- Fill in the required fields, such as the application name, homepage URL, and authorization callback URL.
- After creating the app, copy the Client ID and Client Secret provided by GitHub.
- Use these credentials in your backend configuration to enable OAuth authentication.
GITHUB_CLIENT_ID=YOUR_GITHUB_CLIENT_IDGITHUB_CLIENT_SECRET=YOUR_GITHUB_CLIENT_SECRETDATABASE_URL=YOUR_DATABASE_URLFERNET_SECRET_KEY=YOUR_FERNET_SECRET_KEYJWT_SECRET_KEY=YOUR_JWT_SECRET_KEYFRONTEND_URL=http://localhost:8080
- Users authenticate with GitHub via OAuth
- The backend generates commits with custom timestamps
- Commits are pushed to the user’s repository
- GitHub reflects them in the contribution graph