Skip to content

Commit 3a27ffa

Browse files
authored
Merge pull request #2 from codeupify/docs
Adding a docs github pages site
2 parents 5a6b33d + 7bff7be commit 3a27ffa

File tree

11 files changed

+302
-40
lines changed

11 files changed

+302
-40
lines changed

README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Upify
22

3-
<img align="right" src="assets/carbon.png" />
3+
<img align="right" src="docs/assets/carbon.png" />
44

55
A platform-agnostic CLI tool that simplifies cloud deployment for applications
66

@@ -17,6 +17,16 @@ A platform-agnostic CLI tool that simplifies cloud deployment for applications
1717
- Frameworks: Flask, Express
1818
- Runtimes: Python, Node.js
1919

20+
## Documentation
21+
22+
View the [online documentation](https://codeupify.github.io/upify):
23+
24+
* [Getting Started](https://codeupify.github.io/upify/getting-started)
25+
* [Commands](https://codeupify.github.io/upify/commands)
26+
* [Configuration](https://codeupify.github.io/upify/configuration)
27+
* [Wrappers](https://codeupify.github.io/upify/wrappers)
28+
* [Environment Variables](https://codeupify.github.io/upify/environment-variables)
29+
* [Provider Authentication](#provider-authentication)
2030

2131
## Installation
2232

@@ -71,6 +81,10 @@ upify init
7181

7282
This command will generate config and wrapper files. Depending on the options selected, you may need to adjust the generated code and config files. Follow the instructions provided in the command output.
7383

84+
#### Environment Variables
85+
86+
Add environment variables to `.upify/.env`
87+
7488
### Add a platform
7589

7690
To add cloud platform support, run:
@@ -87,18 +101,18 @@ To deploy your project, use the following command:
87101
upify deploy [platform]
88102
```
89103

90-
*Note: You must have your cloud credentials set up before deploying. See the [Authentication](#authentication) section for more details.*
104+
*Note: You must have your cloud credentials set up before deploying. See the [Authentication](#provider-authentication) for more details.*
91105

92106
## Example projects
93107

94-
- [Flask](/examples/flask/README.md)
95-
- [Express](/examples/express/README.md)
96-
- [Python without a framework](/examples/python/README.md)
97-
- [Javascript without a framework](/examples/javascript/README.md)
98-
- [Typescript without a framework](/examples/typescript/README.md)
108+
- [Flask](/examples/flask)
109+
- [Express](/examples/express)
110+
- [Python without a framework](/examples/python)
111+
- [Javascript without a framework](/examples/javascript)
112+
- [Typescript without a framework](/examples/typescript)
99113

100114

101-
## Authentication
115+
## Provider Authentication
102116

103117
### AWS - Lambda
104118

@@ -228,7 +242,4 @@ Required APIs:
228242
- Cloud Build API
229243
- Artifact Registry API
230244
- Cloud Resource Manager API
231-
- Cloud Storage API
232-
233-
234-
245+
- Cloud Storage API

docs/_config.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
title: Upify
2+
description: Upify documentation
3+
remote_theme: just-the-docs/just-the-docs
4+
5+
markdown: kramdown
6+
plugins:
7+
- jekyll-relative-links
8+
- jekyll-seo-tag
9+
10+
aux_links:
11+
"Upify on GitHub":
12+
- "//github.com/codeupify/upify"
13+
14+
nav_enabled: true
15+
16+
nav:
17+
- title: Home
18+
url: /upify/
19+
- title: Getting Started
20+
url: /upify/getting-started
21+
- title: Commands
22+
url: /upify/commands
23+
- title: Configuration
24+
url: /upify/configuration
25+
- title: Wrappers
26+
url: /upify/wrappers
27+
- title: Environment Variables
28+
url: /upify/environment-variables
29+
- title: Provider Authentication
30+
url: https://github.com/codeupify/upify#provider-authentication
File renamed without changes.

docs/commands.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
layout: default
3+
title: Commands
4+
permalink: /commands
5+
nav_order: 3
6+
---
7+
8+
# Commands
9+
10+
## init
11+
Initialize a new project.
12+
13+
```bash
14+
upify init
15+
```
16+
17+
## platform add
18+
Add platform support to your project.
19+
20+
```bash
21+
upify platform add aws-lambda
22+
upify platform add gcp-cloudrun
23+
```
24+
25+
## deploy
26+
Deploy your application to the specified platform.
27+
28+
```bash
29+
upify deploy aws-lambda
30+
upify deploy gcp-cloudrun
31+
```
32+
33+
## Flags
34+
35+
### Global
36+
- `--help`: Display help information

docs/configuration.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
layout: default
3+
title: Configuration
4+
permalink: /configuration
5+
nav_order: 4
6+
---
7+
8+
# Configuration
9+
10+
Configuration is stored in `.upify/config.yaml`.
11+
12+
## Basic Configuration
13+
```yaml
14+
name: project-name
15+
framework: flask | express | none
16+
language: python | nodejs
17+
package_manager: pip | npm
18+
entrypoint: main.py
19+
app_var: app
20+
```
21+
22+
## AWS Lambda Configuration
23+
```yaml
24+
aws-lambda:
25+
region: us-east-1
26+
role_name: lambda-role
27+
runtime: python3.12 | nodejs20.x
28+
```
29+
30+
## GCP Cloud Run Configuration
31+
```yaml
32+
gcp-cloudrun:
33+
region: us-central1
34+
project_id: your-project-id
35+
runtime: python312 | nodejs20
36+
```
37+
38+
## Reference
39+
40+
| Field | Description |
41+
|-------|-------------|
42+
| name | Project name |
43+
| framework | Web framework being used |
44+
| language | Programming language |
45+
| package_manager | Package management tool |
46+
| entrypoint | Main application file |
47+
| app_var | App variable name in entrypoint |

docs/environment-variables.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
layout: default
3+
title: Environment Variables
4+
permalink: /environment-variables
5+
nav_order: 6
6+
---
7+
8+
# Environment Variables
9+
10+
Environment variables for your application should be placed in `.upify/.env`. These variables will be automatically loaded and set during deployment.
11+
12+
Example `.upify/.env`:
13+
```bash
14+
API_KEY=your-api-key
15+
DATABASE_URL=your-database-url
16+
NODE_ENV=production
17+
```
18+
19+
All variables in this file will be available to your application at runtime on the cloud platform.

docs/getting-started.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
layout: default
3+
title: Getting Started
4+
permalink: /getting-started
5+
nav_order: 2
6+
---
7+
8+
# Getting Started
9+
10+
## Installation
11+
12+
### Go Install
13+
```bash
14+
go install github.com/codeupify/upify@latest
15+
```
16+
17+
### Pre-built Binaries
18+
19+
#### Linux and macOS
20+
1. Download from [releases page](https://github.com/codeupify/upify/releases)
21+
2. Move to PATH:
22+
```bash
23+
mv upify /usr/local/bin/
24+
chmod +x /usr/local/bin/upify
25+
```
26+
27+
#### Windows
28+
1. Download from [releases page](https://github.com/codeupify/upify/releases)
29+
2. Add binary location to system PATH
30+
31+
## Quick Start
32+
33+
1. Initialize project:
34+
```bash
35+
upify init
36+
```
37+
38+
2. Set environment variables in `.upify/.env` (see [Environment Variables](./environment-variables))
39+
40+
3. If you aren't using a web framework, you'll need to add code to your wrappers (see [Wrappers](./wrappers))
41+
42+
4. Add cloud platform:
43+
```bash
44+
upify platform add aws-lambda
45+
```
46+
47+
5. Deploy:
48+
```bash
49+
upify deploy aws-lambda
50+
```

docs/index.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
layout: default
3+
title: Home
4+
permalink: /
5+
nav_order: 1
6+
---
7+
8+
# Upify Documentation
9+
10+
Upify is a platform-agnostic CLI tool that simplifies cloud deployment for applications, focusing on serverless architectures.
11+
12+
## Sections
13+
14+
* [Getting Started](/upify/getting-started)
15+
16+
* [Commands](/upify/commands)
17+
18+
* [Configuration](/upify/configuration)
19+
20+
* [Wrappers](/upify/wrappers)
21+
22+
* [Environment Variables](/upify/environment-variables)
23+
24+
* [Provider Authentication](https://github.com/codeupify/upify#provider-authentication)
25+
26+
27+
## Example Projects
28+
29+
Visit our [examples directory](https://github.com/codeupify/upify/tree/main/examples) for sample implementations

docs/wrappers.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
layout: default
3+
title: Wrappers
4+
permalink: /wrappers
5+
nav_order: 5
6+
---
7+
8+
# Wrappers
9+
10+
Upify uses wrapper files to adapt your application for cloud deployment:
11+
12+
## `upify_handler.[ext]`
13+
This file is automatically generated for all projects to handle cloud platform integration. You shouldn't have to modify this file.
14+
15+
```python
16+
import os
17+
from main import app
18+
19+
handler = None
20+
21+
if os.getenv("UPIFY_DEPLOY_PLATFORM") == "aws-lambda":
22+
from apig_wsgi import make_lambda_handler
23+
handler = make_lambda_handler(app)
24+
if os.getenv("UPIFY_DEPLOY_PLATFORM") == "gcp-cloudrun":
25+
import functions_framework
26+
27+
@functions_framework.http
28+
def flask_function(request):
29+
with app.request_context(request.environ):
30+
return app.full_dispatch_request()
31+
32+
handler = flask_function
33+
```
34+
35+
## `upify_main.[ext]`
36+
This file is only created for projects without a web framework. You'll need to modify it to adapt your non-web framework code to be able to handle HTTP requests/responses.
37+
38+
```python
39+
from flask import Flask, request, jsonify
40+
41+
""" ADD YOUR IMPORTS HERE """
42+
43+
app = Flask(__name__, instance_path='/tmp')
44+
45+
@app.route('/')
46+
def handler():
47+
""" ADD YOUR CODE HERE """
48+
```
49+
50+
### Example Implementation
51+
```python
52+
from flask import Flask, request, jsonify
53+
from main import get_weather_data
54+
55+
app = Flask(__name__, instance_path='/tmp')
56+
57+
@app.route('/')
58+
def handler():
59+
city = request.args.get("city")
60+
if city is None:
61+
return jsonify({"error": "Specify a city"}), 400
62+
63+
try:
64+
response_data = get_weather_data(city)
65+
return jsonify(response_data), 200
66+
except Exception as e:
67+
return jsonify({"error": str(e)}), 500
68+
```

0 commit comments

Comments
 (0)