Skip to content

Commit 33b8029

Browse files
committed
Implement alpha version
1 parent 46a28fb commit 33b8029

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1987
-5
lines changed

.github/workflows/pr.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: PR checks
2+
on:
3+
pull_request:
4+
branches: [main]
5+
jobs:
6+
check_pr:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-node@v1
11+
with:
12+
node-version: 22
13+
- run: npm i
14+
- run: npm run build
15+
- run: npm test

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.log
2+
.DS_Store
3+
node_modules
4+
dist
5+
.tests
6+
hvps

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"printWidth": 155,
5+
"trailingComma": "all"
6+
}

README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,60 @@
11
# Hosty
22

3-
Self host your web apps and services with ease.
3+
**This package is still under development, not ready for use yet!**
4+
5+
A code based opinionated way to self-host and manage web apps.
6+
7+
1. You write code describing what you want to deploy. For example:
8+
```ts
9+
import {app, deploy, host, database} from 'hosty'
10+
11+
// a Postgres database
12+
const db = database({
13+
type: 'postgres',
14+
name: 'awesome',
15+
user: 'myuser',
16+
pass: 'mypass',
17+
})
18+
19+
// a web app that uses the db above
20+
const myapp = app({
21+
domain: 'your-domain.com',
22+
repo: 'https://github.com/....git',
23+
branch: 'main',
24+
env: {
25+
DB_HOST: db.host,
26+
DB_USER: db.user,
27+
DB_PASS: db.pass,
28+
DB_NAME: db.name,
29+
}
30+
})
31+
32+
// The server to which you want to deploy
33+
const server = host({
34+
address: 'domain name or IP'
35+
})
36+
37+
// Deploy the app and database to the server
38+
deploy(server, [db, myapp])
39+
```
40+
2. You run `npx hosty deploy` to apply what you described.
41+
42+
That's it, the database is created and your app is now deployed to `https://your-domain.com` (Yes, the SSL certificate is also taken care off!).
43+
44+
## Prerequisits
45+
46+
1. A Linux server to which you have SSH access.
47+
- This can be a VPS, a home-lab server or any Linux machine that has a static IP.
48+
- The user by which you connect should have the `sudo` ability.
49+
- Only **Ubuntu** servers are supported right now.
50+
51+
2. [Ansible](https://www.ansible.com/) installed on your local machine.
52+
53+
## Get started
54+
55+
```
56+
npm i hosty
57+
```
58+
459

560
**This package is still under development, not ready for use yet!**

index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)