This repo is a work in progress and is currently my personal thing. Feel free to fork or ask questions about it, but expect things to change drastically.
This is a highly opinionated monorepo for game dev using web tech.
The stack is:
Sveltefor frontend (https://svelte.dev)Bunfor backend (https://bun.sh)MongoDBfor database (https://www.mongodb.com)
nvm use
bun install
bun dev
touch .env and add:
PORT=1337
CORS_ORIGIN=*
NODE_ENV=development
MONGO_CONNECT=mongodb://wsadmin:qwe123@localhost:27017
SUPPORT_EMAIL_PASSWORD=<password>
PASSWORD_RESET_HASH=<custom_hash>
cd svelte-game-server
bun install
bun dev
- ✅ Socket server to handle any request (https://github.com/kkortes/async-await-websockets)
- ✅ Account log in
- ✅ Account creation
- ✅ Account password recovery
- ✅ Notification center
- ✅ Render backend hosting setup (https://render.com)
- ✅ Vercel frontend hosting setup (https://vercel.com)
- ✅ Tailwind CSS for styling (https://tailwindcss.com)
-
.env (development) & .env.production (production)are injected intosrc/constants/ENV_VARS.ts. Trying to parseimport.meta.Xwon't work in Svelte files, due to vite crashing when there is CSS in the files that they parse. -
This repo utilizes
sveltekit-autoimport(https://github.com/yuanchuan/sveltekit-autoimport) hence some.svelteand.jsimports seem to magically appear out of nowhere. Seevite.config.jsto see what's going on.