GithubHelp home page GithubHelp logo

strawbrary's Introduction

Strawbrary

Description

A web stack app for managing a smol library.

Requirements

  • Docker

Running with Docker - initial run

# Start up all services
$ docker compose up --build

Sync Prisma.schema with database

Once at least the web.app and postgres containers are created and running. Apply the database migration files in order to sync with the prisma.schema.

There are two ways of doing this:

  • cli into the web.app container once its running along with the postgres container, then run the command:
    # Inside web.app container /app
    $ npx prisma migrate deploy
  1. [or] Once the postgres container is running.
    # Enter the web.app directory
    $ cd web.app
    # Install packages (mainly for the prisma package)
    $ npm install
    # Apply migration history to database
    $ npx prisma migrate deploy
    This option requires you have the web.app's .env file present along with the DATABASE_URL variable defined.

Environment variables

[NOTE] If running with docker compose. When changing ports, also reflect these changes in the nginx/nginx.conf. See issue #23

All environment variables here are used in the root .env by docker compose. For web.app and react.app their environment variables should be applied to their local root if not running through docker compose.

There are three example.env files located in root, web.app/, and react.app/. They are examples of what the actual .env files should look like.

web.app

  • DATABASE_URL

    The Url used by Prisma to establish a connection with the postgres database.

    Example: postgresql://<username>:<password>@<host>:<port>/strawbrary?schema=public

  • WEB_APP_PORT

    The port on which to run the web.app application. Defaults to 3000.

react.app

  • REACT_APP_BASE_URL

    The base Url of the backend server. Used when making requests.

    Example: http://host:port

  • REACT_APP_WEBPACK_DEV_PORT

    The porn on which the react app webpack development server runs on.

nginx

  • NGINX_EXPOSED_PORT

    THe port on which the nginx container is exposed outward.

strawbrary's People

Contributors

tifye avatar

Watchers

 avatar

strawbrary's Issues

Bug when changing item type

When changing from type on an item from a type that is not borrowable to a type that is borrowable the isBorrowable field does not update and the item continues to be unborrowable.

Solution:
Since changing the type also update other fields and it is a significant enough of a change, will create a separated endpoint for changing the type on an item.

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.