Skip to content

Commit

Permalink
Bump Codebase & CI/CD support
Browse files Browse the repository at this point in the history
  • Loading branch information
app-generator committed Jan 27, 2023
1 parent 7ac7684 commit 2f44bae
Show file tree
Hide file tree
Showing 26 changed files with 503 additions and 163 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.pyc
*.DS_Store
*.egg*
/dist/
/.idea
/docs/_build/
/node_modules/
build/
env
/staticfiles/

#src
*.sqlite*

.env
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.9

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

COPY requirements.txt .
# install python dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

# running migrations
RUN python manage.py migrate

# gunicorn
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"]
244 changes: 81 additions & 163 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

Open-source **[Django Template](https://www.creative-tim.com/templates/django)** crafted on top of **Soft UI Dashboard**, a modern Bootstrap 5 design. Start your development with a modern Bootstrap 5 Admin template for Django. Soft UI Dashboard is built with over 70 individual components, giving you the freedom of choosing and combining. If you want to code faster, with a smooth workflow, then you should try this template carefully developed with Django, a well-known Python Framework.

> Features
<br />

> Features:
- Up-to-date [dependencies](./requirements.txt): **Django 3.2.6 LTS**
- [SCSS compilation](#recompile-css) via **Gulp**
- UI Kit: **Soft UI Dashboard** (Free Version)
- Django Codebase - provided by **[AppSeed](https://appseed.us/)**
- UI-Ready app, SQLite Database, Django Native ORM
- Modular design, clean code-base
- Session-Based Authentication, Forms validation
- Deployment scripts: Docker, Gunicorn / Nginx
-`Up-to-date Dependencies`
- ✅ Theme: [Django Admin Soft](https://github.com/app-generator/django-admin-soft-dashboard)
-**Authentication**: `Django.contrib.AUTH`, Registration
- 🚀 `Deployment`
- `CI/CD` flow via `Render`
- [Django Soft - Go LIVE](https://www.youtube.com/watch?v=1QVdQVSkUCI) - `video presentation`

<br />

![Django Soft UI Dashboard - Seed project generated by AppSeed.](https://s3.amazonaws.com/creativetim_bucket/products/541/original/soft-ui-dashboard-django.jpg)
[![Django Soft UI Dashboard - Seed project generated by AppSeed.](https://s3.amazonaws.com/creativetim_bucket/products/541/original/soft-ui-dashboard-django.jpg)](https://www.creative-tim.com/product/soft-ui-dashboard-django)

<br />

Expand All @@ -37,16 +37,6 @@ Open-source **[Django Template](https://www.creative-tim.com/templates/django)**

<br />

## Versions

[<img src="https://s3.amazonaws.com/creativetim_bucket/github/html.png" width="60" height="60" />](https://www.creative-tim.com/product/soft-ui-dashboard?ref=readme-sud)

| HTML |
| --- |
| [![Soft UI Dashboard HTML](https://s3.amazonaws.com/creativetim_bucket/products/487/thumb/opt_sdp_thumbnail.jpg)](http://demos.creative-tim.com/soft-ui-dashboard/pages/dashboard.html?ref=readme-sud)

<br />

## Demo

> To authenticate use the default credentials ***test / ApS12_ZZs8*** or create a new user on the **registration page**.
Expand All @@ -57,196 +47,103 @@ Open-source **[Django Template](https://www.creative-tim.com/templates/django)**

## Quick start

> UNZIP the sources or clone the repository. After getting the code, open a terminal and navigate to the working directory, with product source code.
> 👉 Download the code
```bash
$ # Get the code
$ git clone https://github.com/creativetimofficial/soft-ui-dashboard-django.git
$ cd soft-ui-dashboard-django
$
$ # Virtualenv modules installation (Unix based systems)
$ virtualenv env
$ source env/bin/activate
$
$ # Virtualenv modules installation (Windows based systems)
$ # virtualenv env
$ # .\env\Scripts\activate
$
$ # Install modules - SQLite Storage
$ pip3 install -r requirements.txt
$
$ # Create tables
$ python manage.py makemigrations
$ python manage.py migrate
$
$ # Start the application (development mode)
$ python manage.py runserver # default port 8000
$
$ # Start the app - custom port
$ # python manage.py runserver 0.0.0.0:<your_port>
$
$ # Access the web app in browser: http://127.0.0.1:8000/
```

> Note: To use the app, please access the registration page and create a new user. After authentication, the app will unlock the private pages.
<br />

## Documentation
The documentation for the **Soft UI Dashboard Django** is hosted at our [website](https://www.creative-tim.com/learning-lab/bootstrap/build-tools-free/soft-ui-dashboard).

<br />

## Code-base structure

The project is coded using a simple and intuitive structure presented bellow:
> 👉 Install modules via `VENV`
```bash
< PROJECT ROOT >
|
|-- core/ # Implements app configuration
| |-- settings.py # Defines Global Settings
| |-- wsgi.py # Start the app in production
| |-- urls.py # Define URLs served by all apps/nodes
|
|-- apps/
| |
| |-- home/ # A simple app that serve HTML files
| | |-- views.py # Serve HTML pages for authenticated users
| | |-- urls.py # Define some super simple routes
| |
| |-- authentication/ # Handles auth routes (login and register)
| | |-- urls.py # Define authentication routes
| | |-- views.py # Handles login and registration
| | |-- forms.py # Define auth forms (login and register)
| |
| |-- static/
| | |-- <css, JS, images> # CSS files, Javascripts files
| |
| |-- templates/ # Templates used to render pages
| |-- includes/ # HTML chunks and components
| | |-- navigation.html # Top menu component
| | |-- sidebar.html # Sidebar component
| | |-- footer.html # App Footer
| | |-- scripts.html # Scripts common to all pages
| |
| |-- layouts/ # Master pages
| | |-- base-fullscreen.html # Used by Authentication pages
| | |-- base.html # Used by common pages
| |
| |-- accounts/ # Authentication pages
| | |-- login.html # Login page
| | |-- register.html # Register page
| |
| |-- home/ # UI Kit Pages
| |-- index.html # Index page
| |-- 404-page.html # 404 page
| |-- *.html # All other pages
|
|-- requirements.txt # Development modules - SQLite storage
|
|-- .env # Inject Configuration via Environment
|-- manage.py # Start the app - Django default start script
|
|-- ************************************************************************
$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt
```

<br />

> The bootstrap flow
- Django bootstrapper `manage.py` uses `core/settings.py` as the main configuration file
- `core/settings.py` loads the app magic from `.env` file
- Redirect the guest users to Login page
- Unlock the pages served by *app* node for authenticated users

<br />

## Recompile CSS

To recompile SCSS files, follow this setup:

<br />

**Step #1** - Install tools

- [NodeJS](https://nodejs.org/en/) 12.x or higher
- [Gulp](https://gulpjs.com/) - globally
- `npm install -g gulp-cli`
- [Yarn](https://yarnpkg.com/) (optional)

<br />

**Step #2** - Change the working directory to `assets` folder
> 👉 Set Up Database
```bash
$ cd apps/static/assets
$ python manage.py makemigrations
$ python manage.py migrate
```

<br />

**Step #3** - Install modules (this will create a classic `node_modules` directory)
> 👉 Create the Superuser
```bash
$ npm install
// OR
$ yarn
$ python manage.py createsuperuser
```

<br />

**Step #4** - Edit & Recompile SCSS files
> 👉 Start the app
```bash
$ gulp scss
$ python manage.py runserver
```

The generated file is saved in `static/assets/css` directory.

<br />

## Deployment
At this point, the app runs at `http://127.0.0.1:8000/`.

The app is provided with a basic configuration to be executed in [Docker](https://www.docker.com/), [Gunicorn](https://gunicorn.org/), and [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/).
<br />

### [Docker](https://www.docker.com/) execution
---
## Documentation

The application can be easily executed in a docker container. The steps:
The documentation for the **Soft UI Dashboard Django** is hosted at our [website](https://www.creative-tim.com/learning-lab/bootstrap/build-tools-free/soft-ui-dashboard).

> Get the code
<br />

```bash
$ git clone https://github.com/creativetimofficial/soft-ui-dashboard-django.git
$ cd soft-ui-dashboard-django
```
## File Structure

> Start the app in Docker
Within the download you'll find the following directories and files:

```bash
$ sudo docker-compose pull && sudo docker-compose build && sudo docker-compose up -d
< PROJECT ROOT >
|
|-- core/ # Implements app configuration
| |-- settings.py # Defines Global Settings
| |-- wsgi.py # Start the app in production
| |-- urls.py # Define URLs served by all apps/nodes
|
|-- home/
| |
| |-- views.py # Serve HTML pages for authenticated users
| |-- urls.py # Define some super simple routes
|
|
|-- manage.py # Start the app - Django default start script
|-- requirements.txt # Development modules - SQLite storage
|
|-- ************************************************************************
```

Visit `http://localhost:85` in your browser. The app should be up & running.

<br />

## Browser Support

At present, we officially aim to support the last two versions of the following browsers:
> The bootstrap flow
<img src="https://s3.amazonaws.com/creativetim_bucket/github/browser/chrome.png" width="64" height="64"> <img src="https://s3.amazonaws.com/creativetim_bucket/github/browser/firefox.png" width="64" height="64"> <img src="https://s3.amazonaws.com/creativetim_bucket/github/browser/edge.png" width="64" height="64"> <img src="https://s3.amazonaws.com/creativetim_bucket/github/browser/safari.png" width="64" height="64"> <img src="https://s3.amazonaws.com/creativetim_bucket/github/browser/opera.png" width="64" height="64">
- Django bootstrapper `manage.py` uses `core/settings.py` as the main configuration file
- `core/settings.py` loads the app magic from `.env` file
- Redirect the guest users to Login page
- Unlock the pages served by *app* node for authenticated users

<br />

## Resources
## Deploy on [Render](https://render.com/)

- Demo: <https://www.creative-tim.com/live/soft-ui-dashboard-django>
- Download Page: <https://www.creative-tim.com/product/soft-ui-dashboard-django>
- Documentation: <https://www.creative-tim.com/learning-lab/bootstrap/build-tools-free/soft-ui-dashboard>
- License Agreement: <https://www.creative-tim.com/license>
- Support: <https://www.creative-tim.com/support>
- Issues: [Github Issues Page](https://github.com/creativetimofficial/soft-ui-dashboard-django/issues)
- Create a Blueprint instance
- Go to https://dashboard.render.com/blueprints this link.
- Click `New Blueprint Instance` button.
- Connect your `repo` which you want to deploy.
- Fill the `Service Group Name` and click on `Update Existing Resources` button.
- After that your deployment will start automatically.

At this point, the product should be LIVE.

<br />

Expand Down Expand Up @@ -291,5 +188,26 @@ If you have questions or need help integrating the product please [contact us](h

<br />

## [PRO Version](https://www.creative-tim.com/product/soft-ui-dashboard-pro-django)

This design is a pixel-perfect [Bootstrap 5](https://www.admin-dashboards.com/bootstrap-5-templates/) Dashboard with a fresh, new design concept. `Soft UI Dashboard PRO` is built with over 300 frontend individual elements, like buttons, inputs, navbars, nav tabs, cards, or alerts, giving you the freedom of choosing and combining.

> Features:
- `Up-to-date Dependencies`
- `Design`: [Django Theme Soft PRO](https://github.com/app-generator/django-admin-soft-pro) - `PRO Version`
- `Sections` covered by the design:
- **Admin section** (reserved for superusers)
- **Authentication**: `Django.contrib.AUTH`, Registration
- **All Pages** available in for ordinary users
- `Docker`, `Deployment`:
- `CI/CD` flow via `Render`

<br />

[![Django - Soft UI Dashboard PRO (premium starter by AppSeed & Creative-Tim](https://user-images.githubusercontent.com/51070104/215022735-dec8e82e-ea91-4494-a521-db421e8637be.png)](https://www.creative-tim.com/product/soft-ui-dashboard-pro-django)

<br />

---
[Soft UI Dashboard - Django Template](https://www.creative-tim.com/product/soft-ui-dashboard-django) - Provided by [Creative Tim](https://www.creative-tim.com/) and [AppSeed](https://appseed.us)
24 changes: 24 additions & 0 deletions README_deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# How to deploy on `Render`

> This document should contains all the steps to deploy the app on render without much effort, using PostgreSQL
https://render.com/docs/deploy-django

## ALL STEPS below

<br />

### 👉 Create `PostgreSQL` database on render
- Go to https://dashboard.render.com/new/database this link.
- Database name should be `berry`.
- Keep the Database, User and Datadog API Key as it is.
- If you want to change database name anything else then you have to change your `render.yaml` file database name too.

<br />

### 👉 Create a Blueprint instance
- Go to https://dashboard.render.com/blueprints this link.
- Click `New Blueprint Instance` button.
- Connect your `repo` which you want to deploy.
- Fill the `Service Group Name` and click on `Update Existing Resources` button.
- After that your deployment will start automatically.
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# exit on error
set -o errexit

python -m pip install --upgrade pip

pip install -r requirements.txt

python manage.py collectstatic --no-input
python manage.py migrate
Empty file added core/__init__.py
Empty file.
Loading

0 comments on commit 2f44bae

Please sign in to comment.