Code Monkey home page Code Monkey logo

beabee's Introduction

beabee

This repository hosts beabee's API and legacy app. Go here to find out more about beabee.

If you are interested/have any questions please contact [email protected], I'd love to hear from you!

This system was originally created for South London Makerspace and repurposed by The Bristol Cable.

Deploy Known Vulnerabilities

Browser testing with

Install

⚠️⚠️⚠️ WARNING ⚠️⚠️⚠️

If you want to deploy beabee on a server refer to beabee/beabee-deploy instead. The instructions below are for running beabee locally for development

You need:

  • Docker >= 19.03.8
  • Docker Compose >= 2
  • Node.js >= 20.10.0

NOTE: Lower non-major versions probably work but haven't been tested

To just look around the system you can just use the example env file (.env.example) as is, but you'll need to create a sandbox GoCardless account to test any payment flows.

cp .env.example .env

npm install
npm run build
docker compose build

# Initialise database
docker compose up -d db
docker compose run --rm app npm run typeorm migration:run

# Do the rest
docker compose up -d

Go to: http://localhost:3001

To get started

Create a new super admin

docker compose run --rm app node built/tools/new-user

Import some data

Need some test data? Download it here: coming soon

docker compose run --rm -T app node built/tools/database/import.js < <import file>

Development

Development is containerized, in general you should be able to use the following to get started

npm start

You can also use the following when just working on the API (faster reloading)

npm run dev:api

Rebuilding containers

If you make changes to .env you need to recreate the Docker containers

docker compose up -d

If you change the dependencies in package.json you must rebuild and recreate the Docker containers

docker compose build
docker compose up -d

Generating database migrations

Whenever you make changes to a database model, you need to create a migration file. TypeORM will automatically generate a migration file based on your schema changes

docker compose start db
docker compose run app npm run typeorm migration:generate src/migrations/MigrationName
npm run build
docker compose run app npm run typeorm migration:run

Note: If you get an EACCES: permission denied error, you may need to run the above commands with docker compose run -u root.

Documentation

Documentation is currently very limited, email [email protected] if you have any questions.

The codebase is broadly split into a few different parts

  • beabee core

    Shared between all services (API, webhooks and legacy)

    ./src/core
    ./src/models - Data models and database entities
    ./src/config - Config loader
    
  • API service

    ./src/api
    
  • Webhook service

    Handlers for webhooks from beabee's integrations (currently GoCardless, Mailchimp and Stripe)

    ./src/webhook
    
  • Legacy app

    This is slowly being removed, with business logic being moved into the API and frontend into the new frontend.

    ./src/apps
    ./src/static
    ./src/views
    
  • Tools

    Various tools for administration, including nightly cron jobs

    ./src/tools
    
  • Database migrations

    Autogenerated by TypeORM

    ./src/migrations
    

beabee's People

Contributors

jclxx avatar jonasschatz avatar jumplink avatar mpress avatar naxxfish avatar pedrosland avatar snyk-bot avatar thisislawatts avatar tobiashauswurz avatar tomnewsom avatar unknowndomain avatar wpf500 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.