Giter Site home page Giter Site logo

cxspxr / react-shortener Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 412 KB

:link: Rails API & React URL Shortener

Home Page: https://shorrtener.herokuapp.com/

Ruby 99.46% HTML 0.54%
react reactjs url-shortener rails rails5-api coffeescript2 jsx stylus sugarss webpack

react-shortener's Introduction

๐Ÿ“ฎ Rails API for URL Shortening ๐Ÿ“ค

What I'm gonna use:


Development

Use rails s and curl for HTTP requests.


Deployment

This might be deployed as an isolated API as it is shown here (this exactly route returns the current number of links for base62 encoding). Along with a frontend like this (git for it) served with some http server. Just don't forget to respect the CORS as it is shown here.

On the other hand it could be deployed as a part of monolithic system as it is shown here (react branch of this repo) with a Puma for http serving.


Project Structure

app/

You may know the app/ structure since it's pretty default. It's the home to models, controllers, validators, exception handlers etc.

Controllers

There are three controllers which are interesting for us:

  • application_controller with module dependencies;
  • links_controller handles store-ing, get-ing, count-ing for the Link model;
  • redirect_controller with a single method to redirect and store the Redirect itself (i.e. it's location) using the Geocoder;

Models

  • Link to store :url and :shortened;
  • Redirect to store :location and :time;

A single Link has many Redirects. A single Redirect belongs to one Link.

Validators

  • Base62Validator to validate :base62 shortening;
  • UrlValidator to validate :url formatting;

config/

  • initializers/rack_attack.rb to configure Rack::Attack;

  • environments/*.rb to manage heroku production and local environments (development and testing);

spec/

This is for RSpec with Shoulda Matchers & Faker testing.

I belive that everything is backed by tests by now.

Specific files

.branch-ignore is used by me to manage branch-specific .gitignore using Husky and .gitignore.<branch-name> files.

/.*|(other)/ folders & files are pretty default

react-shortener's People

Contributors

cxspxr avatar renovate-bot avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

datacrafts-io

react-shortener's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Detected empty commit - aborting git push

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency faker to v1.9.6
  • Update dependency mysql2 to v0.5.6
  • Update dependency rack-attack to v5.4.2
  • Update dependency bootsnap to v1.18.3
  • Update dependency database_cleaner to v1.99.0
  • Update dependency figaro to v1.2.0
  • Update dependency rack-cors to v1.1.1
  • Update dependency rspec-rails to v3.9.1
  • Update dependency shoulda-matchers to v4.5.1
  • Update dependency spring to v2.1.1
  • Update dependency byebug to v11
  • Update dependency database_cleaner to v2
  • Update dependency faker to v3
  • Update dependency husky to v9
  • Update dependency rack-attack to v6
  • Update dependency rack-cors to v2
  • Update dependency rails to v7
  • Update dependency rspec-rails to v6
  • Update dependency ruby to v3
  • Update dependency shoulda-matchers to v6
  • Update dependency spring to v4
  • Update npm to v10
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • Update dependency geocoder to v1.6.1 [SECURITY]
  • Update dependency dalli to v3 [SECURITY]

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

bundler
Gemfile
  • ruby 2.5.1
  • rails '~> 5.2.1'
  • mysql2 '>= 0.4.4', '< 0.6.0'
  • puma '~> 3.11'
  • geocoder undefined
  • rack-cors undefined
  • dalli undefined
  • memcachier undefined
  • rack-attack undefined
  • figaro undefined
  • bootsnap '>= 1.1.0'
  • byebug undefined
  • rspec-rails '~> 3.5'
  • faker undefined
  • listen '>= 3.0.5', '< 3.2'
  • spring undefined
  • spring-watcher-listen '~> 2.0.0'
  • factory_bot_rails '~> 4.0'
  • shoulda-matchers '~> 4.0'
  • database_cleaner undefined
npm
package.json
  • husky 1.0.1
  • node 10.21.0
  • npm 6.4.1
ruby-version
.ruby-version

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.