This base project includes my usual concoction for web apps:
- Python 3
- Django 2.0
- Typescript + TSLint
- React
- Postgres
- Virtualenv
- Yarn
- Node.js
- Webpack 4
Note that you'll have to have the aforementioned technologies (except for React) installed already.
git clone https://github.com/chelseavalentine/django-typescript-react-base
cd django-typescript-react-base
./setup.sh [your project name here]
cd .. && cd [your project name here]
Install Postgres if needed:
brew install postgres
echo 'alias pg-start="brew services start postgresql"' >> ~/.bash_profile
echo 'alias pg-stop="brew services stop postgresql"' >> ~/.bash_profile
- Start the Postgres server:
pg-start
- Create the Postgres database and user:
createdb [dbname]
createuser --inherit root --login --pwprompt
Check the users that your database has:
psql postgres
postgres=# \du
- Populate
[your project name]/.env
with your database details - Edit the package.json with further details if you wish (e.g. repository link, author, etc.)
Anyone can setup their local dev environment by:
- Creating and activating the virtual environment using Python 3:
virtualenv venv -p python3
source venv/bin/activate
pip3 install -r requirements.txt
pip3 install -r requirements-local.txt
To launch the project,
- Run the hot reloading development server
node dev-server.js
./manage.py runserver
- Visit http://localhost:8000.
To lint files: npm run lint
Before deployment, remember to do: ./manage.py collectstatic