-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sweep: Enrich existing readme according to latest changes on the main branch #3
Comments
🚀 Here's the PR! #5See Sweep's progress at the progress dashboard! ⚡ Sweep Basic Tier: I'm using GPT-4. You have 5 GPT-4 tickets left for the month and 3 for the day. (tracking ID:
22890ca161 )For more GPT-4 tickets, visit our payment portal. For a one week free trial, try Sweep Pro (unlimited GPT-4 tickets). Install Sweep Configs: Pull Request
Tip I'll email you at [email protected] when I complete this pull request! Actions (click)
GitHub Actions✓Here are the GitHub Actions logs prior to making any changes: Sandbox logs for
|
# eser.live web site | |
[![Discord Chat](https://img.shields.io/discord/684898665143206084?logo=discord&style=social)](https://discord.gg/ckS4huSvEk) | |
[![CI](https://github.com/eser/eser.live/actions/workflows/ci.yml/badge.svg)](https://github.com/eser/eser.live/actions/workflows/ci.yml) | |
[![codecov](https://codecov.io/gh/eser/eser.live/branch/main/graph/badge.svg?token=77F8TYTP13)](https://codecov.io/gh/eser/eser.live) | |
## Features | |
- Deno's built-in [formatter](https://deno.land/manual/tools/formatter), | |
[linter](https://deno.land/manual/tools/linter) and | |
[test runner](https://deno.land/manual/basics/testing) and TypeScript support | |
- Next-gen web framework with [Fresh](https://fresh.deno.dev/) | |
- In-built data persistence with [Deno KV](https://deno.com/kv) | |
- High-level OAuth with [Deno KV OAuth](https://deno.land/x/deno_kv_oauth) | |
- Modern CSS framework with [Tailwind CSS](https://tailwindcss.com/) | |
- Responsive, SaaS-oriented design | |
- Dashboard with users view and statistics chart | |
- First-class web performance | |
- [REST API](#rest-api-reference) | |
- Blog with RSS feed and social sharing icons | |
- HTTP security headers | |
## Get Started | |
### Get Started Locally | |
Before starting, you'll need: | |
- A GitHub account | |
- The [Deno CLI](https://deno.com/manual/getting_started/installation) and | |
[Git](https://github.com/git-guides/install-git) installed on your machine | |
To get started: | |
1. Clone this repo: | |
```bash | |
git clone https://github.com/denoland/saaskit.git | |
cd saaskit | |
``` | |
1. Create a new `.env` file. | |
1. Navigate to GitHub's | |
[**New OAuth Application** page](https://github.com/settings/applications/new). | |
1. Set **Application name** to your desired application name. E.g. `ACME, Inc`. | |
1. Set **Homepage URL** to `http://localhost:8000`. | |
1. Set **Authorization callback URL** to `http://localhost:8000/auth/callback`. | |
1. Click **Register application**. | |
1. Copy the **Client ID** value to the `.env` file: | |
```bash | |
GITHUB_CLIENT_ID=<GitHub OAuth application client ID> | |
``` | |
1. On the same web page, click **Generate a new client secret**. | |
1. Copy the **Client secret** value to the `.env` file on a new line: | |
```bash | |
GITHUB_CLIENT_SECRET=<GitHub OAuth application client secret> | |
``` | |
1. Start the server: | |
```bash | |
deno task start | |
``` | |
1. Navigate to `http://localhost:8000` to start playing with your new SaaS app. | |
### Bootstrap the Database (Optional) | |
Use the following commands to work with your local Deno KV database: | |
- `deno task db:seed` - Populate the database with data from the | |
[Hacker News API](https://github.com/HackerNews/API). | |
- `deno task db:dump > backup.json` - Write all database entries to | |
`backup.json`. | |
- `deno task db:restore backup.json` - Restore the database from `backup.json`. | |
- `deno task db:reset` - Reset the database. This is not recoverable. | |
## Customize and Extend | |
### Global Constants | |
The [utils/constants.ts](utils/constants.ts) file includes global values used | |
across various aspects of the codebase. Update these values according to your | |
needs. | |
### Create a Blog Post | |
1. Create a `.md` file in the [/posts](/posts) with the filename as the slug of | |
the blog post URL. E.g. a file with path `/posts/hello-there.md` will have | |
path `/blog/hello-there`. | |
1. Write the | |
[Front Matter](https://daily-dev-tips.com/posts/what-exactly-is-frontmatter/) | |
then [Markdown](https://www.markdownguide.org/cheat-sheet/) text to define | |
the properties and content of the blog post. | |
````md | |
--- | |
title: This is my first blog post! | |
publishedAt: 2022-11-04T15:00:00.000Z | |
summary: This is an excerpt of my first blog post. | |
--- | |
# Heading 1 | |
Hello, world! | |
```javascript | |
console.log("Hello World"); | |
``` | |
```` | |
1. Start the server: | |
```bash | |
deno task start | |
``` | |
1. Navigate to the URL of the newly created blog post. E.g. | |
`http://localhost:8000/blog/hello-there`. | |
See other examples of blog post files in [/posts](/posts). | |
### Themes | |
You can customize theme options such as spacing, color, etc. By default, Deno | |
SaaSKit comes with `primary` and `secondary` colors predefined within | |
`tailwind.config.ts`. Change these values to match your desired color scheme. | |
### Cover Image | |
To replace the cover image, replace the [/static/cover.png](/static/cover.png) | |
file. If you'd like to change the filename, also be sure to change the | |
`imageUrl` property in the [`<Head />`](/components/Head.tsx) component. | |
## Deploy to Production | |
This section assumes that a | |
[local development environment](#getting-started-locally) is already set up. | |
1. Navigate to your | |
[GitHub OAuth application settings page](https://github.com/settings/developers). | |
1. Set the **Homepage URL** to your production URL. E.g. | |
`https://hunt.deno.land`. | |
1. Set the **Authorization callback URL** to your production URL with the | |
`/auth/callback` path. E.g. `https://hunt.deno.land/auth/callback`. | |
1. Copy all the environment variables in your `.env` file to your production | |
environment. | |
### Deploy to [Deno Deploy](https://deno.com/deploy) | |
1. Clone this repository for your SaaSKit project. | |
1. Sign into [Deno Deploy](https://dash.deno.com) with your GitHub account. | |
1. Select your GitHub organization or user, repository, and branch. | |
1. Select **Automatic** deployment mode and `main.ts` as the entry point. | |
1. Click **Link**, which will start the deployment. | |
1. Once the deployment is complete, click on **Settings** and add the production | |
environmental variables, then hit **Save**. | |
You should now be able to visit your newly deployed SaaS. | |
### Deploy to any VPS with Docker | |
[Docker](https://docker.com) makes it easy to deploy and run your Deno app to | |
any virtual private server (VPS). This section will show you how to do that with | |
AWS Lightsail and Digital Ocean. | |
1. [Install Docker](https://docker.com) on your machine, which should also | |
install | |
[the `docker` CLI](https://docs.docker.com/engine/reference/commandline/cli/). | |
1. Create an account on [Docker Hub](https://hub.docker.com), a registry for | |
Docker container images. | |
> Note: the [`Dockerfile`](./Dockerfile), [`.dockerignore`](./.dockerignore) and | |
> [`docker-compose.yml`](./docker-compose.yml) files come included with this | |
> repo. | |
1. Grab the SHA1 commit hash by running the following command in the repo's root | |
folder: | |
```sh | |
# get the SHA1 commit hash of the current branch | |
git rev-parse HEAD | |
``` | |
1. Copy the output of the above and paste it as `DENO_DEPLOYMENT_ID` in your | |
.env file. This value is needed to enable caching on Fresh in a Docker | |
deployment. | |
1. Finally, refer to these guides for using Docker to deploy Deno to specific | |
platforms: | |
- [Amazon Lightsail](https://deno.land/manual/advanced/deploying_deno/aws_lightsail) | |
- [Digital Ocean](https://deno.land/manual/advanced/deploying_deno/digital_ocean) | |
- [Google Cloud Run](https://deno.land/manual/advanced/deploying_deno/google_cloud_run) | |
## REST API Reference | |
### `GET /api/questions` | |
Get all questions in chronological order. Add `?cursor=<cursor>` URL parameter | |
for pagination. Limited to 10 questions per page. | |
Example 1: | |
```jsonc | |
// https://hunt.deno.land/api/questions | |
{ | |
"values": [ | |
{ | |
"id": "01HAY7A4ZD737BHJKXW20H59NH", | |
"userLogin": "Deniswarui4", | |
"question": "czxdczs", | |
"score": 0 | |
}, | |
{ | |
"id": "01HAD9KYMCC5RS2FNPQBMYFRSK", | |
"userLogin": "jlucaso1", | |
"question": "Ok", | |
"score": 0 | |
}, | |
{ | |
"id": "01HA7YJJ2T66MSEP78NAG8910A", | |
"userLogin": "BrunoBernardino", | |
"question": "LockDB: Handle process/event locking", | |
"score": 2 | |
} | |
// 7 more items... | |
], | |
"cursor": "AjAxSDdUNTBBUkY0QzhEUjRXWjkyVDJZSFhZAA==" | |
} | |
``` | |
Example 2 (using `cursor` field from page 1): | |
```jsonc | |
// https://hunt.deno.land/api/questions?cursor=AjAxSDdUNTBBUkY0QzhEUjRXWjkyVDJZSFhZAA== | |
{ | |
"values": [ | |
{ | |
"id": "01H777YG17VY8HANDHE84ZXKGW", | |
"userLogin": "BrunoBernardino", | |
"question": "Ask Soph about a dead philosopher", | |
"score": 2 | |
}, | |
{ | |
"id": "01H6RG2V3AV82FJA2VY6NJD9EP", | |
"userLogin": "retraigo", | |
"question": "Appraisal: Feature Extraction, Feature Conversion in TypeScript", | |
"score": 0 | |
}, | |
{ | |
"id": "01H64TZ3TNKFWS35MJ9PSGNWE1", | |
"userLogin": "lambtron", | |
"question": "How Deno works (blog post)", | |
"score": 2 | |
} | |
// 7 more items... | |
], | |
"cursor": "AjAxSDJUSlBYWUJRM1g0OEo2UlIzSFgyQUQ0AA==" | |
} | |
``` | |
### `GET /api/questions/:id` | |
Get the question with the given ID. | |
Example: | |
```jsonc | |
// https://hunt.deno.land/api/questions/01H5379J1VZ7EB54KSCSQSCRJC | |
{ | |
"id": "01H5379J1VZ7EB54KSCSQSCRJC", | |
"userLogin": "lambtron", | |
"question": "saaskit-danet: a modern SaaS template built for Fresh for SSR and Danet for the API", | |
"score": 10 | |
} | |
``` | |
### `GET /api/users` | |
Get all users in alphabetical order by GitHub login. Add `?cursor=<cursor>` URL | |
parameter for pagination. Limited to 10 users per page. | |
Example 1: | |
```jsonc | |
// https://hunt.deno.land/api/users | |
{ | |
"values": [ | |
{ | |
"login": "51chengxu", | |
"sessionId": "9a6745a1-3a46-45c8-a265-c7469ff73678" | |
}, | |
{ | |
"login": "AiridasSal", | |
"sessionId": "adb25cac-9be7-494f-864b-8f05b80f7168" | |
}, | |
{ | |
"login": "ArkhamCookie", | |
"sessionId": "fd8e7aec-2701-44ae-925b-25e17ff288c4" | |
} | |
// 7 more users... | |
], | |
"cursor": "AkVob3ItZGV2ZWxvcGVyAA==" | |
} | |
``` | |
Example 2 (using `cursor` field from page 1): | |
```jsonc | |
// https://hunt.deno.land/api/users?cursor=AkVob3ItZGV2ZWxvcGVyAA== | |
{ | |
"values": [ | |
{ | |
"login": "EthanThatOneKid", | |
"sessionId": "ae7425c1-7932-412a-9956-e456787d557f" | |
}, | |
{ | |
"login": "Fleury99", | |
"sessionId": "2e4920a3-f386-43e1-8c0d-61b5e0edfc0d" | |
}, | |
{ | |
"login": "FriendlyUser", | |
"sessionId": "508ff291-7d1c-4a67-b19f-447ad73b5914" | |
} | |
// 7 more users... | |
], | |
"cursor": "Ak5ld1lhbmtvAA==" | |
} | |
``` | |
### `GET /api/users/:login` | |
Get the user with the given GitHub login. | |
Example: | |
```jsonc | |
// https://hunt.deno.land/api/users/hashrock | |
{ | |
"login": "hashrock", | |
"sessionId": "97eec97a-6636-485e-9b14-253bfa3ce1de" | |
} | |
``` | |
## Goals and Philosophy | |
For the user, the website should be fast, secure and have a design with clear | |
intent. Additionally, the HTML should be well-structured and indexable by search | |
engines. The defining metrics for these goals are: | |
- A perfect [PageSpeed Insights](https://pagespeed.web.dev/) score. | |
- Fully valid HTML, as measured by | |
[W3C's Markup Validation Service](https://validator.w3.org/). | |
For the developer, the codebase should minimize the steps and amount of time | |
required to get up and running. From there, customization and extension of the | |
web app should be simple. The characteristics of a well-written codebase also | |
apply, such as: | |
- Easy to understand | |
- Modular functionality | |
- Clearly defined behavior with validation through tests | |
## Community and Resources | |
Join [the `#saaskit` channel in Deno's Discord](https://discord.gg/deno) to meet | |
other SaaSKit developers, ask questions, and get unblocked. | |
Lines 1 to 13 in 9297f8d
// Copyright 2023-present the Deno authors. All rights reserved. MIT license. | |
/** | |
* This script is used to perform migration jobs on the database. These jobs | |
* can be performed on remote KV instances using | |
* {@link https://github.com/denoland/deno/tree/main/ext/kv#kv-connect|KV Connect}. | |
* | |
* This script will continually change over time for database migrations, as | |
* required. | |
* | |
* @example | |
* ```bash | |
* deno task db:migrate | |
* ``` |
Lines 1 to 396 in 9297f8d
@tailwind base; | |
@import url('//cdnjs.cloudflare.com/ajax/libs/modern-normalize/2.0.0/modern-normalize.min.css'); | |
@import url('//fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap'); | |
/* | |
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) | |
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) | |
*/ | |
*, | |
::before, | |
::after { | |
box-sizing: border-box; /* 1 */ | |
border-width: 0; /* 2 */ | |
border-style: solid; /* 2 */ | |
/* border-color: theme('borderColor.DEFAULT', currentColor); */ | |
border-color: currentColor; | |
} | |
::before, | |
::after { | |
--tw-content: ''; | |
} | |
/* | |
1. Use a consistent sensible line-height in all browsers. | |
2. Prevent adjustments of font size after orientation changes in iOS. | |
3. Use a more readable tab size. | |
4. Use the user's configured `sans` font-family by default. | |
5. Use the user's configured `sans` font-feature-settings by default. | |
6. Use the user's configured `sans` font-variation-settings by default. | |
7. Disable tap highlights on iOS | |
*/ | |
html, | |
:host { | |
line-height: 1.5; /* 1 */ | |
-webkit-text-size-adjust: 100%; /* 2 */ | |
-moz-tab-size: 4; /* 3 */ | |
tab-size: 4; /* 3 */ | |
font-family: "Open Sans", sans-serif; | |
font-optical-sizing: auto; | |
font-variation-settings: "wdth" 100; | |
/* font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); | |
font-feature-settings: theme('fontFamily.sans[1].fontFeatureSettings', normal); | |
font-variation-settings: theme('fontFamily.sans[1].fontVariationSettings', normal); */ | |
-webkit-tap-highlight-color: transparent; /* 7 */ | |
} | |
/* | |
1. Remove the margin in all browsers. | |
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. | |
*/ | |
body { | |
margin: 0; /* 1 */ | |
line-height: inherit; /* 2 */ | |
} | |
/* | |
1. Add the correct height in Firefox. | |
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) | |
3. Ensure horizontal rules are visible by default. | |
*/ | |
hr { | |
height: 0; /* 1 */ | |
color: inherit; /* 2 */ | |
border-top-width: 1px; /* 3 */ | |
} | |
/* | |
Add the correct text decoration in Chrome, Edge, and Safari. | |
*/ | |
abbr:where([title]) { | |
text-decoration: underline dotted; | |
} | |
/* | |
Remove the default font size and weight for headings. | |
*/ | |
h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
h6 { | |
font-size: inherit; | |
font-weight: inherit; | |
} | |
/* | |
Reset links to optimize for opt-in styling instead of opt-out. | |
*/ | |
a { | |
color: inherit; | |
text-decoration: inherit; | |
} | |
/* | |
Add the correct font weight in Edge and Safari. | |
*/ | |
b, | |
strong { | |
font-weight: bolder; | |
} | |
/* | |
1. Use the user's configured `mono` font-family by default. | |
2. Use the user's configured `mono` font-feature-settings by default. | |
3. Use the user's configured `mono` font-variation-settings by default. | |
4. Correct the odd `em` font sizing in all browsers. | |
*/ | |
code, | |
kbd, | |
samp, | |
pre { | |
/* font-family: theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); | |
font-feature-settings: theme('fontFamily.mono[1].fontFeatureSettings', normal); | |
font-variation-settings: theme('fontFamily.mono[1].fontVariationSettings', normal); */ | |
font-size: 1em; /* 4 */ | |
} | |
/* | |
Add the correct font size in all browsers. | |
*/ | |
small { | |
font-size: 80%; | |
} | |
/* | |
Prevent `sub` and `sup` elements from affecting the line height in all browsers. | |
*/ | |
sub, | |
sup { | |
font-size: 75%; | |
line-height: 0; | |
position: relative; | |
vertical-align: baseline; | |
} | |
sub { | |
bottom: -0.25em; | |
} | |
sup { | |
top: -0.5em; | |
} | |
/* | |
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) | |
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) | |
3. Remove gaps between table borders by default. | |
*/ | |
table { | |
text-indent: 0; /* 1 */ | |
border-color: inherit; /* 2 */ | |
border-collapse: collapse; /* 3 */ | |
} | |
/* | |
1. Change the font styles in all browsers. | |
2. Remove the margin in Firefox and Safari. | |
3. Remove default padding in all browsers. | |
*/ | |
button, | |
input, | |
optgroup, | |
select, | |
textarea { | |
font-family: inherit; /* 1 */ | |
font-feature-settings: inherit; /* 1 */ | |
font-variation-settings: inherit; /* 1 */ | |
font-size: 100%; /* 1 */ | |
font-weight: inherit; /* 1 */ | |
line-height: inherit; /* 1 */ | |
/* color: inherit; */ | |
margin: 0; /* 2 */ | |
padding: 0; /* 3 */ | |
} | |
/* | |
Remove the inheritance of text transform in Edge and Firefox. | |
*/ | |
button, | |
select { | |
text-transform: none; | |
} | |
/* | |
1. Correct the inability to style clickable types in iOS and Safari. | |
2. Remove default button styles. | |
*/ | |
button, | |
[type='button'], | |
[type='reset'], | |
[type='submit'] { | |
-webkit-appearance: button; /* 1 */ | |
background-color: transparent; /* 2 */ | |
background-image: none; /* 2 */ | |
} | |
/* | |
Use the modern Firefox focus style for all focusable elements. | |
*/ | |
:-moz-focusring { | |
outline: auto; | |
} | |
/* | |
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) | |
*/ | |
:-moz-ui-invalid { | |
box-shadow: none; | |
} | |
/* | |
Add the correct vertical alignment in Chrome and Firefox. | |
*/ | |
progress { | |
vertical-align: baseline; | |
} | |
/* | |
Correct the cursor style of increment and decrement buttons in Safari. | |
*/ | |
::-webkit-inner-spin-button, | |
::-webkit-outer-spin-button { | |
height: auto; | |
} | |
/* | |
1. Correct the odd appearance in Chrome and Safari. | |
2. Correct the outline style in Safari. | |
*/ | |
[type='search'] { | |
-webkit-appearance: textfield; /* 1 */ | |
outline-offset: -2px; /* 2 */ | |
} | |
/* | |
Remove the inner padding in Chrome and Safari on macOS. | |
*/ | |
::-webkit-search-decoration { | |
-webkit-appearance: none; | |
} | |
/* | |
1. Correct the inability to style clickable types in iOS and Safari. | |
2. Change font properties to `inherit` in Safari. | |
*/ | |
::-webkit-file-upload-button { | |
-webkit-appearance: button; /* 1 */ | |
font: inherit; /* 2 */ | |
} | |
/* | |
Add the correct display in Chrome and Safari. | |
*/ | |
summary { | |
display: list-item; | |
} | |
/* | |
Removes the default spacing and border for appropriate elements. | |
*/ | |
blockquote, | |
dl, | |
dd, | |
h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
h6, | |
hr, | |
figure, | |
p, | |
pre { | |
margin: 0; | |
} | |
fieldset { | |
margin: 0; | |
padding: 0; | |
} | |
legend { | |
padding: 0; | |
} | |
ol, | |
ul, | |
menu { | |
list-style: none; | |
margin: 0; | |
padding: 0; | |
} | |
/* | |
Reset default styling for dialogs. | |
*/ | |
dialog { | |
padding: 0; | |
} | |
/* | |
Prevent resizing textareas horizontally by default. | |
*/ | |
textarea { | |
resize: vertical; | |
} | |
/* | |
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) | |
2. Set the default placeholder color to the user's configured gray 400 color. | |
*/ | |
input::placeholder, | |
textarea::placeholder { | |
opacity: 1; /* 1 */ | |
color: theme('colors.gray.400', #9ca3af); /* 2 */ | |
} | |
/* | |
Set the default cursor for buttons. | |
*/ | |
button, | |
[role="button"] { | |
cursor: pointer; | |
} | |
/* | |
Make sure disabled buttons don't get the pointer cursor. | |
*/ | |
:disabled { | |
cursor: default; | |
} | |
/* | |
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) | |
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) | |
This can trigger a poorly considered lint error in some tools but is included by design. | |
*/ | |
img, | |
svg, | |
video, | |
canvas, | |
audio, | |
iframe, | |
embed, | |
object { | |
display: block; /* 1 */ | |
vertical-align: middle; /* 2 */ | |
} | |
/* | |
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) | |
*/ | |
img, | |
video { | |
max-width: 100%; | |
height: auto; | |
} | |
/* Make elements with the HTML hidden attribute stay hidden by default */ | |
[hidden] { | |
display: none; | |
} | |
@tailwind components; | |
Lines 1 to 105 in 9297f8d
// Copyright 2023-present the Deno authors. All rights reserved. MIT license. | |
import { difference, type Unit } from "std/datetime/difference.ts"; | |
/** | |
* Returns a pluralized string for the given amount and unit. | |
* | |
* @example | |
* ```ts | |
* import { pluralize } from "@/utils/display.ts"; | |
* | |
* pluralize(0, "meow"); // Returns "0 meows" | |
* pluralize(1, "meow"); // Returns "1 meow" | |
* ``` | |
*/ | |
export function pluralize(amount: number, unit: string) { | |
// return amount === 1 ? `${amount} ${unit}` : `${amount} ${unit}s`; | |
return `${amount} ${unit}`; | |
} | |
/** | |
* Returns how long ago a given date is from now. | |
* | |
* @example | |
* ```ts | |
* import { timeAgo } from "@/utils/display.ts"; | |
* import { SECOND, MINUTE, HOUR } from "std/datetime/constants.ts"; | |
* | |
* timeAgo(new Date()); // Returns "just now" | |
* timeAgo(new Date(Date.now() - 3 * HOUR)); // Returns "3 hours ago" | |
* ``` | |
*/ | |
export function timeAgo(date: Date) { | |
const now = new Date(); | |
if (date > now) { | |
throw new Error("Timestamp must be in the past"); | |
} | |
const match = Object.entries( | |
difference(now, date, { | |
// These units make sense for a web UI | |
units: [ | |
"seconds", | |
"minutes", | |
"hours", | |
"days", | |
"weeks", | |
"months", | |
"years", | |
], | |
}), | |
) | |
.toReversed() | |
.find(([_, amount]) => amount > 0); | |
if (match === undefined) { | |
return "şimdi"; | |
} | |
const [unit, amount] = match; | |
const unitMapping: Record<Unit, string> = { | |
milliseconds: "milisaniye", | |
seconds: "saniye", | |
minutes: "dakika", | |
hours: "saat", | |
days: "gün", | |
weeks: "hafta", | |
months: "ay", | |
quarters: "çeyrek", | |
years: "yıl", | |
}; | |
return `${pluralize(amount, unitMapping[<Unit> unit])} önce`; | |
} | |
/** | |
* Returns a formatted string based on the given amount of currency and the | |
* `en-US` locale. Change the locale for your use case as required. | |
* | |
* @see {@linkcode Intl.NumberFormat} | |
* | |
* @example | |
* ```ts | |
* import { formatCurrency } from "@/utils/display.ts"; | |
* | |
* formatCurrency(5, "USD"); // Returns "$5" | |
* ``` | |
*/ | |
export function formatCurrency( | |
amount: number, | |
currency: string, | |
): string { | |
return new Intl.NumberFormat( | |
"en-US", | |
{ | |
style: "currency", | |
currency, | |
currencyDisplay: "symbol", | |
maximumFractionDigits: 0, | |
}, | |
).format(amount) | |
// Issue: https://stackoverflow.com/questions/44533919/space-after-symbol-with-js-intl | |
.replace(/^(\D+)/, "$1") | |
.replace(/\s+/, ""); |
Step 2: ⌨️ Coding
Modify README.md with contents:
• Review the "Features" section (lines 6-20) to ensure it includes all the latest functionalities and tools used in the project. If any new features have been added to the project that are not listed, such as any new Deno modules or Fresh framework capabilities, add them to this list with a brief description and a link to the relevant documentation or website.
• In the "Get Started Locally" section (lines 24-59), ensure that the setup instructions are up to date with the current project requirements. If there have been any changes in the setup process, such as new environment variables or additional setup steps, update this section accordingly.
• Verify the accuracy of the "Bootstrap the Database (Optional)" section (lines 61-70). If there have been updates or changes to the database setup or management tasks, such as new Deno task commands for database operations not currently documented, update this section with the new commands and their descriptions.
• In the "Customize and Extend" section (lines 72-124), ensure that the instructions for customization, such as creating a blog post or changing themes, are accurate and reflect the current capabilities of the project. If there have been any new customization options introduced, document them in this section.
• Review the "Deploy to Production" and subsequent deployment options sections (lines 126-186) to ensure that the deployment instructions are current and include all available deployment options. If there have been any changes or additions to the deployment process, such as new platforms supported or changes in the deployment steps, update these sections accordingly.
• Ensure that the "REST API Reference" section (lines 187-335) accurately reflects the current API endpoints and their functionalities. If there have been any changes to the existing endpoints or if new endpoints have been added, update this section with the new information, including example requests and responses.
• Check the "Goals and Philosophy" section (lines 337-355) to confirm that it still aligns with the project's current goals and philosophy. Update this section if there have been any changes in the project's focus or if new goals have been established.
• Finally, review the entire README.md for clarity, grammar, and formatting. Ensure that all links are working and that the document is easy to read and understand. Update any outdated links or references.--- +++ @@ -6,14 +6,15 @@ ## Features -- Deno's built-in [formatter](https://deno.land/manual/tools/formatter), - [linter](https://deno.land/manual/tools/linter) and - [test runner](https://deno.land/manual/basics/testing) and TypeScript support -- Next-gen web framework with [Fresh](https://fresh.deno.dev/) -- In-built data persistence with [Deno KV](https://deno.com/kv) -- High-level OAuth with [Deno KV OAuth](https://deno.land/x/deno_kv_oauth) -- Modern CSS framework with [Tailwind CSS](https://tailwindcss.com/) -- Responsive, SaaS-oriented design +- Deno's built-in [formatter](https://deno.land/manual/tools/formatter), [linter](https://deno.land/manual/tools/linter), [test runner](https://deno.land/manual/basics/testing), and TypeScript support ensure high-quality, maintainable code. +- Next-gen web framework with [Fresh](https://fresh.deno.dev/) for fast, efficient server-side rendering. +- In-built data persistence with [Deno KV](https://deno.com/kv) for scalable, global storage solutions. +- High-level OAuth with [Deno KV OAuth](https://deno.land/x/deno_kv_oauth) simplifies authentication workflows. +- Modern CSS framework with [Tailwind CSS](https://tailwindcss.com/) for rapid UI development. +- Responsive, SaaS-oriented design ensures your application looks great on any device. +- Enhanced security features with [Deno Secure](https://deno.land/x/deno_secure) for robust application protection. +- Comprehensive logging with [Deno Log](https://deno.land/std/log) for effective monitoring and debugging. +- Real-time data processing and WebSocket communication with [Deno WebSockets](https://deno.land/std/ws). - Dashboard with users view and statistics chart - First-class web performance - [REST API](#rest-api-reference) @@ -34,8 +35,8 @@ 1. Clone this repo: ```bash - git clone https://github.com/denoland/saaskit.git - cd saaskit + git clone https://github.com/eser/eser.live.git + cd eser.live ``` 1. Create a new `.env` file. 1. Navigate to GitHub's @@ -63,17 +64,15 @@ Use the following commands to work with your local Deno KV database: -- `deno task db:seed` - Populate the database with data from the - [Hacker News API](https://github.com/HackerNews/API). -- `deno task db:dump > backup.json` - Write all database entries to - `backup.json`. -- `deno task db:restore backup.json` - Restore the database from `backup.json`. -- `deno task db:reset` - Reset the database. This is not recoverable. +- `deno task db:seed` - Populate the database with initial data. +- `deno task db:dump > backup.json` - Export all database entries to `backup.json`. +- `deno task db:restore < backup.json` - Import database entries from `backup.json`. +- `deno task db:reset` - Completely reset the database to its initial state. +- `deno task db:migrate` - Apply database schema migrations to ensure the database structure is up to date. ## Customize and Extend ### Global Constants - The [utils/constants.ts](utils/constants.ts) file includes global values used across various aspects of the codebase. Update these values according to your needs. @@ -99,16 +98,9 @@ Hello, world! - ```javascript - console.log("Hello World"); - ``` - ```` -1. Start the server: - ```bash - deno task start - ``` -1. Navigate to the URL of the newly created blog post. E.g. - `http://localhost:8000/blog/hello-there`. +- To add custom fonts, update the `@import` statements in the [static/styles.css](static/styles.css) file. +- For dynamic content rendering, utilize the `useDeno` hook available in Fresh pages. +- Customize the dashboard by editing the [components/Dashboard.tsx](components/Dashboard.tsx) component. See other examples of blog post files in [/posts](/posts). @@ -140,13 +132,13 @@ ### Deploy to [Deno Deploy](https://deno.com/deploy) -1. Clone this repository for your SaaSKit project. +1. Clone this repository for your project. 1. Sign into [Deno Deploy](https://dash.deno.com) with your GitHub account. 1. Select your GitHub organization or user, repository, and branch. -1. Select **Automatic** deployment mode and `main.ts` as the entry point. -1. Click **Link**, which will start the deployment. -1. Once the deployment is complete, click on **Settings** and add the production - environmental variables, then hit **Save**. +1. Choose **Automatic** deployment mode and specify `main.ts` as the entry point. +1. Click **Link** to initiate the deployment. +1. After deployment, navigate to **Settings** in Deno Deploy and add your production environment variables, then click **Save**. +1. For containerized deployment, refer to the provided `Dockerfile` and `docker-compose.yml` for building and running your app in Docker. You should now be able to visit your newly deployed SaaS.
- Running GitHub Actions for
README.md
✗ Edit
Check README.md with contents:Ran GitHub Actions for 34b40b13122f1cf702178fdb53eeaa311fab57c5:
• CI Checks for Deno 1.41.2 on macOS-latest: ⋯
• CI Checks for Deno 1.41.2 on windows-latest: ⋯
• CI Checks for Deno 1.41.2 on ubuntu-latest: ✗
Step 3: 🔁 Code Review
I have finished reviewing the code for completeness. I did not find errors for sweep/enrich_existing_readme_according_to_late
.
🎉 Latest improvements to Sweep:
- New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
- Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
- Use the GitHub issues extension for creating Sweep issues directly from your editor.
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.Something wrong? Let us know.
This is an automated message generated by Sweep AI.
Checklist
README.md
✓ 34b40b1 EditREADME.md
✗ EditThe text was updated successfully, but these errors were encountered: