OrdSys is a web application designed to create, display, and manage order tickets for use in the kitchen and bar during various events held by the Uppsala Union of Engineering and Science Students. It is written in Python3 and Javascript using Django and PostgreSQL for the backend and React & Bootstrap for the frontend.
The application requires Python (version 3.8 or greater), Node.js (Version 16 or greater) by using nvm.
To begin, clone the repo and open the repository folder in your terminal.
On ubuntu, follow step 1 of this guide: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-22-04
On mac run brew install redis
- Run the command
source source_me.sh
to create and enter the virtual environment. - Update pip to the latest version
pip install --upgrade pip
. - Install the required Python dependencies with
pip install -r dev-requirements.txt
.
- Make sure you have the
virtualenv
andvirtualenvwrapper-win
packages installed on your system. If you don't, install them using$ pip install virtualenv
or$ pip install virtualenvwrapper-win
. - Create a new virtual environment with
$ mkvirtualenv venv
. This will create a virtual environment calledvenv
and automatically enter it. - Install the required Python dependencies with
(venv) $ pip install -r dev-requirements.txt
. If the versions are mis-matched, you may have to install each package ofdev-requirements.txt
manually.
- Create all required database tables, enter
./manage.py migrate
. - Create an organisation to associate your users with by running
./manage.py createorganisation
. - Create a superuser so that you can log in with
./manage.py createsuperuser
.
- Make sure you're in your virtual environment. If not, enter it using
source source_me.sh
- Start the server by typing
./manage.py runserver
.
The backend can now be accessed at http://localhost:8000/.
cd
tofrontend/
- Install the required dependencies using
$ yarn install
. - Run the frontend using
$ yarn start
. It should automatically open in your web browser. If not, you can open your web browser and browse to http://localhost:3000/.
Note: Running the frontend with start
launches it in development mode. To build and deploy to a production
environment, use $ yarn build
, and follow the appropriate steps at the
official guide.
For this repository there also exists a compose file meant to ease the setup of a development environment.
- You need to install Docker Engine
- You need to install Docker Compose
- Alternatively, on Ubuntu you should just need to install
docker.io
by runnningsudo apt install docker.io
To start using the compose file run the shell script run-dev.sh
with sudo supplying the flag init
incase you want to create a superuser and a new organisation.
Examples
sudo ./run-dev.sh init # prompts you for details to create user and org
sudo ./run-dev.sh # starts everything without prompting
To stop the development environment run docker compose down