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
- Rails 7
- Ruby 3
- Bootstrap
- Dockerfile and Docker Compose configuration
- PostgreSQL database
- Redis
- GitHub Actions for
- tests
- Rubocop for linting
- Security checks with Brakeman and bundler-audit
- Dependabot for automated updates
- Devise for authentication
- Different user access types (based on profile) (see access types in authentication docs)
- Authorization checks using Pundit
- Admin panel and privileges
- Institutions
- Classses
- Study Subjects
- Attendance tracking
- Exams (with types: physical, online) and scheduling in the future
- Grades
- Reports (in PDF, CSV or JSON), including overall information for institution and all data the institution's management would need.
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
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 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
Once the app has been set up you can just run it via one of the following commands:
docker compose up --build
Then just navigate to http://localhost:3000
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.
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
docker compose run --rm web rails c
docker compose run --rm web bundle
docker compose up --build
docker build -f production.Dockerfile .
This app can be hosted wherever Ruby is supported and PostgreSQL databases can be provisioned.
NOTE: You will need to generate a production secret with bin/rails secret
and set it as the SECRET_KEY_BASE
environment variable.