- TypeScript 91.5%
- CSS 8.1%
- JavaScript 0.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- Added aether-api-errors.ts for error handling messages. - Created aether-api.ts to manage login, registration, session lookup, and character listing. - Introduced authorization checks for admin sessions in authorization.ts. - Implemented cookie management for session handling in cookies.ts. - Developed session management functions in session.ts to handle authentication context. - Added types for session users and admin accounts in types.ts. - Created database functions for account management in accounts.ts. - Established a connection pool for database interactions in pool.ts. - Ensured database schema creation and seeding in schema.ts. - Implemented store functionality for product management in store.ts. - Added environment variable parsing and validation in env.ts. - Created utility functions for formatting money and dates in format.ts. - Developed pricing calculations and public product representation in pricing.ts. - Added tests for authorization, cookies, environment parsing, and pricing calculations. - Configured Vitest for testing environment. |
||
| public/aether | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| eslint.config.mjs | ||
| next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
AetherConnect
AetherConnect is the Next.js account, registration, store, and admin platform for AetherOnline.
It uses the existing AetherOnline login server for credentials and sessions, then stores web-owned catalog, order, and entitlement records in the same Postgres database so the game services can consume purchases later.
Stack
- Next.js 16 App Router with React 19 and Server Actions
- TypeScript, Vitest, ESLint
- Postgres via
pg - Stripe Checkout-ready payment flow
- HTTP-only cookies for Aether login access and refresh tokens
Local Setup
The local .env.local was generated from ../AetherOnline/.env.local without printing secrets. It is ignored by git.
npm install
npm run dev
Open http://localhost:3000.
The login server should be reachable at AETHER_LOGIN_BASE_URL, which defaults to http://127.0.0.1:7000.
Start it from the game repository when local login is needed:
cd ../AetherOnline
cargo run -p aether-login-server
Environment
Copy .env.example to .env.local for a new machine and fill in secrets.
AETHER_DATABASE_HOST=
AETHER_DATABASE_PORT=5432
AETHER_DATABASE_NAME=
AETHER_DATABASE_USER=
AETHER_DATABASE_PASSWORD=
AETHER_DATABASE_SSLMODE=disable
AETHER_LOGIN_BASE_URL=http://127.0.0.1:7000
AETHERCONNECT_SITE_URL=http://localhost:3000
AETHERCONNECT_SESSION_SECRET=
AETHERCONNECT_ENABLE_TEST_PURCHASES=false
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
Production notes:
- Set
AETHERCONNECT_SESSION_SECRETto at least 32 characters. - Keep
AETHERCONNECT_ENABLE_TEST_PURCHASES=false. - Set
STRIPE_SECRET_KEY,STRIPE_WEBHOOK_SECRET, andstripe_price_idvalues for products before accepting real payments. - Deploy behind HTTPS so the
__Host-auth cookies are secure.
Admin Bootstrap
Admin access uses the existing accounts.is_admin flag from AetherOnline. Promote an initial account directly in Postgres:
UPDATE accounts
SET is_admin = TRUE
WHERE username = 'your-username';
After signing in, visit /admin and use Ensure schema to create the web store tables and seed the default catalog if the catalog is empty.
Scripts
npm test
npm run build
npm run start