GithubHelp home page GithubHelp logo

prime_number's Introduction

prime_number

How to use

  • Download/clone the project then import Prime_Number_Service.postman_collection.json file to your Postman Collection

  • Edit environment variable in postman: set var SERVER into ec2-13-229-81-27.ap-southeast-1.compute.amazonaws.com:8000 or 13.229.81.27:8000

  • You can try to call this API: {{SERVER}}/v1/health

  • If you can see response like this, server is working properly: {"status": "ok"}

  • Call this API to get token, almost every APIs require token to work: {{SERVER}}/v1/users/token

  • APIs explain:

    • POST | {{SERVER}}/v1/users | create a new user
    • GET | {{SERVER}}/v1/users | get all users
    • GET | {{SERVER}}/v1/users/:id | get specific user
    • PUT | {{SERVER}}/v1/users/:id | edit user's info
    • DEL | {{SERVER}}/v1/users/:id | delete user (only admin can do this action)
    • POST | {{SERVER}}/v1/requests | create a prime number request (edit any number you want in the field e.g. {"send_number": 123})
    • GET | {{SERVER}}/v1/requests | get all requests
    • GET | {{SERVER}}/v1/requests/:id | get all requests by a user
  • About profiling, you can go to http://13.229.81.27:6060/debug/pprof to take a look at server's profiles

  • About metrics, you can go to http://13.229.81.27:6060/debug/vars to see the debug server

  • About tracing, you can go to http://13.229.81.27:9411/zipkin to observe all the traced requests

Schema

Middlewares diagram

TODO List

  • Find a solution to find the nearest prime number
  • Choose tech stacks. Backend: Golang, DB: Postgres, Git: Github, Server: AWS EC2, CI/CD: Github Actions
  • Design DB Schema and generate SQL queries
  • Set up DB run on a Docker container
  • Make DB migrations
  • Create a Makefile to shorten the commands
  • Create a simple server
  • Handle user CRUD, intergrate find the nearest prime number function, write tests
  • implement health check, profilling, add middleware, metrics, request logging
  • Implement Authentication and Authorization
  • Add tracing
  • Create a Dockerfile, and docker-compose
  • Deploy project on an AWS EC2 manually
  • Set up Github Actions

prime_number's People

Contributors

imperiutx 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.