amber-scaffolding
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:
sudo apt-get update- Install Crystal:
curl https://dist.crystal-lang.org/apt/setup.sh | sudo bashandsudo apt-get install build-essential crystal
After installation, run: crystal --version to verify that it was correctly installed.
For Windows 10:
- 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:
- Install Amber:
sudo apt-get install libreadline-dev libsqlite3-dev libpq-dev libmysqlclient-dev libssl-dev libyaml-dev libpcre3-dev libevent-devcurl -L https://github.com/amberframework/amber/archive/stable.tar.gz | tar xzcd amber-stable/andshards install, finally:make install
About Amber installation on other Linux Distributions: Amber - Installation
For Windows 10:
- As the Crystal compiler doesn't run on Windows yet, Amber doesn't either.
Create: New project using Amber
- Create new Amber project:
amber new projectNameandcd projectName - Install dependencies:
shards install - Install Node dependencies:
npm install
Create: CRUD using Amber Generate Scaffolding
- First, you need to have installed Docker Compose and readed the Amber - Docker Usage Guide.
- If you have an error using Docker Compose Up on Amber, use:
sudo docker-compose up -d db - In project root folder, run:
amber g scaffold ClassName attr_name:attr_type attr2_name:attr_type attr3_name:attr_type- Verify available Data Types.
- Run the migration:
- Only migration:
amber db migrate - Migration and Create DB:
amber db create migrate
- Only migration:
Run Amber project: amber watch
Use amber routes to see all routes in your project.
Contributing
- Fork it (https://github.com/saturday-night-code/amber-scaffolding/fork)
- Create your feature branch (
git checkout -b feature) - Commit your changes (
git commit -am 'Type: some feature')- Available Types (replace in Type): Add|Fix|Review
- Push to the branch (
git push origin feature) - Create a new Pull Request
Repository
amber-scaffolding
Owner
Statistic
- 1
- 0
- 1
- 0
- 0
- almost 3 years ago
- August 14, 2021
License
GNU General Public License v3.0
Links
Synced at
Sun, 26 Oct 2025 03:20:59 GMT
Languages