amber-scaffolding

A CRUD(Create, Read, Update, Delete) using Amber Generate in Crystal.

saturday night code logo

amber-scaffolding

A CRUD(Create, Read, Update, Delete) using Amber Generate in Crystal.

What was used?

🏃 To run this project?

First, you need to have installed Crystal and Amber.

Install: Crystal

For Debian/Ubuntu based system:

  1. sudo apt-get update
  2. Install Crystal: curl https://dist.crystal-lang.org/apt/setup.sh | sudo bash and sudo apt-get install build-essential crystal

After installation, run: crystal --version to verify that it was correctly installed.

For Windows 10:

  1. The Crystal compiler doesn’t run on Windows yet, but it can be used with WSL (use linux installation guide in this case).
Install: Amber

For Debian/Ubuntu based system:

  1. Install Amber:
    1. sudo apt-get install libreadline-dev libsqlite3-dev libpq-dev libmysqlclient-dev libssl-dev libyaml-dev libpcre3-dev libevent-dev
    2. curl -L https://github.com/amberframework/amber/archive/stable.tar.gz | tar xz
    3. cd amber-stable/ and shards install, finally: make install

About Amber installation on other Linux Distributions: Amber - Installation

For Windows 10:

  1. As the Crystal compiler doesn't run on Windows yet, Amber doesn't either.
Create: New project using Amber
  1. Create new Amber project: amber new projectName and cd projectName
  2. Install dependencies: shards install
  3. Install Node dependencies: npm install
Create: CRUD using Amber Generate Scaffolding
  1. First, you need to have installed Docker Compose and readed the Amber - Docker Usage Guide.
  2. If you have an error using Docker Compose Up on Amber, use: sudo docker-compose up -d db
  3. In project root folder, run: amber g scaffold ClassName attr_name:attr_type attr2_name:attr_type attr3_name:attr_type
    1. Verify available Data Types.
  4. Run the migration:
    1. Only migration: amber db migrate
    2. Migration and Create DB: amber db create migrate

Run Amber project: amber watch

Use amber routes to see all routes in your project.

Contributing

  1. Fork it (https://github.com/saturday-night-code/amber-scaffolding/fork)
  2. Create your feature branch (git checkout -b feature)
  3. Commit your changes (git commit -am 'Type: some feature')
    1. Available Types (replace in Type): Add|Fix|Review
  4. Push to the branch (git push origin feature)
  5. Create a new Pull Request
Repository

amber-scaffolding

Owner
Statistic
  • 1
  • 0
  • 1
  • 0
  • 0
  • over 1 year ago
  • August 14, 2021
License

GNU General Public License v3.0

Links
Synced at

Fri, 03 May 2024 06:02:21 GMT

Languages