Giter Site home page Giter Site logo

clean-architecture-backend's Introduction

Arithmetic Calculator REST API

Implement a Web platform to provide a simple calculator functionality (addition, subtraction, multiplication, division, square root, and a random string generation) where each functionality will have a separate cost per request.

User’s will have a starting credit/balance. Each request will be deducted from the user’s balance. If the user’s balance isn’t enough to cover the request cost, the request shall be denied.

This Web application and its UI application should be live (on any platform of your choice). They should be ready to be configured and used locally for any other developer (having all instructions written for this purpose).

Local setup

  • Required node version: v18.16 or higher
  • Run npm install
  • Copy the file .env.example and rename it to .env
  • Define the required environment variables DATABASE_URL and REDIS_URL.
  • By using docker compose, run: docker-compose up -d to easily setup the required services.
  • Generate the required database client files by running: npm run migration:generate
  • Apply the migration to your local database by running: npm run migration:check
  • Run the server in development mode using the command npm run dev:http

Serverless

Wrap the api using serverless by following the next steps:

Environment variables

Take a look at .env.example for details

Commands

  • npm run dev:http: Starts the api, port: 3001 by default.
  • npm run build: Create a production ready build.
  • npm run test: Run test coverage
  • npm run serverless:deploy Create a serverless deployment on AWS, dev stage is default, you can modify the details modifying the serverless.yml file.
  • npm run create-user Run a CLI tool for user credentials creation.

clean-architecture-backend's People

Contributors

jgdev avatar

Stargazers

Joud Awad avatar Daniel Casado avatar

Watchers

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