Skip to content

Commit 5b7a337

Browse files
committed
updated readme
1 parent c63088b commit 5b7a337

File tree

1 file changed

+40
-31
lines changed

1 file changed

+40
-31
lines changed

README.md

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
# Sveltekit - Taro Stack
1+
# Sveltekit - Taro Stack
22

33
## ❗ Important
44

5-
If you forked this repository before May 27th, you'll want to view commit `653e2c2`. There was an issue with the Hono context
6-
not correctly parsing routes.
5+
If you forked this repository before May 27th, you'll want to view commit `653e2c2`. There was an issue with the Hono context not correctly parsing routes.
76

87
## ❔ What
98

10-
A scalable, testable, extensible, boilerplate for Sveltekit.
9+
A scalable, testable, extensible, template for Sveltekit.
1110

12-
Sveltekit is awesome. File-based routing, SSG/SSR, and having the ability to have a backend attatched to your frontend saves incredible amounts of time and effort.
11+
Sveltekit is awesome, but sometimes you need a bit more capability in the backend than what frameworks like
12+
NextJS & Sveltekit can deliver.
1313

14-
But the default backend sometimes isn't enough. There are some projects that require more powerful and feature rich backends. I'm talking Middleware, guards, pipes, interceptors, testing, event-emitters, task scheduling, route versioning, and so on.
15-
16-
So what I've done is attatched Hono, a fully fletched backend, to run on the Sveltekit process and forward all API requests to it.
14+
To remedy this, I've attatched a fully fletched backend to run on the Sveltekit process and forward all API requests to it and paired it with some architectural patterns.
1715

1816
`/api/[...slugs]`
1917

