/backend
- The Django backend API server./frontend
- The React web app frontend.
- React
- Django
- Django Quick Tutorial Example
- Building a React.js Application using Django REST Framework
- dbdiagram.io - Visualize dbml Files
- Caddy
- Postman Testing requests to backend & other external API's
- SQLite Browsing data in database
- Signal E2e private messenger for sending/receiving secret tokens
- Node.js 18
- Python 3.11
- Caddy
- Poetry (will be installed automatically)
To install Caddy:
- For Windows, a copy of
caddy.exe
is already included for easy development. - On Linux and macOS, install Caddy through your package manager.
- You can also download it manually from Caddy's website if you prefer.
Now run the following: (replace python
with whatever command you use for Python 3)
python setup.py
You only need to run setup.py
once after first cloning the repo or after pulling the latest changes (when dependencies or the DB model have changed).
If everything succeeded, you can now start the app any time with:
node run.js
By default the app will run on http://localhost:8080
To create an account for the Django admin console, run py setup.py admin
and enter a username and password.
Our project will use a .env
file that contains different variables and secrets that will be used for both development and production.
Contact @NoahCardoza#3669 for more info regarding the Google client_id and secrets, .
-
Development
- Copy the sample
.env.example
file to.env
in the/backend
and/frontend
directories. - For
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
values- Install Signal Messenger.
- Talk with @NoahCardoza#3669 for the values which will be sent to you via Signal.
- For the
AMADEUS_CLIENT_ID
andAMADEUS_CLIENT_SECRET
values, register at amadeus.com. - For the
HOTELBEDS_CLIENT_ID
andHOTELBEDS_CLIENT_SECRET
values, register at hotelbeds.com.
- Copy the sample
-
Production
- Follow development instructions above.
- Set
POSTGRES_*
variables in/backend/.env
to the production database credentials.
To emulate production mode (will run on port 80) without Docker:
cd frontend
npm run build
cd ..
node run.js production
If you are using VSCode, you can simply copy .vscode/settings.example.json
to .vscode/settings.json
and install the recommended extensions
inside .vscode/extensions.json
.
Use the following command to spin up all the containers:
docker-compose up
NOTE: You can run these following commands in parallel in another terminal.
If it's your first time, you'll need to apply the migrations:
docker compose run backend python manage.py migrate --run-syncdb
docker compose run backend python manage.py createsuperuser
If you install any dependencies in the backend, you'll need to rebuild the image:
docker compose build backend
If you make any changes to the frontend, you'll need to run it again:
docker compose up frontend