barreloflube commited on
Commit
23c0171
·
1 Parent(s): 136f9cf

feat: add GitHub Actions workflow for Hugging Face Space deployment and update README

Browse files
Files changed (2) hide show
  1. .github/workflows/push-to-huggingface.yml +34 -0
  2. README.md +21 -161
.github/workflows/push-to-huggingface.yml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Push to Hugging Face Space
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - gh-pages # Set to your default branch if different
7
+ workflow_dispatch: # Allow manual triggering of the workflow
8
+
9
+ jobs:
10
+ push-to-huggingface:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v3
15
+ with:
16
+ fetch-depth: 0
17
+
18
+ - name: Configure Git
19
+ run: |
20
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
21
+ git config --global user.name "GitHub Actions"
22
+
23
+ - name: Push to Hugging Face Space
24
+ env:
25
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
26
+ HF_SPACE: ${{ secrets.HF_SPACE }} # Format: username/space-name
27
+ run: |
28
+ echo "Pushing to Hugging Face Space: ${HF_SPACE}"
29
+
30
+ # Set URL with token for authentication
31
+ git remote add space https://api-key:${HF_TOKEN}@huggingface.co/spaces/${HF_SPACE}
32
+
33
+ # Push to the gh-pages branch of the Space
34
+ git push --force space gh-pages:gh-pages
README.md CHANGED
@@ -1,177 +1,37 @@
1
- # React + Vite + TypeScript Template (react-vite-ui)
2
 
3
- [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Dan5py/react-vite-ui/blob/main/LICENSE)
4
 
5
- A React + Vite template powered by shadcn/ui.
6
 
7
- ## 🎉 Features
8
 
9
- - **React** - A JavaScript library for building user interfaces.
10
- - **Vite** - A fast, opinionated frontend build tool.
11
- - **TypeScript** - A typed superset of JavaScript that compiles to plain JavaScript.
12
- - **Tailwind CSS** - A utility-first CSS framework.
13
- - **Tailwind Prettier Plugin** - A Prettier plugin for formatting Tailwind CSS classes.
14
- - **ESLint** - A pluggable linting utility for JavaScript and TypeScript.
15
- - **PostCSS** - A tool for transforming CSS with JavaScript.
16
- - **Autoprefixer** - A PostCSS plugin to parse CSS and add vendor prefixes.
17
- - **shadcn/ui** - Beautifully designed components that you can copy and paste into your apps.
18
 
19
- ## ⚙️ Prerequisites
20
 
21
- Make sure you have the following installed on your development machine:
 
 
22
 
23
- - Node.js (version 16 or above)
24
- - pnpm (package manager)
25
 
