Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marketcircle rails-assessment

Screen.Recording.2024-02-21.at.1.09.48.AM.mov

This Rails 7 app has two models User and Info, offering CRUD APIs and a UI driven by Hotwire with turbo-frame and turbo-streams.

Database Schema

Users table has columns

  • name : string

Infos table has columns

  • title : string
  • email : string
  • age : integer
  • phone : string
  • user_id : foreign_key

Defined Associations

  • User has_one Info
  • Info belongs_to User

Run Locally

First, Install ruby 3.2.2 using rbenv or rvm

  rbenv install 3.2.2

Install dependencies

  bundle install

Setup database

  rails db:create
  rails db:migrate
  rails db:seed

Start the Rails Server

  rails server

By default, it will run on http://localhost:3000

API Reference

Users APIs

  GET     /users.json
  GET     /users/${user_id}.json
  POST    /users.json
  PUT     /users/${user_id}.json
  DELETE  /users/${user_id}.json

User Info APIs

  GET     /infos.json
  GET     /infos/${info_id}.json
  POST    /infos.json
  PUT     /infos/${info_id}.json
  DELETE  /infos/${info_id}.json

Postman API collection

https://api.postman.com/collections/21655182-7eebfb17-025d-4d19-a593-a4640a2e830e?access_key=PMAT-01HQ41D9BNR8P6WZSSQN74CFM4

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages