Compare commits

...

5 Commits

Author SHA1 Message Date
Linden Crandall
02a9c3c629 added todo 2023-06-20 16:15:58 +09:00
Linden Crandall
7b9a9730aa added windows cmds 2023-06-20 16:13:37 +09:00
Linden Crandall
6c9e7d4b60 added windows cmds 2023-06-20 16:12:37 +09:00
Linden Crandall
76355136ea updated readme for local android setup 2023-06-20 15:50:25 +09:00
Linden Crandall
d4ae61bc6a installing react-native 2023-06-20 15:47:00 +09:00
6 changed files with 58 additions and 21 deletions

View File

@ -68,7 +68,6 @@ to create the DB schemas locally
) )
*** CREATING NEW PROJECT (alreay completed, leaving for notes)*** *** CREATING NEW PROJECT (alreay completed, leaving for notes)***
create new Django project (make sure you are in dir you want project to be created): create new Django project (make sure you are in dir you want project to be created):
@ -86,9 +85,16 @@ create your own admin superuser:
- start Django dev server: - start Django dev server:
- set env DEV_MODE variable: - set env DEV_MODE variable:
DEV_MODE=True DEV_MODE=True
- start Django dev server in terminal: - start Django dev server in terminal:
DJANGO_SETTINGS_MODULE=main_project.dev_settings python manage.py runserver - linux:
`DJANGO_SETTINGS_MODULE=main_project.dev_settings python manage.py runserver`
- windows (command prompt):
`set DJANGO_SETTINGS_MODULE=main_project.dev_settings&& python -m manage runserver`
- windows (powershell):
`$env:DJANGO_SETTINGS_MODULE = "main_project.dev_settings"; python -m manage runserver`
you should be able to access backend admin portal at you should be able to access backend admin portal at
127.0.0.1:8000/api/admin 127.0.0.1:8000/api/admin
@ -128,11 +134,9 @@ To run vs code debugger:
In main_project folder, create .env file In main_project folder, create .env file
add these env vars: add these env vars:
DEV_DOMAIN=http://127.0.0.1:8000 DEV_DOMAIN=http://127.0.0.1:8000
DEV_MODE=True DEV_MODE=True
If you were preveiously in production mode, stop all nginx and gunicorn servers and open If you were preveiously in production mode, stop all nginx and gunicorn servers and open
your browser's dev tools and clear all cache and cookie data: your browser's dev tools and clear all cache and cookie data:

View File

@ -13,7 +13,16 @@ DEV_MODE=True
(if you haven't set up these servers yet, you can ignore the rest of the steps and just run: (if you haven't set up these servers yet, you can ignore the rest of the steps and just run:
DJANGO_SETTINGS_MODULE=main_project.dev_settings python manage.py runserver DJANGO_SETTINGS_MODULE=main_project.dev_settings python manage.py runserver (linux)
or
set DJANGO_SETTINGS_MODULE=main_project.dev_settings&& python -m manage runserver (windows cmd)
or
$env:DJANGO_SETTINGS_MODULE = "main_project.dev_settings"; python -m manage runserver (windows powershell)
) )

View File

@ -1,18 +1,18 @@
# react native app setup (not using Expo) # react native app setup (not using Expo)
# REACT NATIVE CLI QUICKSTART, NOT EXPO GO QUICKSTART
# follow setup guide for each specific platform (iOS or Android) and OS (Linux, Windows, MacOS): https://reactnative.dev/docs/environment-setup # REACT NATIVE CLI QUICKSTART (NOT EXPO GO) QUICKSTART
# follow setup guide for each specific platform (iOS or Android) and OS (Linux, Windows, MacOS): [https://reactnative.dev/docs/environment-setup](https://reactnative.dev/docs/environment-setup "setup")
- make sure you have node and npm installed - make sure you have node and npm installed
- cd to directory where you want this app to be installed - cd to directory where you want this app to be installed
- create app: - create app (already accomplished, keeping for notes):
npx react-native@latest init SelahReactNativeApp `npx react-native@latest init SelahReactNativeApp`
- select yes for installing react-native packages - select yes for installing react-native packages
NOTE: some of the files might complain about not being able to detect the babel.config.js file. Add this to your NOTE: in VS Code some of the created files might show errors and complain about not being able to detect the `babel.config.js` file. Add this to your settings.json file in VS Code (Open command pallete: View-> Command Pallete or Ctrl+Shift-P and type "settings"):
settings.json file in VS Code (Open command pallete: View-> Command Pallete or Ctrl+Shift-P and type "settings"):
``` ```
"eslint.workingDirectories": [ "eslint.workingDirectories": [
@ -20,10 +20,27 @@ settings.json file in VS Code (Open command pallete: View-> Command Pallete or C
] ]
``` ```
- to run the app, open a new terminal and start Metro which is the js bundler that ships with react native. cd into Run the app (Android emulator)
react-native app directory and run:
npx react-native start - make sure your android emulator is running (running API 33 tiramisu per the react-native setup docs)
- start Metro which is a js bundler that ships with react native. cd into react-native app directory and run:
- to start the app in an android device `npx react-native start`
select yes to install react-native packages
- let metro run in its own terminal. Open a new terminal to start the app in an android device:
`npx react-native run-android`
NOTE: if you get a `error: unknown command 'run-android'` try this command
`npm install --save react-native`
and try again:
`npx react-native run-android`
You should have a running react-native app in Android!
TODO: mac/iOS local setup...

View File

@ -3,7 +3,14 @@
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<!-- add
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
fields to appplication tag below and add mipmap
folders to
/android/app/src/main/res/
when icons are created
-->
<application <application
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
tools:targetApi="28" tools:targetApi="28"

View File

@ -9,7 +9,7 @@
"version": "0.0.1", "version": "0.0.1",
"dependencies": { "dependencies": {
"react": "18.2.0", "react": "18.2.0",
"react-native": "0.71.11" "react-native": "^0.71.11"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.20.0", "@babel/core": "^7.20.0",

View File

@ -11,7 +11,7 @@
}, },
"dependencies": { "dependencies": {
"react": "18.2.0", "react": "18.2.0",
"react-native": "0.71.11" "react-native": "^0.71.11"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.20.0", "@babel/core": "^7.20.0",