Getting Started
Build your first X Framework application
Getting Started
Let's build a simple API with authentication and logging. We'll go through this step by step.
Project Setup
First, create a new directory and initialize your project:
Configuration
Let's start by setting up configuration. This will store our app settings and secrets:
Create src/index.ts
:
Adding Hono
Now let's add Hono for routing. We'll use our config in the setup:
Update your code:
Adding Authentication
Let's add authentication with Better Auth, using our config:
Update your code:
Adding Logging
Finally, let's add logging that includes our configuration context:
Update your code one last time:
Running the App
Create a simple server in src/server.ts
:
Run your app:
That's it! You've built an API with:
- Type-safe configuration
- Routing with Hono
- Authentication with Better Auth
- Request logging with LogTape
- Proper dependency injection between components
Next, learn more about: