Skip to content

Example backend application powered by Drash running on Deno.

License

Notifications You must be signed in to change notification settings

mitom18/example-server-deno

Repository files navigation

Example Deno server

Implementation of example backend application written in TypeScript powered by Drash running on Deno.

Features

  • Database connection (MySQL)
  • ORM
  • HTTP REST API
  • Logger
  • Authentication

Usage

Application requires MySQL database. Ensure you have access to a MySQL database server. You can initialize the database with db_init.sql script. Database contains user with credentials [email protected] / password.

To run this application, you'll need Deno installed on your computer. Project is currently working with Deno in version 1.9.2.

It is recommended to use Velociraptor for running all scripts in the project. If you have Velociraptor installed on your computer, just run:

# Run the app in development
vr start

# Build the production bundle
vr bundle

# Bundles the bcrypt worker file, so it can be used in app bundle
vr bundle-bcrypt-worker

# Run the production bundle
vr start-bundle

# Compile the production bundle to executable binary
vr compile-bundle

If you don't have Velociraptor installed, see scripts.yml for commands you need to run.

IMPORTANT: deno bundle has currently problems with used Zod library, so you need to review the bundle before running or compiling it and replace every usage of mod11 to mod10.

IMPORTANT: deno bundle is currently not able to bundle the bcrypt worker file, so you have to do it manually and then find worker.ts imports and replace them with local worker bundle imports before running in order to run smoothly.

IMPORTANT: When you run the bundle or the executable binary, ensure you have the proper .env file in the same directory as the bundle or the binary.

IMPORTANT: deno compile is currently not supporting web workers, so bcrypt functions MUST be used in their "sync" form in order to work. If you are planning to compile the program, you must replace async/await bcrypt functions with their sync versions that are not using web workers. However, sync functions are blocking and have huge impact on performance. It is not recommended to use the compiled program, this option is here only as illustration for now.

Built With

Performance

Performance tests and their results can be seen here.

Licence

MIT

About

Example backend application powered by Drash running on Deno.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published