This project/venture was started by my family and I during the COVID-19 lockdown period. We have identified some Grocery vendors who are going out of business and are connecting them to consumers in apartments and other communities. We currently fulfill about 500+ orders per day in Bangalore, India and have about 50+ items in our inventory. We homedeliver fresh, organic fruits vegetables and other items at very competitive prices. As this project was done during my pursual of the Full Stack Developer Nanodegree on Udacity, I decided to submit the same as the capstone. The project is entirey constructed from FLASK with Auth0 serving as the Login Manager. The website can be found here.
Follow instructions to install the latest version of python for your platform in the python docs
We recommend working within a virtual environment whenever using Python for projects. This keeps your dependencies for each project separate and organized. Instructions for setting up a virtual environment for your platform can be found in the python docs
Once you have your virtual environment setup and running, install dependencies by navigating to the project directory and running:
pip install -r requirements.txtThis will install all of the required packages we selected within the requirements.txt file.
-
Flask is a lightweight backend microservices framework. Flask is required to handle requests and responses.
-
SQLAlchemy is the Python SQL toolkit and ORM we'll use handle the lightweight sqlite database. You'll primarily work in app.py and can reference models.py.
-
Flask-CORS is the extension we'll use to handle cross origin requests from our frontend server.
From within the project directory first ensure you are working using your created virtual environment.
To run the server, execute:
export FLASK_ENV=development
flask runSetting the FLASK_ENV variable to development will detect file changes and restart the server automatically.
To run the sample, make sure you have python and pip installed.
Rename .env_example to .env and populate it with the client ID, domain, secret, callback URL and audience for your
Auth0 app. If you are not implementing any API you can use https://YOUR_DOMAIN.auth0.com/userinfo as the audience.
Also, add the callback URL to the settings section of your Auth0 client.
Register http://localhost:3000/callback as Allowed Callback URLs and http://localhost:3000
as Allowed Logout URLs in your client settings.
Run pip install -r requirements.txt to install the dependencies and run python server.py.
The app will be served at http://localhost:3000/.
To run the sample, make sure you have docker installed.
To run the sample with Docker, make sure you have docker installed.
Rename the .env.example file to .env, change the environment variables, and register the URLs as explained previously.
Run sh exec.sh to build and run the docker image in Linux or run .\exec.ps1 to build
and run the docker image on Windows.
Auth0 helps you to:
- Add authentication with multiple authentication sources, either social like Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, among others,or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider.
- Add authentication through more traditional username/password databases.
- Add support for linking different user accounts with the same user.
- Support for generating signed JSON Web Tokens to call your APIs and flow the user identity securely.
- Analytics of how, when and where users are logging in.
- Pull data from other sources and add it to the user profile, through JavaScript rules.
- Go to Auth0 and click Sign Up.
- Use Google, GitHub or Microsoft Account to login.
This project uses a SQLite DB locally to build and test quickly and uses Postgres on Heroku. Within the project folder in terminal run:
python
>>> from app import import_db
>>> import_db()To run the tests, run
dropdb nimblebuy_test
createdb nimblebuy_test
python test.pyThis app is deployed on heroku and can be found here. It is currently running on Hobby Dynos.
To host your app follow these steps -
- Create a
Procfilein the project directory. - Inside the Procfile put the following
web: gunicorn app:app
- Push the entire project to GIT
- Go to Heroku and create a new app
- Link your Github account on heroku
- Link the project Github repo in the Heroku App Settings
- Configure it for auto deployment
- In Heroku App Setting, copy all the
.envfile contents. - Add a hobby dev Postgres server from Heroku addons


