unstructuredstudio / zubhub

Creative Education Platform
https://unstructured.studio/zubhub
GNU Affero General Public License v3.0
50 stars 165 forks source link
creativity education making

CI/CD

Intro

ZubHub is an open-source, documentation & collaboration tool for activity-based learning. It is available for custom use for schools, libraries, hackerspaces, educational organizations, etc. Imagine your own online community built around your educational activities! 

Zubhub is designed and developed by Unstructured Studio. We are an educational non-profit organization incorporated in Canada and India. We have our own ZubHub and we use it to expand access to low-cost creative learning opportunities to children and educators. On our ZubHub, children, and educators can get inspired by a collection of activity ideas and projects, learn how to build with the materials and tools that they already have access to, and share their creations with others. Some of the primary features are creator portfolios, community-curated projects, discussion-based collaboration, and workshops. ZubHub takes inspiration from the research conducted on the Build In Progress platform at the MIT Media Lab. :smiley:

ZubHub is currently in public beta. A public ZubHub instance is hosted here: https://zubhub.unstructured.studio

Want to know more about ZubHub and our feature roadmap? Head to 👉 ZubHub Wiki!

screenshot

Development Setup

Follow the instructions below to set up your local development environment

Steps

  1. Install Git. ( jump to section )
  2. Fork and clone zubhub repository. ( jump to section )
  3. Install docker. ( jump to section )
  4. Install docker-compose. ( jump to section )
  5. Install Node.js 14 and npm 7 or later. ( jump to section )
  6. Install make. ( jump to section )
  7. Setup Backend. ( jump to section )
  8. Setup Frontend. ( jump to section )
  9. Tests
  10. Making changes and Commiting



Windows Specific Setup

git config --system --unset core.autocrlf
git config --global core.autocrlf false

You can use git config -l to verify that the value for core.autocrlf is correctly set.



Install Git

NOTE: You can skip this step if you already have git installed on your machine. To check if git is running on your machine, run the following command git --version.



Fork and clone Zubhub repository

      $ git clone <copied url>

The copied URL will have the format of https://github.com/<your github username>/zubhub.git



Install Docker

NOTE: You can skip this step if you already have docker installed on your machine. To check if docker is running on your machine, run the following command docker --version.



Install Docker Compose

NOTE: You can skip this step if you already have docker-compose installed on your machine. To check if docker-compose is running on your machine, run the following command docker-compose --version.



Install Node and NPM

NOTE: You can skip this step if you already have node and npm installed on your machine. To check if node and npm are already installed on your machine, run the following command node --version and npm --version.



Install Make

NOTE: You can skip this step if you already have make installed on your machine. To check if make is running on your machine, run the following command make --version.



Setup Backend

NOTE: For windows users, before running the commands below switch to bash (available through WSL), you can achieve that by typing bash to your command line.

       $ cd ./zubhub_backend
       $ make init

This will run all the initial setups required and start the server, generate the minimal .env file required to run the backend, spins-up all containers defined in the backend docker-compose file, applies all necessary migrations to the database, and creates a default admin user with username and password of dummy and dummy_password respectively.

In case you're facing issues after running the above, like make: Error, kindly run this before the above command:

       $ docker-compose up

Subsequently, to start and stop the docker containers, you run the following

To start:

       $ make start

To stop:

       $ make stop
       $ make down

You can run test by running make test. For other make commands: run make help

Visit http://localhost:8000 on your browser to access the API documentation.



Setup Frontend

#.env
REACT_APP_NODE_ENV=developement
REACT_APP_BACKEND_DEVELOPMENT_URL=http://127.0.0.1:8000

Using npm

This is advisable for a better development experience.

Using the Docker Container

Use this when you are done with making your changes and you want to test your code on the Docker container.

Visit localhost:3000 on your browser to access the frontend.



Tests

Before you get started making changes and commiting, you should setup pre-commit on your development machine:

To verify that your setup was successful, run pre-commit in the root of your cloned zubhub repo. You should see this running a number of checks.

Frontend

You can also test the frontend seperately by going to the root of the frontend project (the place you have package.json) and running npm run test -- --coverage --watchAll=false

Backend

To test the backend seperately,

Making changes and Commiting

Before making changes, make sure that you've set up pre-commit as described in the previous step. After that just git add . and git commit your changes. pre-commit will automatically run the different tests and will fail to commit until you fix all the errors.

NOTE: If you fail to setup pre-commit on your local machine before making pull requests, our pre-commit action on github will run the same tests on your code and if it fails to pass, your code won't be merged.

Deployment

ZubHub is currently deployed on its main website using Github Actions that act as our build and deployment tooling. If you are interested in deploying Zubhub on your VM for testing and hosting purposes, follow the Single VM Deployment instructions.



API Documentation



Contributions

Contributions are welcome! We suggest you first go through the Contribution Guidelines and Code of Conduct and the Feature Roadmap and Ideas we have been working on. Search the Issues to see there are no duplicates or overlaps before filing new feature requests and bugs.

NOTE: If you are interested in the API documentation instead, you need to follow the instructions above about running the backend on your local machine and afterward visit localhost:8000 on your browser to view the API documentation.