Skip to content

Commit

Permalink
[skip_publish deploy_docs] Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zaaakher committed Sep 24, 2023
1 parent 63d75fe commit 87a57ce
Show file tree
Hide file tree
Showing 17 changed files with 5,191 additions and 60 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,24 @@

# Hajar | حجر

A Versatile SaaS Toolkit

[![NPM](https://img.shields.io/npm/v/@sikka/hajar.svg?style=flat&colorA=000000&colorB=1082c3)](https://www.npmjs.com/package/@sikka/hajar)
[![NPM@beta](https://img.shields.io/npm/v/@sikka/hajar/beta.svg?style=flat&colorA=000000&colorB=ea7637)](https://www.npmjs.com/package/@sikka/hajar)
[![Hajar CI - @latest](https://github.com/sikka-software/Hajar/actions/workflows/hajar-main.yml/badge.svg)](https://github.com/sikka-software/Hawa/actions/workflows/hajar-main.yml)
[![Hajar CI - @beta](https://github.com/sikka-software/Hajar/actions/workflows/hajar-beta.yml/badge.svg)](https://github.com/sikka-software/Hajar/actions/workflows/hajar-beta.yml)

> Javascript/Typescript engine Saas/Paas applications


Hajar is your all-in-one toolkit and engine, purpose-built to streamline SaaS application development. It empowers you with essential features, including:

- Authentication
- Email Management
- Database Operations
- Storage Solutions

With Hajar, building SaaS applications becomes a breeze, as it simplifies these fundamental tasks and more, so you can focus on what truly matters—creating exceptional web applications.


## Install

Expand Down
44 changes: 23 additions & 21 deletions User.resolver.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
const User = require("./models/User");
module.exports = {
Query: {
async getUsers() {
return await User.find();

const User = require('./models/User');
module.exports = {
Query: {
async getUsers() {
return await User.find();
},
async getUser(_, { id }) {
return await User.findById({_id : id});
}
},
async getUser(_, { id }) {
return await User.findById({ _id: id });
},
},
Mutation: {
async createUser(_, { input }) {
const newUser = new User(input);
return await newUser.save();
},
async updateUser(_, { id, input }) {
return await User.findByIdAndUpdate(id, input, { new: true });
},
async deleteUser(_, { id }) {
return await User.findByIdAndDelete({ _id: id });
},
},
Mutation: {
async createUser(_, { input }) {
const newUser = new User(input);
return await newUser.save();
},
async updateUser(_, { id, input }) {
return await User.findByIdAndUpdate(id, input, { new: true });
},
async deleteUser(_, { id }) {
return await User.findByIdAndDelete({_id :id});
}
}
};

42 changes: 23 additions & 19 deletions User.type.graphql
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
type User {
name: String
email: String
password: String
}
input UserInput {
name: String
email: String
password: String
}
type Query {
getUsers: [User]
getUser(_id: ID): User
}
type Mutation {
createUser(input: UserInput): User
updateUser(_id: ID, input: UserInput): User
deleteUser(_id: ID): User
}

type User {
name: String
email: String
password: String
}
input UserInput {
name: String
email: String
password: String
}
type Query {
getUsers: [User]
getUser(_id : ID): User

}
type Mutation {
createUser(input: UserInput): User
updateUser(_id: ID, input: UserInput): User
deleteUser(_id: ID): User
}


22 changes: 22 additions & 0 deletions docs/components/FeatureCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Card, CardContent } from "@sikka/hawa";
import Link from "next/link";
import React from "react";
import { Camera } from "lucide-react";

const FeatureCard = (props) => {
return (
<Link href={props.link}>
<div className="flex h-24 flex-row items-center gap-4 border p-4 bg-background rounded hover:drop-shadow-lg transition-all">
{props.icon}
<div className="flex flex-col">
<div className="flex flex-row font-bold">{props.title}</div>
<div className="text-start text-xs flex flex-row ">
{props.subtitle}
</div>
</div>
</div>
</Link>
);
};

export default FeatureCard;
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"homepage": "https://hajar.sikka.io",
"dependencies": {
"@sikka/hawa": "^0.2.19-beta",
"lucide-react": "^0.279.0",
"next": "^13.0.6",
"nextra": "latest",
"nextra-theme-docs": "latest",
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "page",
"display": "hidden",
"theme": {
"layout": "raw"
"layout": "default"
}
},
"docs": {
Expand Down
Empty file.
Empty file.
3 changes: 2 additions & 1 deletion docs/pages/docs/database/_meta.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"setup": "SetupDatabase"
"setup": "Setup Database",
"connect": "Connect Database"
}
5 changes: 5 additions & 0 deletions docs/pages/docs/email/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"setup-email": "Setup Email",
"send-email": "Send Email",
"schedule-email": "Schedule Email"
}
3 changes: 3 additions & 0 deletions docs/pages/docs/email/schedule-email.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Schedule Email

This will use a cron-job
1 change: 1 addition & 0 deletions docs/pages/docs/email/send-email.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Send Email
1 change: 1 addition & 0 deletions docs/pages/docs/email/setup-email.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Setup Email
77 changes: 77 additions & 0 deletions docs/pages/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { Callout } from "nextra-theme-docs";
import Landing from "components/landing";
import FeatureCard from "components/FeatureCard";
import { Bleed } from "nextra-theme-docs";

import { Button } from "@sikka/hawa";
import Link from "next/link";
import React from "react";

const IndexPage = () => (
<div className="flex flex-col justify-center items-center text-center p-10 gap-6">
<div className="flex flex-col justify-center items-center max-w-lg">
<h1 className="text-center text-4xl tracking-tighter font-extrabold md:text-5xl mb-10">
Hajar
</h1>
<span>
Hajar is a comprehensive toolkit for SaaS application development,
offering simplified solutions for authentication, email management,
database operations, storage, and more.
</span>
</div>
<div className="flex flex-col justify-center items-center text-center">
<div className="flex flex-row gap-2">
<Link href="/docs">
<Button>Docs</Button>
</Link>
<a href="https://github.com/sikka-software/hajar">
<Button variant="outline">Github</Button>
</a>
</div>
<p className="flex h-6 mt-4 gap-2">
<img alt="downloads" src="https://badgen.net/npm/v/@sikka/hajar" />
<img alt="downloads" src="https://badgen.net/npm/v/@sikka/hajar/beta" />
</p>
</div>
<div className="p-1 px-2 flex text-sm flex-row bg-yellow-100 border-yellow-300 border-2">
⌛ This docs site is still work in progress
</div>
<div className="grid grid-cols-2 gap-2 w-full max-w-lg ">
<FeatureCard
link="/docs/authentication"
title="Authentication"
subtitle="Run common authentication methods"
/>
<FeatureCard
link="/docs/database"
title="Database"
subtitle="Setup & connect to a DB"
/>
<FeatureCard
link="/docs/storage"
title="Storage"
subtitle="Setup storage and upload/download files"
/>
<FeatureCard link="/docs/emails" title="Emails" subtitle="Setup, send, and schedule emails" />
</div>

<div className="flex w-full flex-col items-center opacity-50 ">
<a href="https://sikka.io">
<img
width="20"
alt="Sikka"
src={
"https://sikka-images.s3.ap-southeast-1.amazonaws.com/sikka/brand/black-symbol.png"
}
/>
</a>
<p align="center" className="m-0 mb-4 ">
<sub>
<a href="https://sikka.io">An open source project by Sikka</a>
</sub>
</p>
</div>
</div>
);

export default IndexPage;
51 changes: 34 additions & 17 deletions docs/pages/index.mdx → docs/pages/indexdd.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,48 @@ title: Toolkit for SaaS Apps

import { Callout } from "nextra-theme-docs";
import Landing from "components/landing";
import FeatureCard from "components/FeatureCard";
import { Bleed } from "nextra-theme-docs";

import { Button } from "@sikka/hawa";
import Link from "next/link";
import React from "react";

{
// wrapped with {} to mark it as javascript so mdx will not put it under a p tag
}
{<h1 className="text-center text-4xl tracking-tighter font-extrabold md:text-5xl mt-8">SWR</h1>}
{<h1 className="text-center text-4xl tracking-tighter font-extrabold md:text-5xl mt-8">Hajar</h1>}

<div className="flex flex-col justify-center items-center text-center">

<div className="flex flex-row gap-2">
<Link href="/docs">
<Button>Docs</Button>
</Link>
<a href="https://github.com/sikka-software/hajar">
<Button variant="outline">Github</Button>
</a>
</div>
<p className="flex h-6 mt-4 gap-2">
<img alt="downloads" src="https://badgen.net/npm/v/@sikka/hajar" />
<img alt="downloads" src="https://badgen.net/npm/v/@sikka/hajar/beta" />
</p>
</div>

{/* <Bleed> */}
<Landing />
{/* </Bleed> */}
<div className="flex flex-col p-10 max-w-lg">

Hajar is your all-in-one toolkit and engine, purpose-built to streamline SaaS application development. It empowers you with essential features, including:
<div className="grid grid-cols-2 gap-2 mt-10">

The name “SWR” is derived from `stale-while-revalidate`, a HTTP cache invalidation strategy popularized by [HTTP RFC 5861](https://tools.ietf.org/html/rfc5861).
SWR is a strategy to first return the data from cache (stale), then send the fetch request (revalidate), and finally come with the up-to-date data.
<FeatureCard link="/database" title="Authentication" subtitle="Subtitle" />
<FeatureCard link="/database" title="Database" subtitle="Subtitle" />
<FeatureCard link="/database" title="Storage" subtitle="Subtitle" />
<FeatureCard link="/database" title="Emails" subtitle="Subtitle" />

<Callout emoji="">
With SWR, components will get a stream of data updates{" "}
<strong>constantly</strong> and <strong>automatically</strong>.<br />
And the UI will be always <strong>fast</strong> and <strong>reactive</strong>.
</Callout>
</div>
</div>

<Callout emoji="">This docs site is still work in progress</Callout>

<div className="mt-16 mb-20 text-center">
[Get Started](/docs/getting-started) · [Examples](/examples/basic) ·
Expand Down Expand Up @@ -76,12 +99,6 @@ And a lot [more](/docs/getting-started).

## Community [#community]

<p className="flex h-6 mt-4 gap-2">
<img alt="stars" src="https://badgen.net/github/stars/vercel/swr" />
<img alt="downloads" src="https://badgen.net/npm/dt/swr" />
<img alt="license" src="https://badgen.net/npm/license/swr" />
</p>

SWR is created by the same team behind [Next.js](https://nextjs.org), the React framework.
Follow [@vercel](https://twitter.com/vercel) on Twitter for future project updates.

Expand Down
5 changes: 5 additions & 0 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2668,6 +2668,11 @@ lru-cache@^4.0.1:
pseudomap "^1.0.2"
yallist "^2.1.2"

lucide-react@^0.279.0:
version "0.279.0"
resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.279.0.tgz#05cdd709f3cc8b40846abf8929896ec75d684c2d"
integrity sha512-LJ8g66+Bxc3t3x9vKTeK3wn3xucrOQGfJ9ou9GsBwCt2offsrT2BB90XrTrIzE1noYYDe2O8jZaRHi6sAHXNxw==

markdown-extensions@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/markdown-extensions/-/markdown-extensions-1.1.1.tgz#fea03b539faeaee9b4ef02a3769b455b189f7fc3"
Expand Down
Loading

0 comments on commit 87a57ce

Please sign in to comment.