Giter Site home page Giter Site logo

lushaengineeringtask's Introduction

Lusha Engineering Task

Quick Start


  1. User docker-compose to setup the server
bash compose.sh

The command above should build and ru n the following services

  • Server
  • Client (compiled and behind Caddy server)

Populate data


In order to populate data into the server i've created a simple script that should some requests filling data to the mongodb server through the servers api

bash test_add_users.sh

CURLs


# GET
# Returns the first 10 users
curl http://localhost:4000/api/v1/users?page=0

# POST
# Creates a user.
curl localhost:4000/api/v1/users/create -H "content-type: application/json" \
   -d '{ "email": "[email protected]", "password": "somePass", "firstName": "Jhon", "lastName": "Doe", "description": "From CURL" }'

Project Structure


Server


|- server
  |- main.ts            | Entry point
  |- config             | Configuration files
     |- default.ts      | default configuration file
     |- constants.ts    | constants file
  |- src                | core
     |- server.ts       | Server bootstrap
     |- controllers     | Controller classes
     |- routes          | Router classes
     |- repositories    | Repository/Database classes
     |- types           | Typescript types files
     |- utils           | Utilities

Client (created with create-react-app)

|- client 
  |- src                | React App
     |- components      | React components
     |- containers      | Views
     |- redux           | Redux store, reducers, actions
     |- routes          | react-dom-router
     |- App.tsx         | React App
     |- index.tsx       | React Index

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.