GithubHelp home page GithubHelp logo

martinandreev / code Goto Github PK

View Code? Open in Web Editor NEW

This project forked from acterglobal/code

0.0 0.0 0.0 8.12 MB

Home Page: https://acter.app

License: MIT License

Shell 0.11% JavaScript 0.90% TypeScript 98.73% HTML 0.01% Handlebars 0.17% PLpgSQL 0.08% Procfile 0.01%

code's Introduction

Acter

About

Acter is a free community management tool for grassroots, activists, researchers, NGOs basically anyone working for an equal, peaceful and regenerative future. It is both an internal organizing tool for individuals and groups as well as a database to find new collaborators or initiatives. The platform has been online since 2021.

The Acter platform is the main initiative in the Danish based non-profit organization Acter Global. Acter Global was founded in 2020 and has as its ultimate goal to promote an equal, peaceful and regenerative world by furthering existing solutions to global challenges and engaging more people in and around their implementation.

Table of contents

Laptop setup

Head to New laptop setup

Technology Stack

Acter is built with the following stack.

Role Technology
Language Typescript
Frontend Next.js
Components Material-UI
Testing Jest, Testing Library, Storybook
Authenticaton Auth0
Hosting/DNS Heroku, CloudFlare
Notification/Email Sendgrid, Fake SMTP Server on dev
API/Data GraphQL, Apollo (server), URQL (client), TypeGraphQL, Prisma TypeGraphQL
Database PostgreSQL, Prisma ORM

Getting started

Service Dependencies

The application's dependencies are dockerized. Currently this consists of a Postgres database and a fake SMTP server. Make sure that Docker, copy .env.example to .env and set the appropriate fields is set up, then run:

docker-compose up -d --build

Or better yet use the VS Code built-in Docker command: command+shift+p and select "Docker Compose: Up"

We have a fake SMTP server that is deployed with Docker which allows us to receive emails in development. When our app is running in Docker, it is available at http://localhost:1080.

Database setup

Once the DB is running, you can migrate & seed it using:

yarn db:migrate:run

Auth0, Google Maps, etc.

We use a .env file to manage keys and secrets to various 3rd party providers like Auth0 and Goolge Maps. To set this up, copy .env.example to .env, then get keys and secrets from someone, probably Emil.

cp .env.example .env

Installation, build and dev server

The app currently uses Yarn 3 with workspaces to manage it's monorepo dependencies. Get started by running the following from the root folder:

yarn

After that, you will need to build various parts of the application:

yarn build

Finally, start the Next.js server with:

yarn dev

The app will be available at http://localhost:3000

Deployment

Demo

The main branch is automatically deployed as the acter-dev app on Heroku to https://demo.acter.app.

Production

Deployment to production is achieved as a manual deploy of main as the acter-prod app on Heroku to https://acter.app.

Monorepo Layout

Acter's codebase is laid out in a monorepo.

apps/web

This is the main Next.js application. It is the primary glue between our component library and Next.js. It is also the entrypoint for serving the application.

packages/components

The React components used to build our application. Acter uses Component Driven Develompment to build the application from the "bottom up" using smaller components incorporated into larger components. While not complete, some effort has been made to migrate the application to use Atomic Design principals. Smaller components use Material-UI to build larger functional pieces.

Components should use Storybook to visualize & test their look and behavior.

packages/lib

Pure Javascript/Typescript functions meant to encapsulate our business logic into small, testable functions.

packages/schema

Currently a combination of our Prisma schema, the output from TypeGraphQLPrisma, and our GraphQL queries, mutations, and fragments.

services/api

The Apollo GraphQL server used to serve both generated and custom resolvers. The API layer starts with GraphQL and the Apollo GraphQL client/server library. On the backend, the GraphQL resolvers use Prisma as an ORM for interactions with the database as well as database migrations. We use the TypeGraphQL Prisma integration to autogenerate types, which can be imorted via @acter/schema after running yarn generate.

services/jobs

Various asynchronous jobs like email notifications and daily digest creation

tools

Custom configuration, currently just for eslint.

Vendors

Github

We use Github for a code repository, and to run basic CI tests by way of Github Actions.

Heroku

Our applications and databases are hosted on Heroku. We currently have both a demo/dev instance as well as production.

Auth0

We use Auth0 for managing our authentication layer. It provides "authentication as a service" and a library for integrating with Next.js. Note that we use two different "tenants": one for production and one for demo & local.

Amazon AWS

We use Amazon AWS for the storage of images, both our static images and user-uploaded avatars and banners. Items live in S3 and are managed by IAM keys.

Google

We use the Google Maps & Places APIs for our mapping and places, respectively. Management of keys is done via the APIs and Services Credentials page for development and production).

Imgix

We use Imgix for image resizing. This was done because of bugs in Next.js' own image resize library and issues with performance on Heroku, though this should probably be revisited.

Sendgrid

We use Sendgrid for sending emails.

Sentry

We currently have Sentry monitoring our application for bugs and performance.

code's People

Contributors

birkskyum avatar dependabot[bot] avatar gottenborg avatar judemusyoki avatar jwj93 avatar lupescua avatar malik-shaik avatar martinandreev avatar orbiteleven avatar renovate[bot] 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.