Code Monkey home page Code Monkey logo

compass's Introduction

🧭 Project Compass

Compass is a tool to help educators create and manage Individualized Education Programs (IEPs) for better student outcome.

Useful resources:

Contributing to our code base

One time setup

  1. Install Docker Desktop

  2. Clone the GitHub repo:

    • Windows users (do this first before checkout) : make sure to run git autocrlf setting is set to false so that carriage return characters are not inserted into files (which breaks them when they run inside the Linux container). To do so, open a Powershell and run: git config --global core.autocrlf false
    cd <parent folder of compass>
    git clone https://github.com/sfbrigade/compass.git
    cd compass
  3. Create the local server env file:

    cp .env.example .env.local

Running Compass

There are two ways to run Compass locally:

Option 1: Run server locally, and supporting services in Docker

  1. Install node dependencies, starting in the compass directory

    npm install           # install dependencies
  2. Start services in Docker & reset the database

    docker compose -f supporting_services/docker-compose.yml up -d  # start the services in the background
    npm run db:reset      # reset and migrate the database
  3. Start the server

    npm run dev           # start the server in development mode

    Server URL: http://localhost:3000

    NOTE: If you get into a login loop, double check that the Docker services are running

Option 2: Run both server and supporting services locally

  1. One time setup:
  • Install and configure Postgres:
    • install using pgAdmin 4, Homebrew, or any other method
    • create a username and password on the Postgres server
    • update the DATABASE_URL in .env.local to include your actual <username> and <password>:
      DATABASE_URL=postgres://<username>:<password>@localhost:5432/compass
      
  • Install MinIO, an open source S3-compatible storage server:
    • follow their guide for macOS or Windows
    • after installing and starting the MinIO server, make sure to create a new bucket and update the S3_USER_UPLOADS_BUCKET_NAME in .env.local to match the name of the bucket you created:
      S3_USER_UPLOADS_BUCKET_NAME=<bucket-name>
      
  1. Install dependencies, starting in the compass directory

    npm install           # install dependencies
  2. Reset the database and bring up the server

    npm run db:reset      # reset and migrate the database
    npm run dev           # start the server in development mode

    Server URL: http://localhost:3000

Authentication

.env.local file will need to be updated for sign in with Google

To update GOOGLE_CLIENT_ID:

  • Navigate to Google Cloud
  • Create a "Client ID for Web application"
  • Populate the fields as below (note the name and authorized redirect URIs fields) alt text
  • Copy the client ID field on the upper right of the modal (not shown in screenshot), after creation

To update GOOGLE_CLIENT_SECRET:

  • Copy the google client secret after creation of the client id

Running tests

The database container does not need to be started to run tests, but Docker Desktop must be running in the background.

Run all tests with npm run test. An individual test file can be run with npm run test <path/to/file> (e.x. npm run test src/routes/students.test.ts).

To run tests in watch mode, use npm run test:watch. This will run tests whenever a file is changed, but will not take database schema changes into account.

Database

Creating migrations

Until Compass is deployed, the initial migration file at src/api/db/migrations/1_initial-migrations.sql should be edited. Once Compass is deployed, new migrations can be created in the same directory by adding 1 to the number of the last migration file.

Running migrations

Run npm run db:migrate to migrate the database. However, until Compass is deployed, you'll more likely want to run npm run db:reset to reset the database since we'll be making changes to the initial migration file.

Troubleshooting

Compass app is not running:

Make sure that Docker is running in the background

Client id is required:

Fill out the Google Client ID and Google Client Secret in .env.local

Tech stack & libraries

compass's People

Contributors

codetheweb avatar amantri avatar hieungo89 avatar tessathornberry avatar jonahchoi avatar bretteastman avatar hannahmcg avatar kccpmg avatar katconnors avatar beeseewhy avatar nickvisut avatar code4dopamine avatar francisli avatar justinj108 avatar keshao728 avatar mattpereira avatar kotovsyndrome avatar shin101 avatar patrickwchoi avatar amreetkumarkhuntia avatar markofosu avatar seldomseenschweig avatar j-h-li 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.