Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Latest commit

 

History

History
76 lines (63 loc) · 2.96 KB

getting-started.md

File metadata and controls

76 lines (63 loc) · 2.96 KB

Getting started

Contents

  1. Pre-installation
  2. Installation
  3. Creating a new project
  4. Running the application
  5. Full documentation for the CLI
  6. Keep reading

Disclaimer (alpha version)

This backend is an adaptation of Beagle's own backend and has not suffered many changes yet. This lib will probably see some significant changes before a stable release.

Pre-installation

  1. Make sure you have Node installed by using the command node -v. The minimum node version compatible with this lib is 13.2. If Node is not installed or is on an unsupported version, consider installing nvm in your machine. nvm is a tool to manage node versions installed in the system, it's easier to upgrade and switch from one version to another than a pure installation of node. To install nvm, check this link. If you don't want to install nvm, you can also download node from here.

  2. This is optional, but we recommend using yarn instead of npm. If you choose to follow this recommendation, use the command npm install yarn --global.

Installation

In order to make it easier and faster to start up a project with Nimbus Backend TS, you should install our CLI tool globally:

yarn global add @zup-it/nimbus-backend-cli

Creating a new project

Using the CLI, run the command new with the name of your project:

nimbus-ts new [PROJECT NAME]

This command will create the following project structure:

📦 project-name
 ┣ 📂 src
 ┃ ┣ 📂 screens
 ┃ ┃ ┣ 📜 home.tsx  // example of navigation between screens
 ┃ ┃ ┣ 📜 index.ts  // file where the routes are defined
 ┃ ┃ ┗ 📜 welcome.tsx  // example for default page
 ┃ ┣ 📜 config.ts  // file that have methods to get the NimbusTsConfig
 ┃ ┣ 📜 global-context.ts  // declaration of GlobalContext and example for its usage
 ┃ ┗ 📜 index.ts  // root of the express app, where everything is set up
 ┣ 📜 .editorconfig
 ┣ 📜 .eslintrc.js
 ┣ 📜 LICENSE
 ┣ 📜 README.md
 ┣ 📜 nimbus-ts.json  // configuration file to be used by the CLI and the Express App  
 ┣ 📜 package-lock.json
 ┣ 📜 package.json
 ┗ 📜 tsconfig.json

Running the application:

cd [PROJECT NAME]
yarn start

The application will be running at http://localhost:3000 if you didn't change any of the default configurations. This command also starts a websocket server that enables hot-reloading in frontend applications. To know more about this, read this topic.

Hot reloading is not currently enabled in the frontend.

Full documentation for the CLI

Read the topic topic to know more about every command and options of the CLI.

Read next

👉 Create your first screen