Skip to content

B0tis/altv-typescript-with-typeorm-and-webhook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typescript Boilerplate for alt:V - v4.1.0

Super Fast Compilation

⌨️ Learn how to script for alt:V

❤️ Become a Sponsor of my Open Source Work

💡 Need a Roleplay Script? Try Athena!

🎮 alt:V Multiplayer for GTA:V

⭐ This repository if you found it useful!

Features

A simple Typescript Boilerplate that builds incredibly fast using the SWC Library.

  • Full alt:V Type Support for VSCode

  • Built in auto-copy for non-typescript files.

  • Built in handling of multiple resources for compilation.

  • Built in server restart after compilation.

  • Easily expandable resource directory.

  • altv-pkg support for auto-downloading alt:V Server Binaries.

  • Prettier Configuration for code formatting.

  • Tried and tested and used by the Athena Framework for over 1 year.

  • Examples how to use TypeORM for an AltV project

  • Examples for the use and implementation of a Discord webhook

  • Examples of how to customize AltV's server.cfg to suit your needs

Installation

Clone the Repository

Use the command below in any terminal, command prompt, etc.

git clone https://github.com/Stuyk/altv-typescript

Install the Repository

Use the command below in any terminal, command prompt, etc.

cd altv-typescript
npm install

follow only step 4 from the TypeORM website.

Configure the Repository

modify the server.cfg:

  • modify the wh_default for the Discord Webhook
    • you can command the Line or just remove the Webhooklink if you dont want to use this
  • and fill out the Database Config so the Server can connect to your DB
    • if you want to add a new Table or Column you just have to edit or add a new enity here (and add it to the entities in the index.ts here)
    • If you want to connect to a database type other than "mariadb", you must also edit the index.ts here

Download Server Files

Use the command below in any terminal, command prompt, etc. This will download all necessary server files from an additional package used by this project.

npm run update

Build Typescript Files

Use the command below in any terminal, command prompt, etc. This will build your TypeScript code into JavaScript.

npm run build

Start Production Server (Windows)

Run this command to run the server in production mode.

npm run windows

Start Production Server (Linux)

Run this command to run the server in production mode.

npm run linux

Start Developer Server (Windows)

Run this command to run the server in development mode.

npm run dev

End Server Runtime

Use the key combination ctrl + c to kill your server in your terminal, command prompt, etc.

How to Add Mods, and New Resources

This quickstart repository for Typescript allows mods.

However, do not put your resources in the resources folder.

Instead you should put resources, mods, etc. in the src folder in their own folder. They will be automatically copied to the resources folder after the code is transpiled.

About

A Typescript Boilerplate for alt:V with simple TypeORM and Discord Webhook setup and usage.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%