This is the backend API for the Falkor project, built with Elysia and Bun runtime.
- Bun (v1.0.0 or higher)
- Clone the repository
git clone https://github.com/team-falkor/api.git
cd api
- Install dependencies
bun install
- Set up environment variables
Create a .env
file in the root directory with the following variables:
DATABASE_URL="file:./prisma/dev.db"
BETTER_AUTH_SECRET="your-secret-key-at-least-32-characters-long"
STEAM_API_KEY="your-steam-api-key"
Note: Make sure your BETTER_AUTH_SECRET is at least 32 characters long for security. Get your Steam API key from Steam Web API.
- Set up the database
bun run db:push
To start the development server with hot reloading:
bun run dev
The API will be available at http://localhost:3000/
To start the production server:
bun run start
- Pull the latest database schema:
bun run db:pull
- Push schema changes to the database:
bun run db:push
The API uses Better-auth for authentication. Authentication endpoints are available under /auth/*
.
- All authentication endpoints are handled by Better-auth under
/auth/*
GET /steam/user/:steamUserId/games
- Get user's Steam games
GET /achievements/:steamId
- Get Steam game schema for achievementsGET /achievements/user/:steamUserId/game/:appId
- Get player achievements for a specific game
GET /providers
- Get available providersPUT /providers
- Submit a new provider- Admin routes available under
/providers/admin/*
POST /analytics/pageview
- Record a page viewPOST /analytics/event
- Record an event- Admin routes available under
/analytics/admin/*
GET /roadmap
- Get roadmap events- Admin routes available under
/roadmap/admin/*
GET /docs
- Swagger API documentation
api-new/
├── prisma/ # Database schema and migrations
├── src/
│ ├── @types/ # TypeScript type definitions
│ ├── handlers/ # Business logic handlers
│ ├── helpers/ # Helper functions and utilities
│ ├── lib/ # Library configurations (auth, etc.)
│ ├── modules/ # Feature modules
│ │ ├── achievement/ # Steam achievements
│ │ ├── analytics/ # Analytics tracking
│ │ ├── plugins/ # Plugin providers
│ │ ├── roadmap/ # Roadmap management
│ │ └── steam/ # Steam API integration
│ ├── plugins/ # Elysia plugins
│ ├── utils/ # Utility functions
│ └── index.ts # Main application entry point
├── .env # Environment variables (create this)
├── package.json # Project dependencies and scripts
└── tsconfig.json # TypeScript configuration
- Bun - JavaScript runtime & package manager
- Elysia - TypeScript web framework
- Prisma - Database ORM
- SQLite - Database
- Better-auth - Authentication
- @elysiajs/cors - CORS support
This project is licensed under the terms of the license included in the repository.
Reminder that you are great, you are enough, and your presence is valued. If you are struggling with your mental health, please reach out to someone you love and consult a professional. You are not alone; there is a large range of resources online for support and guidance.