API.OLUWASETEMI.DEV
A comprehensive personal API repository built with Hono.js, featuring dual authentication systems (JWT & Better Auth), GraphQL endpoint with Apollo Server, real-time analytics, OpenAPI documentation with Scalar, and a modern tech stack including Drizzle ORM, Zod validation, and comprehensive testing.
API.OLUWASETEMI.DEV
A comprehensive personal API repository that serves as a full-featured backend solution demonstrating modern development practices. Built with Hono.js for high performance, the platform features dual authentication systems, real-time analytics, interactive API documentation, and a powerful GraphQL endpoint.
Key Features
Dual Authentication Systems
- Legacy JWT Authentication: Traditional JWT-based auth with register, login, refresh, and protected routes
- Better Auth Integration: Modern authentication with email/password, session management, and enhanced security
- Protected Routes: Comprehensive route protection with middleware
Real-Time Analytics
- Request Tracking: Comprehensive logging of all API requests with performance metrics
- Analytics Endpoints:
/analytics/requests
and/analytics/counts
for detailed insights - Filtering & Grouping: Advanced analytics with date ranges, method filtering, and grouping by day/path/method
- Performance Optimized: Minimal overhead (~1-2ms per request) with non-blocking database writes
GraphQL Integration
- Auto-generated Schema: Database tables automatically exposed as GraphQL types
- Authentication Support: Complete auth mutations (register, login, refreshToken) and queries (me)
- Custom Queries: Advanced analytics queries with filtering and grouping capabilities
- Interactive Playground: Development playground at
/playground
for testing queries
Comprehensive Documentation
- OpenAPI Specification: Full API documentation with
/doc
endpoint - Scalar Documentation: Interactive API documentation at
/reference
- Type-Safe Routes: All endpoints documented using @hono/zod-openapi
- Live Examples: Working examples and testing interface
Database & ORM
- Drizzle ORM: Type-safe database operations with SQLite
- Schema Management: Single source of truth for database schemas
- Migrations: Proper database migration system
- Type Safety: Full TypeScript integration throughout
API Endpoints
Authentication
POST /auth/register
- Legacy JWT registrationPOST /auth/login
- Legacy JWT loginPOST /auth/refresh
- Token refreshGET /auth/me
- Get current user (protected)POST /api/auth/sign-up/email
- Better Auth registrationPOST /api/auth/sign-in/email
- Better Auth loginPOST /api/auth/sign-out
- Sign outGET /api/auth/get-session
- Get session info
Core API
GET /tasks
- List all tasks (paginated)POST /tasks
- Create a taskGET /tasks/{id}
- Get task by IDPATCH /tasks/{id}
- Update taskDELETE /tasks/{id}
- Delete task
Analytics & Monitoring
GET /analytics/requests
- Paginated request logsGET /analytics/counts
- Aggregated analyticsGET /graphql
- GraphQL endpointGET /playground
- GraphQL playground (dev)
Documentation
GET /doc
- OpenAPI specificationGET /reference
- Scalar API documentation
My Role on the Project
- Full-Stack Architecture: Designed and implemented the entire API architecture from scratch
- Authentication Systems: Implemented both JWT and Better Auth with comprehensive security
- Analytics Engine: Built real-time request tracking and analytics system
- GraphQL Implementation: Set up Apollo Server with auto-generated schemas and custom queries
- Database Design: Created and maintained database schemas using Drizzle ORM
- API Documentation: Implemented comprehensive OpenAPI documentation with Scalar interface
- Testing Strategy: Established comprehensive testing patterns with Vitest
- DevOps & Deployment: Configured deployment pipeline and hosted at api.oluwasetemi.dev
- Code Quality: Implemented ESLint configuration with @antfu/eslint-config
Technical Architecture
Core Technologies
- Framework: Hono.js for high-performance web framework
- Database: SQLite with Drizzle ORM for type-safe operations
- Authentication: Dual JWT and Better Auth systems
- GraphQL: Apollo Server with Drizzle GraphQL integration
- Validation: Zod schemas for runtime validation and OpenAPI docs
- Logging: Structured logging with Pino for production monitoring
- Testing: Vitest for comprehensive testing with proper organization
Development Tools
- Package Manager: pnpm with workspace configuration
- Code Quality: ESLint with @antfu/eslint-config
- Type Safety: Full TypeScript integration
- Process Management: PM2 ecosystem configuration
- Documentation: Scalar for interactive API docs
Live Demo & Resources
- API Base URL: api.oluwasetemi.dev
- Interactive Documentation: api.oluwasetemi.dev/reference
- GraphQL Endpoint: api.oluwasetemi.dev/graphql
- OpenAPI Spec: api.oluwasetemi.dev/doc
- Source Code: GitHub Repository
Motivation & Impact
This project serves as both a practical personal API and a comprehensive showcase of modern backend development practices. It demonstrates:
- Production-Ready Architecture: Real-world authentication, analytics, and monitoring
- Developer Experience: Interactive documentation, GraphQL playground, and comprehensive testing
- Performance: High-performance Hono.js framework with optimized analytics
- Type Safety: Full TypeScript integration with Zod validation
- Modern Practices: Latest development tools and best practices
The API is publicly available at api.oluwasetemi.dev with interactive documentation at api.oluwasetemi.dev/reference. The graphql endpoint is available at api.oluwasetemi.dev/graphql.