@@ -27,66 +25,77 @@ export const DELETE: RequestHandler = ({ request }) => app.fetch(request);
2725
export const POST: RequestHandler = ({ request }) => app.fetch(request);
2826
```
2927

28+
## How to Use
29+
30+
This is **not** supposed to serve as an all batteries included ["production boilerplate"](https://github.com/ixartz/Next-js-Boilerplate) with 200 useless sponsored features that get in your way. Templates that do this are ANYTHING but "production" and "quick start".
31+
32+
This is stack is designed to be library agnostic. The philosophy here is to boostrap the concrete, repetitive, and time consuming tasks that every application will need reguardless of what you're building.
33+
34+
So, fork this repo, add your favorite libraries, and make it your own "more opinionated" personal template **tailored to you**!
35+
3036
## Features
3137

3238
- 🟢 Full E2E typesafety
3339
- 🟢 RPC Client for API Requests
3440
- 🟢 Custom Fetch Wrapper
3541
- 🔴 Deployment Template
3642
- 🟠 Authentication
37-
- 🟢 Email/Passkey
38-
- 🔴 OAuth
43+
- 🟢 Email/Passkey
44+
- 🔴 OAuth
3945
- 🟢 Email Update/Verifiaction
40-
46+
- 🔴 Rate limiter
4147

4248
## Technologies
4349

50+
I'm mostly unopinionated or what technology or libaries someone uses. Wanna [uwu'ify](https://www.npmjs.com/package/owoifyx) your entire fucking app? Go for it.
51+
52+
That being said, there are some libaries that embody my philosophies of building software more than others,
53+
4454
- [Lucia](https://lucia-auth.com): Hits the right level of abstraction for me. Hand me the tools to build a secure authentication system and let me implement it to suite my needs
4555
- [Drizzle](https://orm.drizzle.team/) - Drizzle advertises itself as an ORM but I think its deceptive. Its a query builder with a migration client. Everytime I've used an ORM, I find myself fighting it for sometimes the simplist of use cases. Drizzle just gives you type-safety while querying SQL in a native fashion. Learn SQL, not ORMs.
46-
- [Hono](https://hono.dev/): Fast, lightweight, and built on web standards; meaning it can run anywhere you're Sveltekit app can. It's essentially a better, newer, and ironically more stable Express.JS. This provides us an extreemely good foundation to cleanly build ontop of without having to teardown first. It has a zod adapter for validating DTO's which can be shared with the frontend too.
47-
- [Sveltekit](https://kit.svelte.dev/): After trying Vue, React, Next, and pretty much every frotnend framework in the JS ecosystem, its safe to say I vastly prefer Svelte and its priority of building on web standards.
56+
- [Hono](https://hono.dev/): Fast, lightweight, and built on **web standards**; meaning it can run anywhere you're Sveltekit app can. It's essentially a better, newer, and ironically more stable Express.JS. This provides us an extreemely good foundation to cleanly build ontop of without having to teardown first. It has a zod adapter for validating DTO's which can be shared with the frontend too.
57+
- [Sveltekit](https://kit.svelte.dev/): After trying Vue, React, Next, and pretty much every frotnend framework in the JS ecosystem, its safe to say I vastly prefer Svelte and its priority of building on **web standards**.
4858

4959
## Architecture
5060

51-
There are a few popular architectures for structuring backends. Technical, Onion, VSA, and the list goes on. I almost always choose
52-
to start with Technical and let the project naturally evolve into one of the others.
53-
54-
### Folder Structure
55-
* **controllers** - Responsible for routing requests
61+
There are a few popular architectures for structuring backends. Technical, Onion, DDD, VSA, and the list goes on. I almost always choose
62+
to start with Technical and let the project naturally evolve into one of the others as complexity grows.
5663

57-
* **services** - Responsible for handling business logic.
64+
### Backend Folder Structure
5865

59-
* **repositories** - Responsible for retrieving and
60-
storing data.
66+
- **controllers** - Responsible for routing requests
6167

62-
* **infrastructure** - Handles the implementation of external services or backend operations.
68+
- **services** - Responsible for handling business logic.
6369

64-
* **interfaces** - Common
70+
- **repositories** - Responsible for retrieving and
71+
storing data.
6572

66-
* **middleware** - Middlware our request router is responsible for handling.
73+
- **infrastructure** - Handles the implementation of external services or backend operations.
6774

68-
* **providers** - Injectable services
75+
- **middleware** - Middlware our request router is responsible for handling.
6976

70-
* **dtos** - Data Transfer Objects (DTOs) are used to define the shape of data that is passed.
77+
- **providers** - Injectable services
7178

72-
* **common** - Anything commonly shared throughout the backend
79+
- **dtos** - Data Transfer Objects (DTOs) are used to define the shape of data that is passed.
7380

81+
- **common** - Anything commonly shared throughout the backend
7482

7583
### File Naming
84+
7685
You might notice how each file in the backend is postfixed with its architectural type(e.g. `iam.service.ts`). This allows
77-
us to easily reorganize the folder structure to suite a different architecture.
86+
us to easily reorganize the folder structure to suite a different architecture pattern if the domain becomes more complex.
7887

7988
For example, if you want to group folders by domain(DDD), you simply drag and drop all related files to that folder.
89+
8090
```
8191
└── events/
8292
├── events.controller.ts
8393
├── events.service.ts
8494
└── events.repository.ts
8595
```
8696

87-
8897
## Testing
8998

90-
Testing probably isn't first and foremost when creating an app. Thats fine. You shouldnt't be spending time writing tests if your app is changing and pivoting.
99+
Testing probably isn't first and foremost when creating an app. Thats fine. You should not be spending time writing tests if your app is mutable.
91100

92-
BUT a good stack should be **testable** when the time to solidify a codebase arrives. I created this stack with that pinciple in mind. I've provided a examples of how to write these tests under `authentication.service.test.ts` or `users.service.test.ts`
101+
BUT, a good stack should be **testable** when the time to solidify a codebase arrives. I created this stack with that pinciple in mind. I've provided a examples of how to write these tests under `authentication.service.test.ts` or `users.service.test.ts`

0 commit comments

Comments
 (0)