An application for graduation project that has 2 main use-cases:
- User find parking lots
- Parking's owners and employees manage their parking
Any Github Page of this project except last release will be remove from Supabase Redirect URLs after 2 days
Before building, please ensure that Flutter is installed in your environment.
Flutter installation doc: Set up Flutter
In case you have Flutter already installed, make sure to get all the pubspecs and generate all the needed files:
flutter pub get && flutter pub run build_runner build --delete-conflicting-outputs
This project uses Supabase as the backend service. Therefore, you need to set up a Supabase project to run it on your own.
- Create a new Supabase project
- Navigate to the Auth settings and turn off the toggle next to "Enable email confirmations". (Note: this is only for testing. In production please enable this setting and set up your custom SMTP!)
- Navigate to the Supabase Vault and add all these
Enumerated Types
:
enum user_type {
user,
employee,
parkingOwner,
}
enum gender {
male,
female,
others,
}
enum ticket_status {
cancelled,
completed,
active,
paid,
created,
}
enum shift_type {
morning,
afternoon,
night,
other,
}
enum sort_by {
price,
distance,
}
enum sort_order {
asc,
desc,
}
- Navigate to the Supabase SQL Editor and add all sql to create EcoParking tables
- Navigate to the Supabase Integration and enable: Cron, GraphQL and Stripe Wrapper. (Note: Some integration need a key to connect)
- Inside Cron Jobs, link
update_ticket_status
function with schedule:*/10 * * * *
Add these API keys to your Supabase Vault with the exact name:
key | name |
---|---|
Stripe secret API key | ecoparking_stripe_api_key_id |
Google cloud Web Client ID | google_signin_web_client_id |
- Navigate to the Supabase SQL Editor and add all these function: EcoParking Supabase funtions
- Create your Mapbox map tiles and store the CARTO integration URL
- Create
.env
file in the main project's directory - Add all these envs:
MAPBOX_URL_TEMPLATE=
SUPABASE_PROJECT_URL=
SUPABASE_ANON_KEY=
STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=
- Navigate to the Supabase URL Configuration and the local url that you want to run to the Redirect URLs. Ex.
http://localhost:3000
- Web version
flutter build web --release --dart-define=STRIPE_PUBLISHABLE_KEY='' --dart-define=IS_RELEASE=TRUE --dart-define=RELEASE_TAG='' --dart-define=MAPBOX_URL_TEMPLATE='' --dart-define=SUPABASE_PROJECT_URL='' --dart-define=SUPABASE_ANON_KEY=''
- Build APK
flutter build apk --release --dart-define=STRIPE_PUBLISHABLE_KEY='' --dart-define=MAPBOX_URL_TEMPLATE='' --dart-define=SUPABASE_PROJECT_URL='' --dart-define=SUPABASE_ANON_KEY=''
- Navigate to the Supabase URL Configuration and the local url that you want to run to the Redirect URLs. Ex.
http://localhost:3000
Please make sure your running system environment has all of these value:
environment | description |
---|---|
MAPBOX_URL_TEMPLATE | Your Mapbox CARTO integration URL |
SUPABASE_PROJECT_URL | Your Supabase project's URL |
SUPABASE_ANON_KEY | Your Supabase project's annon key |
STRIPE_PUBLISHABLE_KEY | Your Stripe's publishable key |
STRIPE_SECRET_KEY | Your Strips's secret key |
For OAuth Signin, please add the URL to the Supabase Site URL and Supabase Redirect URLs