Flink is a lightweight version control system that integrates with Firebase for remote repository storage. It supports repository initialization, file staging, commits, pushes, clones, and user profiles with usernames for privacy.
- Initialize public or private repositories
- Clone repositories by name or URL
- View user profiles with repository URLs
- Search and list public repositories
- Secure authentication with Firebase
- Python 3.6+
- A Firebase project with Authentication (Email/Password), Realtime Database, and Storage enabled
pip
for installing dependencies- Git for cloning the repository
Note: Flink does not require a Firebase Admin SDK service account JSON file for client-side operations, as it uses the Firebase Web API for authentication and data access.
Flink will be available on PyPI in the future. Once published, you can install it globally with:
pip install flink-svector
-
Clone the repository:
git clone https://github.com/siddharth-coder8/flink.git cd flink
-
Install dependencies:
pip install -r requirements.txt
-
Set up Firebase configuration:
export FLINK_PROJECT_ID="your-project-id" export FLINK_API_KEY="your-api-key" export FLINK_DATABASE_URL="https://your-project-id-default-rtdb.api.svector.com" export FLINK_BUCKET_NAME="your-project-id.appspot.com"
On Windows, use:
set FLINK_PROJECT_ID=your-project-id set FLINK_API_KEY=your-api-key set FLINK_DATABASE_URL=https://your-project-id-default-rtdb.api.svector.com set FLINK_BUCKET_NAME=your-project-id.appspot.com
-
Deploy Firebase security rules:
-
Copy the provided
database.rules.json
andstorage.rules.json
to your Firebase project. -
Deploy via Firebase Console:
- Realtime Database > Rules > Paste
database.rules.json
> Publish - Storage > Rules > Paste
storage.rules.json
> Publish
- Realtime Database > Rules > Paste
-
Or use the Firebase CLI:
firebase deploy --only database,storage
-
Below are common commands to get started with Flink. Run flink --help
for a full list of commands.
-
Register a new user:
flink register [email protected] username
Enter a password when prompted. Usernames must be unique and 3-50 alphanumeric characters or underscores.
-
Login:
flink login [email protected]
Enter your password when prompted.
-
Initialize a repository:
flink init myrepo
Choose
public
orprivate
visibility. Creates a repository in./myrepo
. -
Add and commit files:
cd myrepo echo "Hello" > file.txt flink add . flink commit -m "Initial commit"
-
Push changes:
flink push
Pushes to
https://api.flink.svector.co.in/username/myrepo
(replace with your domain if customized). -
Clone a repository:
flink clone https://api.flink.svector.co.in/username/myrepo
Or by name if public:
flink clone myrepo
-
View profile:
flink profile
Displays your username, email, and repositories with URLs.
-
List all public repositories:
flink all-repos
-
Search for repositories:
flink search myrepo
Flink stores user credentials securely in ~/.flink/credentials.json
with restricted permissions. To reset credentials:
rm -rf ~/.flink/credentials.json
Contributions are welcome! To contribute:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m "Add your feature"
). - Push to your branch (
git push origin feature/your-feature
). - Open a pull request.
This project is licensed under the MIT License. See LICENSE for details.
For issues, feature requests, or questions:
- Open an issue on GitHub.
- Contact the maintainer at [[email protected]]