https://github.com/team-falkor/api
The backend to falkor
https://github.com/team-falkor/api
api backend bun falkor
Last synced: 8 months ago
JSON representation
The backend to falkor
- Host: GitHub
- URL: https://github.com/team-falkor/api
- Owner: Team-Falkor
- License: mit
- Created: 2024-12-18T09:13:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-05T10:39:15.000Z (about 1 year ago)
- Last Synced: 2025-04-05T11:29:03.801Z (about 1 year ago)
- Topics: api, backend, bun, falkor
- Language: TypeScript
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Falkor API
This is the backend API for the Falkor project, built with [Elysia](https://elysiajs.com/) and [Bun](https://bun.sh) runtime.
## 📋 Prerequisites
- [Bun](https://bun.sh) (v1.0.0 or higher)
## 🚀 Getting Started
### Installation
1. Clone the repository
```bash
git clone https://github.com/team-falkor/api.git
cd api
```
2. Install dependencies
```bash
bun install
```
3. 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](https://steamcommunity.com/dev/apikey).
4. Set up the database
```bash
bun run db:push
```
## 🏃♂️ Development
To start the development server with hot reloading:
```bash
bun run dev
```
The API will be available at http://localhost:3000/
## 🚢 Production
To start the production server:
```bash
bun run start
```
## 📊 Database Management
- Pull the latest database schema: `bun run db:pull`
- Push schema changes to the database: `bun run db:push`
## 🔑 Authentication
The API uses [Better-auth](https://better-auth.com/) for authentication. Authentication endpoints are available under `/auth/*`.
## 🛣️ API Endpoints
### Authentication
- All authentication endpoints are handled by Better-auth under `/auth/*`
### Steam
- `GET /steam/user/:steamUserId/games` - Get user's Steam games
### Achievements
- `GET /achievements/:steamId` - Get Steam game schema for achievements
- `GET /achievements/user/:steamUserId/game/:appId` - Get player achievements for a specific game
### Providers
- `GET /providers` - Get available providers
- `PUT /providers` - Submit a new provider
- Admin routes available under `/providers/admin/*`
### Analytics
- `POST /analytics/pageview` - Record a page view
- `POST /analytics/event` - Record an event
- Admin routes available under `/analytics/admin/*`
### Roadmap
- `GET /roadmap` - Get roadmap events
- Admin routes available under `/roadmap/admin/*`
### Documentation
- `GET /docs` - Swagger API documentation
## 🧰 Project Structure
```
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
```
## 🔧 Technologies Used
- [Bun](https://bun.sh) - JavaScript runtime & package manager
- [Elysia](https://elysiajs.com/) - TypeScript web framework
- [Prisma](https://www.prisma.io/) - Database ORM
- [SQLite](https://www.sqlite.org/) - Database
- [Better-auth](https://better-auth.com/) - Authentication
- [@elysiajs/cors](https://elysiajs.com/plugins/cors.html) - CORS support
## 📝 License
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.