Skip to content

hackclub/onekey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

142 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Hack Club flag

onekey

the platform for onekey, a hack club YSWS, written in sveltekit 5 + drizzle.

features

  • login and authentication with HCA
  • connection to hackatime
  • submit projects
  • explore others' projects
  • purchase accessories and other goodies from a shop
  • customize your macropad - coming soon!

for admins:

  • view user data
  • view and manage orders for fulfillment
  • create shop categories and items
  • review projects

stack

  • sveltekit 5 for frontend, routing, and SSR
  • drizzle ORM + postgreSQL for the database
  • encrypted session tokens stored server-side

running locally

you need bun, docker, and a .env file with your credentials.

bun install
bun run db:start     # spins up postgres via docker compose
bun run db:push      # applies the schema
bun run dev          # starts the dev server

to inspect the database:

bun run db:studio

deployment

this app builds to a plain node server.

bun run build
node build

set all env vars from .env.example in your .env file before running. key ones for prod:

  • DATABASE_URL - your postgres connection string
  • HCA_CLIENT_ID / HCA_CLIENT_SECRET / HCA_REDIRECT_URI - hack club oauth app
  • HACKATIME_CLIENT_ID / HACKATIME_CLIENT_SECRET - hackatime oauth app
  • TOKEN_ENCRYPTION_KEY - generate with openssl rand -hex 32
  • ADMIN_IDS / REVIEWER_IDS - space-separated HCA user IDs

run schema migrations against the prod database before starting:

bun run db:push

the server listens on port 3000 by default. set PORT to override.

contributing

pull requests are welcome! poke me (@maxstellar) in #onekey or dm me on slack if you have questions!

About

onekey, but in svelte now

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors