Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vjousse/lucky-blog
A Blog engine using Crystal and the Lucky Framework
https://github.com/vjousse/lucky-blog
crystal lucky-framework
Last synced: 6 days ago
JSON representation
A Blog engine using Crystal and the Lucky Framework
- Host: GitHub
- URL: https://github.com/vjousse/lucky-blog
- Owner: vjousse
- Created: 2020-09-22T10:47:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-06T07:25:50.000Z (almost 3 years ago)
- Last Synced: 2024-10-29T13:15:28.794Z (about 2 months ago)
- Topics: crystal, lucky-framework
- Language: Crystal
- Homepage: https://vincent.jousse.org
- Size: 69.9 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vince's
This is a project written using [Lucky](https://luckyframework.org). Enjoy!
## Setting up the project
1. [Install required dependencies](https://luckyframework.org/guides/getting-started/installing#install-required-dependencies)
1. Update database settings in `config/database.cr`
1. Run `script/setup`
1. Run `lucky dev` to start the app## Docker
### For dev purposes
Build images
docker-compose build
Start containers
docker-compose up
Init the app/database for the first time
docker-compose exec web ./script/setup
Load posts
docker-compose exec web lucky load_posts -l fr -d content/fr/
Start dev server
docker-compose exec web lucky dev
Launch tests
docker-compose exec web crystal spec
Reset test database (after migradion)
docker-compose exec --env LUCKY_ENV=test web lucky db.drop
### For production and deploy
Build the images
docker-compose -f docker-compose-prod.yml build
Tweak `.env.production` values
LUCKY_ENV=production
SECRET_KEY_BASE=eQ314uYO30d0OtNnWqAtsuXPZmD70Rc3xTY0AJrjbt4=
SEND_GRID_KEY=unused
DATABASE_URL=postgresql://postgres:postgres@db/vinces_production
HOST=0.0.0.0
PORT=5001
APP_DOMAIN=https://vincent.jousse.orgRun the images
docker-compose -f docker-compose-prod.yml up
Create the production database
docker-compose exec db createdb -U postgres vinces_production
Run the migrations
docker-compose exec web crystal run tasks.cr -- db.migrate
Load the posts
docker-compose exec web crystal run tasks.cr -- load_posts -l fr -d content/fr/
## Deploying the project
1. Make a build release `crystal build --release src/start_server.cr`
1. Load your posts `DATABASE_URL=postgresql://username:[email protected]/vinces_production crystal run tasks.cr -- load_posts -l fr -d content/fr/`
1. Build the assets `yarn prod`
1. Starts your server with `./start_server`You should definitively have a look at the [official documentation to deploy the project](https://www.luckyframework.org/guides/deploying/ubuntu).
## Learning Lucky
Lucky uses the [Crystal](https://crystal-lang.org) programming language. You can learn about Lucky from the [Lucky Guides](https://luckyframework.org/guides/getting-started/why-lucky).