0.9.6 • Published 2 years ago
samen v0.9.6
Samen
Samen is still in active development.
Alpha release will come soon, join the waiting list here: https://samen.io
About Samen
Samen builds and deploys serverless backend services and databases from your code and autogenerates end-to-end type-safe SDK's for your web or mobile client(s).
Example
First, define your models like:
// server/src/schema.ts
interface User {
id: string;
name: string;
}
Then define your RPC's on the server:
// server/src/index.ts
import { db } from 'samen/db';
import { User } from './schema';
export async function getUsers(): Promise<User[]> {
// typesafe database client
// generated from your interface
return await db.users.find().toArray();
}
And then you can use the generated SDK's in the client like:
// client/src/App.tsx
import { useState, useEffect } from 'react';
import { User, getUsers } from 'samen/client';
export default function App() {
const [users, setUsers] = useState<User[]>([]);
useEffect(() => {
getUsers().then((users) => setUsers(users));
}, []);
return (
<ul>
{users.map((user) => (
<li key={user.id}>{user.name}</li>
))}
</ul>
);
}
Lastly, use the CLI to deploy the backend:
$ samen deploy
And you're ready to go :)
Credits
Built with ♥️ by Pres Play
0.9.4
2 years ago
0.9.6
2 years ago
0.9.5
2 years ago
0.9.4-rc.2
2 years ago
0.9.4-rc.1
2 years ago
0.9.3
2 years ago
0.9.0-rc.4
2 years ago
0.9.3-rc.2
2 years ago
0.9.3-rc.3
2 years ago
0.9.3-rc.1
2 years ago
0.9.0
2 years ago
0.9.2
2 years ago
0.9.1
2 years ago
0.9.0-rc.6
2 years ago
0.9.0-rc.5
2 years ago
0.9.0-rc.2
2 years ago
0.9.0-rc.1
2 years ago
0.9.0-rc.3
2 years ago
0.9.0-rc.0
2 years ago
1.0.0
4 years ago