The official backend server for Missile Wars, developed by longtimeno-c.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). This means:
- ✅ You can view and fork this code
- ✅ You can use this code for personal projects
- ✅ You can modify the code
- ❌ You cannot use this code in closed-source commercial projects
- ❗ Any modifications or usage of this code must be made open source
- ❗ You must include the original license and copyright notice
For the full license text, see LICENSE
Copyright (c) 2024 longtimeno-c. All rights reserved.
- Real-time game state management using WebSockets (Middle Earth Library)
- Secure authentication system
- Push notifications via Firebase and expo notifications
- Email notification system
- Database integration with Prisma
- Node.js (v16.x or higher)
- npm (v8.x or higher)
- PostgreSQL database
- Firebase account for notifications and real time messaging
- SMTP server access for emails
Create an .env
file in the root directory:
# Server Configuration
NODE_ENV="development"
JWT_SECRET="your-secure-secret-here" # Generate a secure random string
VERBOSE_MODE="ON"
DISABLE_AUTH="OFF"
PORT=3000
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/dbname"
# Email Configuration
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_SECURE=false
EMAIL_USER="[email protected]"
EMAIL_PASS="your-app-specific-password"
EMAIL_FROM="[email protected]"
# WebSocket Configuration (Middle Earth)
WS_PORT=3001
WS_HEARTBEAT_INTERVAL=30000
- Create a Firebase project at Firebase Console
- Download your Firebase service account credentials
- Rename the credentials file to
firebasecred.json
and place it in the project root - This enables real-time push notifications for android devices, profile picture storage and secure firebase authenticaiton / account management.
npm install
npm run dev
npm run build
npm start
# Pull current database schema
npx prisma db pull
# Generate Prisma Client
npx prisma generate
# Open Prisma Studio (GUI database editor)
npx prisma studio
# Create a new migration
npx prisma migrate dev --create-only
# Apply migration
npx prisma migrate dev
npx ts-node export-script.ts
- Update your
.env
file with new database credentials - Update schema if necessary
- Run import script:
npx ts-node import-script.ts
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
For support, please open an issue in the GitHub repository or contact me on X.
- Middle Earth Library
- Firebase
- Prisma Team
- Expo Team