/static_sites_with_authentication

Static Sites with Authentication

Primary LanguageHTML

Static Sites with Authentication

Quick Links

Local App http://localhost:3000
Production App https://static-sites-with-authentication.fly.dev
Fly Stats https://fly.io/apps/static-sites-with-authentication

Installation

mkdir -p ~/Projects && git clone git@github.com:marian13/static_sites_with_authentication.git

Requirements

Setup

cd ~/Projects/static_sites_with_authentication && task install

Development

How to start a local backend server?

  • Run the following command:

    cd ~/Projects/static_sites_with_authentication && task backend:start
  • Open http://localhost:3000 in your browser.

NOTE: Static sites are NOT hot-reloaded.

How to start a local static sites server with hot reloading?

  • For example, for the code_notes static site, the command looks like so:

    cd ~/Projects/static_sites_with_authentication && task static_sites:code_notes:start
  • Open http://localhost:8000 in your browser.

NOTE: Hot-reloaded code_notes server has no backend access.

How to add a new static site?

  • Check how the static_sites:code_notes:build command is implemented and used in the Taskfile.

  • Adjust the regular expression in the config/routes.rb.

  • Add new static site by analogy.

Seeds

How to create a user locally?

  • Open Rails console:

    cd ~/Projects/static_sites_with_authentication && bundle exec rails console
  • Execute the command below:

    User.create!(email: "user@example.com", password: "secret")
  • Don't forget to replace email and password.

Tech Stack

Application

Databases

Tests

Task runner

Hosting