Welcome to the Intropoints repository. This repository includes the application that can be used to set up an online scavenger hunt. The application can be used to create Tournaments and Teams of Users for these Tournaments. Challenges can be created for each Tournament. The Challenges can be solved by the Teams by uploading a photo after which an administrator needs to approve (or decline) a Submission for a Challenge. If a Submission is approved, the Challenge is closed for that Team and points are awarded.
This project is built using both Django (for the backend) and VueJS (for the frontend). Both need to be set up (and connected) for development to work.
- First install at least Python 3.11 on your system.
- If
pip3is not installed on your system, executeapt install python3-pipto install it. - Also make sure
python3-devis installed on your system, executeapt install python3-dev. - Install Poetry by following the steps on
their website. Make sure
poetryis added toPATHbefore continuing. - Clone this repository.
- Go to the
backenddirectory. - Run
poetry installto install the backend dependencies. - Run
poetry shellto start a shell with the dependencies loaded. This command needs to be run every time you open a new shell and want to run the development server. - Go to the
websitedirectory. - Run
./manage.py migrateto initialize the database and load all migrations. - Run
./manage.py createsuperuserto create an administrator user. - Run
./manage.py runserverto start the development server locally.
Now your backend server is set up and running on localhost:8000. The administrator interface can be accessed by going
to localhost:8000/admin.
- Install at least version 17 of NodeJS.
- Clone this repository (or if you have done that in the previous steps, skip this step).
- Go to the
frontenddirectory. - Use
npm installto install the required packages. - Use
npm run devto run the development server.
Now that both the frontend and the backend server are up and running, we need to supply the frontend with credentials such that it can connect to the backend service.
- Log in on the administrator dashboard of the backend by going to
localhost:8000/adminand logging in with your administrator account. - Under
Django OAuth Toolkit, add anApplication. - Provide the following settings:
- Redirect uris: http://localhost:5173/auth/callback
- Client type: Public
- Authorization grant type: Implicit
- Name: VueJS Frontend
- Skip Authorization: True
- Before saving the application, make sure to copy over the Client ID and Client Secret to some other location.
- Now save the application.
- Create a
.envfile in thefrontendfolder of the repository. The.envfile should have the following content:
VITE_API_BASE_URI=http://localhost:8000
VITE_API_AUTHORIZATION_ENDPOINT=/oauth/authorize/
VITE_API_ACCESS_TOKEN_ENDPOINT=/oauth/token/
VITE_API_OAUTH_CLIENT_ID=[Client ID you copied over]
VITE_API_OAUTH_CLIENT_SECRET=[Client Secret you copied over]
VITE_API_OAUTH_REDIRECT_URI=http://localhost:5173/auth/callback
VITE_API_LOGOUT_URL=/users/logout
VITE_DEBUG=true
- Reload the development server (
npm run dev) and you are good to go :)!