Giter Site home page Giter Site logo

zssn_api's Introduction

ZSSN - Zombie Survival Social Network

Build Status

About the current test

You need to develop a RESTful API that stores survivors from a zombie apocalypse and allow them to find the closest survivor from their location.

  • Create new survivors - name, gender and current location (latitude/ longitude)
  • Retrieve a survivor - survivor id required
  • Update a survivor
  • Retrieve closest survivor from a survivor - survivor id required, you can use only latitude or longitude to calculate it. This is to help a survivor to identify who is closer.
  • Mark survivor as infected - A survivor is marked infected when at least 3 others survivors report that it is infected.

Result of Lean Inception

For the development of the API, I used the Chaos and Order mechanism, where Chaos would be all that came to my mind about the problem and Order would be the Documentation creation process

Install

Inside the project directory:

Run the command below to copy the .env.

*Only for installation with Ruby on rails: You will have to change PostgreSQL credentials in .env with based on your local credentials!

cp .env.sample .env

Docker (recommended)

Make sure you have Docker and Docker-Compose installed on your machine!

*But, if you haven't installed it yet, I recommend the links below for installation using Ubuntu 20.04:

Install Docker: Click here!

Install Docker-compose: Click here!

Run to build the docker image:

docker-compose up --build

Use ctrl + c for stop container and run for install the gems:

docker-compose run --rm app bundle install

Creating and migrating database:

docker-compose run --rm app bundle exec rails db:create db:migrate

Go up the application, run container docker:

docker-compose up

*Run tests Rspec with:

docker-compose run --rm app bundle exec rspec spec

Ruby on Rails

Given that you have the Ruby(3.0.2), Rails(7.0.2.3) and DB PostgreSQL versions installed:

Install the gems

bundle install

Creating and migrating database:

rails db:create
rails db:migrate

Go up the application:

rails s

*Run tests Rspec with:

bundle exec rspec spec

Who to use

After go up API, now with the domain localhost http://localhost:3000 you will have access to the root_path API.

Click here to get the collection of requests made in Postman, download and import!

Use this to help you get nearest locations!

License

MIT

Free Software, Hell Yeah!

zssn_api's People

Contributors

padualima avatar

Watchers

 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.