/manageR

A system for managing learning institutions written in Rails 7.

Primary LanguageRuby

manageR™ - manage your institution the correct way! Ruby

This app is a comprehensive school management system using Rails 7 with PostgreSQL, import maps, turbo, stimulus, bootstrap and hotwire, all running in Docker. The base template of the application can be found at Shannarra/rails7template

Features

Requirements

Please ensure you are using Docker Compose V2. This project relies on the docker compose command, not the previous docker-compose standalone program.

https://docs.docker.com/compose/#compose-v2-and-the-new-docker-compose-command

rails g scaffold Subject name:string year:integer description:string teacher:references klass:references

Check your docker compose version with:

$ docker compose version
Docker Compose version v2.20.2

Development setup

Please, make sure that you have turned your postgresql service off or you will be greeted with an error message saying that port 5432 is taken.
You can do that by running the command sudo systemctl stop postgresql

You can just run the startup.sh script:

sh ./startup.sh --run

This will bootstrap the application with sample data and profiles with different authorizations. Please, note that Registering endpoints are disabled intentionally (see Usage)

Since this operation will seed the database with several thousand items and their relations, the initial setup can be slow, but seeding will provide useful feedback in the console.

Alternatively, if you can't run the shell script, you can bootstrap the application yourself by running the following few commands:

# make sure the binaries of the project have the privileges to work as expected
chmod u+x -R ./bin/*

# copy/rename the environment variables file
cp .env.example .env

# build the initial containers
docker compose build

# setup the database, including migrations and seeding
docker compose run --rm web rails db:setup

Usage

Once the app has been set up you can just run it via one of the following commands:

Running the app

docker compose up --build

Then just navigate to http://localhost:3000

First time logging in

When logging in for the first time, please read the first time logging in docs if you are confused on how to use the system.

I would also suggest you go through the entire documentation folder if you want a crash course on how to use the system.

Running the Rails console

When the app is already running with docker-compose up, attach to the container:

docker compose exec web bin/rails c

When no container running yet, start up a new one:

docker compose run --rm web bin/rails c

Running tests

docker compose run --rm web rails c

Updating gems

docker compose run --rm web bundle
docker compose up --build

Production build

docker build -f production.Dockerfile .

Deployment

This app can be hosted wherever Ruby is supported and PostgreSQL databases can be provisioned.

Render

Deploy to Render

NOTE: You will need to generate a production secret with bin/rails secret and set it as the SECRET_KEY_BASE environment variable.

Credits/References

Rails with Docker

Rails 7 with importmaps

Rails 7 with hotwire