26
- ## 🚀 Getting Started
27
-
28
- Follow these steps to get started with the react-vite-ui template:
29
-
30
- 1. Clone the repository:
31
-
32
- ```bash
33
- git clone https://github.com/dan5py/react-vite-ui.git
34
- ```
35
-
36
- 2. Navigate to the project directory:
37
-
38
- ```bash
39
- cd react-vite-ui
40
- ```
41
-
42
- 3. Install the dependencies:
43
-
44
- ```bash
45
- pnpm install
46
- ```
47
-
48
- 4. Start the development server:
49
-
50
- ```bash
51
- pnpm dev
52
- ```
53
-
54
- ## 📜 Available Scripts
55
-
56
- - pnpm dev - Starts the development server.
57
- - pnpm build - Builds the production-ready code.
58
- - pnpm lint - Runs ESLint to analyze and lint the code.
59
- - pnpm preview - Starts the Vite development server in preview mode.
60
-
61
- ## 📂 Project Structure
62
-
63
- The project structure follows a standard React application layout:
64
-
65
- ```python
66
- react-vite-ui/
67
- ├── node_modules/ # Project dependencies
68
- ├── public/ # Public assets
69
- ├── src/ # Application source code
70
- │ ├── components/ # React components
71
- │ │ └── ui/ # shadc/ui components
72
- │ ├── styles/ # CSS stylesheets
73
- │ ├── lib/ # Utility functions
74
- │ ├── App.tsx # Application entry point
75
- │ └── index.tsx # Main rendering file
76
- ├── eslint.config.js # ESLint configuration
77
- ├── index.html # HTML entry point
78
- ├── postcss.config.js # PostCSS configuration
79
- ├── tailwind.config.ts # Tailwind CSS configuration
80
- ├── tsconfig.json # TypeScript configuration
81
- └── vite.config.ts # Vite configuration
82
- ```
83
-
84
- ## 📄 License
85
-
86
- This project is licensed under the MIT License. See the [LICENSE](https://choosealicense.com/licenses/mit/) file for details.
87
-
88
- # AI Platform with Integrations
89
-
90
- This platform allows you to configure and use various AI providers and models, with integrations for Hugging Face and Google Drive.
91
-
92
- ## Setting Up Integrations
93
-
94
- ### Hugging Face Integration
95
-
96
- To set up the Hugging Face integration:
97
-
98
- 1. Go to [Hugging Face](https://huggingface.co/) and create an account if you don't have one.
99
- 2. Navigate to your profile settings and go to "Access Tokens".
100
- 3. Create a new OAuth application:
101
- - Name: Your App Name
102
- - Redirect URI: `https://your-domain.com/integrations/huggingface-callback`
103
- - Scopes: `inference-api`
104
- 4. Copy the Client ID and Client Secret.
105
- 5. Update the environment variables in your application:
106
- ```
107
- OAUTH_CLIENT_ID=your_client_id
108
- OAUTH_CLIENT_SECRET=your_client_secret
109
- ```
110
-
111
- ### Google Drive Integration
112
-
113
- To set up the Google Drive integration:
114
-
115
- 1. Go to the [Google Cloud Console](https://console.cloud.google.com/).
116
- 2. Create a new project or select an existing one.
117
- 3. Navigate to "APIs & Services" > "Credentials".
118
- 4. Click "Create Credentials" > "OAuth client ID".
119
- 5. Configure the OAuth consent screen:
120
- - User Type: External
121
- - App name: Your App Name
122
- - User support email: Your email
123
- - Developer contact information: Your email
124
- 6. Add the following scopes:
125
- - `https://www.googleapis.com/auth/drive.file`
126
- 7. Create the OAuth client ID:
127
- - Application type: Web application
128
- - Name: Your App Name
129
- - Authorized JavaScript origins: `https://your-domain.com`
130
- - Authorized redirect URIs: `https://your-domain.com/integrations/google-callback`
131
- 8. Copy the Client ID and Client Secret.
132
- 9. Update the environment variables in your application:
133
- ```
134
- GOOGLE_CLIENT_ID=your_client_id
135
- GOOGLE_CLIENT_SECRET=your_client_secret
136
- ```
137
-
138
- ## Using the Integrations
139
-
140
- ### Hugging Face
141
-
142
- Once authenticated, you can use the Hugging Face Inference API to access models hosted on Hugging Face. The integration provides the following functionality:
143
-
144
- - Call the Inference API with any model
145
- - Access to all public and your private models
146
-
147
- ### Google Drive
148
-
149
- Once authenticated, you can use the Google Drive API to read and write files. The integration provides the following functionality:
150
-
151
- - List files in your Google Drive
152
- - Upload files to your Google Drive
153
- - Download files from your Google Drive
154
 
155
  ## Development
156
 
157
- To run the application locally:
158
-
159
- 1. Clone the repository
160
- 2. Install dependencies: `npm install`
161
- 3. Start the development server: `npm run dev`
162
- 4. Open [http://localhost:3000](http://localhost:3000) in your browser
163
 
164
- ## Environment Variables
165
 
166
- Create a `.env` file in the root directory with the following variables:
167
 
168
- ```
169
- OAUTH_CLIENT_ID=your_huggingface_client_id
170
- OAUTH_CLIENT_SECRET=your_huggingface_client_secret
171
- GOOGLE_CLIENT_ID=your_google_client_id
172
- GOOGLE_CLIENT_SECRET=your_google_client_secret
173
- ```
174
 
175
- ## License
176
 
177
- MIT
 
1
+ # My Hugging Face Space
2
 
3
+ ## About
4
 
5
+ This Space showcases [brief description of your application/project]. It demonstrates [key capabilities or technologies].
6
 
7
+ ## Features
8
 
9
+ - Feature 1: Description
10
+ - Feature 2: Description
11
+ - Feature 3: Description
 
 
 
 
 
 
12
 
13
+ ## How to Use
14
 
15
+ 1. [First step to use the application]
16
+ 2. [Second step to use the application]
17
+ 3. [Third step to use the application]
18
 
19
+ ## Technologies Used
 
20
 
21
+ - [Technology/Framework 1]
22
+ - [Technology/Framework 2]
23
+ - [Technology/Framework 3]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  ## Development
26
 
27
+ This Space is automatically updated via GitHub Actions from the [repository name] repository. Any changes pushed to the main branch are automatically deployed to this Space.
 
 
 
 
 
28
 
29
+ ## License
30
 
31
+ [License information]
32
 
33
+ ## Contact
 
 
 
 
 
34
 
35
+ [Contact information]
36
 
37
+ ---