Hackathon base files
Welcome to this hackathon !
Here you will find files to start with your API using Scaleway servers and a simple mobile application with IONIC.
The repository is structured as follow:
.
│ README.md
│
└───api
│ │ ... // all the files for making an api on Scaleway using Terraform and NodeJs
│
└───app-example-angular
│ │ ... // all the files for mobile application using Angular framework
│
└───app-example-react
│ │ ... // all the files for mobile application using React framework
│
└───app-example-vue
│ ... // all the files for mobile application using Vue framework
API
Requirements
Required software / packages
Environment
-
Click on
Generate new API key
, you should seeAccess Key
andSecret Key
keep the window open -
Then run in a terminal:
export SCW_ACCESS_KEY="[ACCESS KEY]"
export SCW_SECRET_KEY="[SECRET KEY]"
export SCW_DEFAULT_ORGANIZATION_ID="[YOUR ORGANIZATION ID]"
Of course you replace [ACCESS KEY]
, [SECRET KEY]
and [YOUR ORGANIZATION ID]
by information previously provided by Scaleway console.
Install & start
-
Go into api folder
cd api
-
Then run:
terraform init && terraform apply
And type yes
when asked.
At the end of the process you should see Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
- That's it! You have now a new api created, you can access to it with the ip of your instance and port 3000 (ex: http://151.115.48.28:3000/)
To change your api behavior you can edit index.js
.
Mobile Application
Requirements
Required software / packages
For iOS build:
For Android build:
Install & start
-
Go to the folder of the framework you want (ex:
cd app-example-react
) -
Run
npm i
-
Finally run
ionic serve
, a new window will open with the application
Build on iOS
-
Run
ionic build
-
Then run
ionic capacitor build ios
-
Xcode should open with the app, you can now launch it on a simulator / your own device
Build on Android
-
Run
ionic build
-
Then run
ionic capacitor build android
-
Android Studio should open with the app, you can now launch it on a simulator / your own device
Error on Android Studio
Since Android 9 unsecured http request are not allowed with default configuration, to do so open AndroidManifest.xml and add this parameter:
<application android:usesCleartextTraffic="true">
</application>