Find out more about strategy for building multiple versions of your application
Apps come in all shapes and sizes. You can build for the web, mobile, or tablets. You should pick the format based on whatever makes the most sense for your product. If your app idea requires users to log in while on-the-go, then mobile makes more sense than web. If your app is fairly complex and requires a lot of detail, and no need for mobility of user, maybe the web is best.
A web app can be used on a mobile device (once it's optimized for mobile), but a native mobile app has functionality that a web app won't. Push notifications, for example, can only be sent to a user's phone if the application is a native mobile app.
If your product requires a mobile & web app both, then a general rule of thumb is to start with mobile. It’s harder to design for small screens, and certain UI interactions we take for granted on web (e.g. mouse over) don’t work on mobile. So it's usually better to design for the more constrained device first.
Databases (and associated APIs) are common to all types of apps. That’s the “modern model” of how apps are built: a client app (web or mobile) that’s loosely coupled to an API backend (Django, in our case).
How can I deploy my web app onto the Crowdbotics server for hosting?
Push deploy on dashboard, and it’ll deploy the material in the Django folders automatically.
If you're working with a separate build altogether, follow these steps:
1. Add/Create React app under root
2. in Dockerfile, add this command
2. in Dockerfile, add this command
RUN npm install && npm audit fix && npm run build
after line RUN pipenv install --deploy --system
3. in settings.py,
- add ‘DIRS’: [os.path.join(BASE_DIR, ‘build’)] in TEMPLATES
- make sure STATICFILES_DIRS = [os.path.join(BASE_DIR, ‘build/static’)]
- make sure STATIC_ROOT = os.path.join(BASE_DIR, ‘static’)
4. in urls.py, add below lines at the end file:
- urlpatterns += [path(‘’, TemplateView.as_view(template_name=‘index.html’))]
- urlpatterns += [
re_path(r”^(?:.*)/?$“,
TemplateView.as_view(template_name=‘index.html’))
]
after line RUN pipenv install --deploy --system
3. in settings.py,
- add ‘DIRS’: [os.path.join(BASE_DIR, ‘build’)] in TEMPLATES
- make sure STATICFILES_DIRS = [os.path.join(BASE_DIR, ‘build/static’)]
- make sure STATIC_ROOT = os.path.join(BASE_DIR, ‘static’)
4. in urls.py, add below lines at the end file:
- urlpatterns += [path(‘’, TemplateView.as_view(template_name=‘index.html’))]
- urlpatterns += [
re_path(r”^(?:.*)/?$“,
TemplateView.as_view(template_name=‘index.html’))
]
Next, you can deploy the React web app using the Deploy button on your Crowdbotics Dashboard. The web url convention is:
https://appname-appid.botics.co/
You do not need to push the built web app into the repository since the web app is built on the server.