0 Companies using Amber

NameLinksEmployeesRevenueTrafficCountrySEOIndustry

How to use Amber

Amber is a web development framework written in the programming language Crystal. It aims to provide an efficient and productive environment for building scalable and maintainable web applications. Here are the steps to get started with Amber:

  1. Install Crystal: Before you can use Amber, you need to have Crystal installed on your system. Crystal is a statically-typed language similar to Ruby. You can follow the installation instructions specific to your operating system from the official Crystal website: https://crystal-lang.org/install/

  2. Create a new Amber project: Once Crystal is installed, you can use the

    amber
    command-line tool to create a new Amber project. Open your terminal and run the following command:

    $ amber new my_project_name

    This will create a new directory with the specified name (

    my_project_name
    ) and generate the basic structure of an Amber project inside it.

  3. Start the development server: Change into the newly created project directory by running:

    $ cd my_project_name

    To start the Amber development server, run the following command:

    $ amber watch

    This will compile your code and start a local server at

    http://localhost:3000
    where you can view your application in a web browser.

  4. Build your application: With the development server running, you can start building your Amber application. The main entry point of your application is the

    src/my_project_name.cr
    file. Here, you can define routes, controllers, models, and other components of your web application.

  5. Define routes: In Amber, routes define how incoming requests are routed to different parts of your application. You can define routes in the

    config/routes.cr
    file using the routing DSL provided by Amber. For example, to define a route for the root URL, you can add the following code:

    get "/", HomeController, :index

    This code maps requests to the root URL ("/") to the

    index
    action of the
    HomeController
    .

  6. Create controllers: Controllers handle incoming requests and coordinate with models and views to generate responses. You can create a new controller using the following command:

    $ amber g controller MyController

    This will generate a new file named

    my_controller.cr
    in the
    src/controllers
    directory. You can define actions within this controller to handle different routes.

  7. Define models: Models represent the data structures of your application and interact with the database. You can create a new model using the following command:

    $ amber g model MyModel

    This will generate a new file named

    my_model.cr
    in the
    src/models
    directory. You can define properties and methods within this model to work with data.

  8. Use views: Views are responsible for rendering HTML templates and presenting data to the user. Amber uses the ECR template engine by default. You can create a new view file in the

    src/views
    directory and use it within your controllers to render dynamic content.

These are the basic steps to get started with Amber. The framework provides many more features, such as middleware, authentication, testing, and asset handling, which can be explored in the official documentation: https://amberframework.org/guides/

Make your sales data-driven.

Website's technology stack, including its CMS, ecommerce platform, and payment processor, along with details about the industry, company and its contacts.

GDPR Compliant

CCPA Compliant

SOC2 Compliant

App screenshot