Jump to content

Search the Community

Showing results for tags 'webserver'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • [Read-Only] Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. Hello MTA community! My name is Ehsan/Exxon I’m excited to share a project I’ve been working on: mtasa-nestjs – a high-level API server framework for MTA:SA, inspired by Express.js and NestJS. What is mtasa-nestjs? mtasa-nestjs is a modular, structured Lua framework that makes building server-side APIs for MTA:SA simpler and more scalable. It brings modern backend patterns like Controllers, Middlewares, Guards, Interceptors, and DTOs directly into MTA:SA resources. It’s perfect for developers who want to build secure, maintainable, and professional APIs for their game servers. Key Features Express.js / NestJS-inspired structure: Clear separation of concerns for Controllers, Middlewares, Guards, and Interceptors. JWT Authentication & Password Hashing: Built-in secure JWT (HS256) implementation and password hashing from scratch. DTO Support: Validate and structure input data for cleaner code. Middlewares & Guards: Handle CORS, JSON parsing, authentication, authorization, and more. No External Dependencies: Works out-of-the-box in Lua for MTA:SA. Why I Built This Many MTA:SA servers handle HTTP requests in an ad-hoc manner, often leading to messy and hard-to-maintain code. With mtasa-nestjs, you can structure your API like a professional backend framework, making your server easier to scale and maintain. Example Usage Creating a JWT Token: local token = jwt.encode({userId = 123, role = "admin"}, "SECRET_KEY") iprint(token) Protecting Endpoints with Guards: AuthGuard = function(ctx) local authHeader = ctx.headers["authorization"] if not authHeader then error(Exception.Unauthorized("Missing Authorization header")) end local token = authHeader:match("^Bearer%s+(.+)$") local payload = jwt.verify(token, "SECRET_KEY") ctx.user = payload return true end Why You Should Try It If you’ve ever wanted a clean, structured, and modern API architecture for your MTA:SA server, this is a great starting point. It’s fully modular, fully Lua-based, and ready to handle complex server-side logic with minimal fuss. Where to Get It Ready on my github repository called mtsa-nestjs Make sure to create your own controllers, guards and etc. I’d love to hear feedback from the community. If you try it out, let me know what features you find most useful or what could be improved. Happy coding!
×
×
  • Create New...