bh-coders / trip-planer

Mobile, Web and Rest API
5 stars 0 forks source link

Trip Planer

Mobile, Web and Rest API

Resources and Links

Development

1. Backend

Configuration

In our project, we use a configuration file that loads environment variables. This allows us to interact with them. The configuration file is located at:

src/web/core/configs.py

Initializing Environment Variables

We can initialize environment variables using the EXPORT command or by creating a .env file based on the .env.template.

Example of initializing an environment variable:
export POSTGRES_HOST=jp2
The .env File

To create a .env file, copy the .env.template and fill in the values:

POSTGRES_HOST=
POSTGRES_PORT=
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=

SECRET_KEY=
ALGORITHM=
ACCESS_TOKEN_EXPIRE_MINUTES=

MINIO_HOST_URL=
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
MINIO_SECURE=

Start application

There are two methods to start our application:

1. Using Uvicorn:

To start the application with Uvicorn, use the following command:

uvicorn src.main:app --host 0.0.0.0 --port 80 --reload

2. Using Docker-compose

Ensure you are in the root directory (e.g., trip-planner). Docker Compose can be used for rebuilding and launching the application. Execute the command below:

docker-compose up -d --build

2. Frontend

To run the frontend in a developer environment, you should install the following:

For web:

For Android: All the requirements mentioned for the web, and additionally:

For iOS:

To start, run the following command:

npm start

Then, choose the desired option from the Expo menu.

If cannot find android SDK

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools

If you have error with local.properties:

android/local.properties


sdk.dir = /Users/<your_name>/Library/Android/sdk