Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server side #18

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
guest:
cd guest-app && python3 -m http.server 3001 --bind 127.0.0.1

staff:
cd staff-app && python3 -m http.server 3002 --bind 127.0.0.1
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@

# Restaurant at the end of the universe

Frontend clients for guests and staff.

## Running

Running both apps is simply if you have `make` and `python3` installed:

### Guest app

`make guest`

will start simple Python HTTP server on port 8081, therefore guest application should be available at `http://localhost:8081`.

### Staff app

`make staff`

will start simple Python HTTP server on port 8082, therefore guest application should be available at `http://localhost:8082`.

## Working with custom server

In order to connect frontend clients to a custom server, modify `guest-app/index.html` and `staff-app/index.html` files.

Find a line starting with `const BASE_URL = "..."` , replace the value with your custom server base URL, and you should be ready to go.
Don't panic and always carry a towel.

1 change: 1 addition & 0 deletions backend-api/.rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
46 changes: 46 additions & 0 deletions backend-api/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec

AllCops:
TargetRubyVersion: 2.7.1
TargetRailsVersion: 7.0
Include:
- 'app/**/*'
- 'config.ru'
- 'Gemfile'
- 'Guardfile'
- 'Rakefile'
- 'spec/**/*'
Exclude:
- 'app/views/**/*'
- 'app/assets/**/*'
- 'app/javascript/**/*'
- 'bin/*'
- 'db/schema.rb'
- 'db/migrate/*'
- 'log/**/*'
- 'node_modules/**/*'
- 'public/**/*'
- 'scripts/**/*'
- 'vendor/**/*'
- 'tmp/**/*'
- '.git/**/*'

Documentation:
Enabled: false

Metrics/BlockLength:
Exclude:
- 'Guardfile'

Naming/FileName:
Exclude:
- 'Gemfile'
- 'Guardfile'
- 'Rakefile'

Rails:
Enabled: true

1 change: 1 addition & 0 deletions backend-api/.ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-2.7.1
65 changes: 65 additions & 0 deletions backend-api/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.1'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '~> 7.0.4'

# Use postgresql as the database for Active Record
gem 'pg', '~> 1.1'

# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '~> 5.0'

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
# gem "jbuilder"

# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"

# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
gem 'rack-cors'

gem 'money-rails', '~>1.12'

gem 'active_enum', '~> 1.0.0'
gem 'active_model_serializers'
gem 'jwt'

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem 'debug', platforms: %i[mri mingw x64_mingw]
gem 'pry', '~> 0.13.1'

gem 'rubocop', '~> 1.36'
gem 'rubocop-performance'
gem 'rubocop-rails'
gem 'rubocop-rails_config'
gem 'rubocop-rspec'

gem 'factory_bot_rails', '~> 6.1.0'
gem 'rspec-rails', '~> 4.0.2'
end

group :development do
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end
Loading