Git Product home page Git Product logo

iwa's Introduction

Setup to run on localhost

  • Clone source code from github.
git clone [email protected]:conficker1805/iwa.git
  • Install ruby: rvm install "ruby-2.7.1"
  • Run bundle install
  • Run rake db:seed
  • Run rails s
  • Access http://localhost:3000
  • Run unit tests: rspec

What is included in this assignment

Backend:

  • Using Ruby on rails as backend. Version ruby-2.7.1, rails 6.0.3.2.
  • Using pg for database migrations.
  • Using Json Web Token for authentication via API.
  • Builing API that can versioning in future.
  • Using rspec for unit testing (controllers, models, endpoints).

Fontend

  • Using Bootstrap, jquery as front end frameworks.

How to test Web app

How to test API

Postman: From Postman app, click Import - Import from a link - Paste the url below for importing https://www.getpostman.com/collections/99a82589e2a90ab402bd

Curl:

  • Sign in
curl --location --request POST 'localhost:3000/api/v1/users/sign_in' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Content-Type: text/plain' \
--data-raw '{
	"credentials": {
		"email": "[email protected]",
		"password": "12345678"
	}
}'
  • Fetch list of available Tests
    token from endpoint Sign In
curl --location --request GET 'localhost:3000/api/v1/tests' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: token' \
--data-raw ''
  • Fetch a Test token from endpoint Sign In
    :id is test id from endpoint Fetch list of available Tests
curl --location --request GET 'localhost:3000/api/v1/tests/:id' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: token' \
--data-raw ''
  • Submit a set of Answers (this endpoint allways return "saved succesfully" if user signed in)
    token from endpoint Sign In
curl --location --request POST 'localhost:3000/api/v1/submissions' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: token' \
--header 'Content-Type: text/plain' \
--data-raw '{
	"submission": {
		"test_id": 9,
		"questions": [
			{
				"question_id": 8,
				"answer_ids": [9]
			}
		]
	}
}'

iwa's People

Contributors

conficker1805 avatar

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.