Starting a new project

Verze:

04. 04. 2022

Zodpovědná osoba:

Rafael Quinteros

Poslední aktualizace:

31. 03. 2026, rafael.quinterosv@gmail.com

Introduction

This document describes the standard process for setting up a new client project based on a Demoweb template. The process involves creating a GitLab repository, copying the template files, importing the database, and configuring the Nette environment. Following this process ensures every client project starts from a consistent, tested base.

Available Templates

Before starting, identify which template the client project requires:

Template GitLab Repository Adminer Database
Demoweb Services demoweb/template-services tempservice_14
Demoweb Eshop demoweb/template-eshop tempeshop_14

All subsequent steps — downloading the ZIP and exporting the database — depend on this choice. Use the correct repository and database for your template throughout the process.

Basic Structure

1. GitLab Setup → 2. Copy Template Files → 3. Database Setup → 4. Configure config.neon

Each phase must be completed in order.

Phase 1 — Create the Project in GitLab

Before copying any files, the GitLab repository must exist.

1. Go to https://aja07.vas-server.cz
2. Create a new project for the client
3. Clone the empty repository into your local projects folder:
git clone git@aja07.vas-server.cz:clients/<client-name>.git
cd <client-name>

The folder will be empty at this point. That is expected.

Phase 2 — Copy Template Files

2.1 Download the Demoweb Template

Go to the corresponding repository in GitLab at https://aja07.vas-server.cz and download it as a .zip file:

GitLab → <template-repository> → Code → Download ZIP

Select the correct repository based on your template:

Template Repository
Demoweb Services demoweb/template-services
Demoweb Eshop demoweb/template-eshop

2.2 Extract the ZIP

Extract the downloaded .zip file. You will get a folder with all the template files inside.

2.3 Copy Files into the Client Folder

Copy all files from the extracted folder into your cloned client project folder — excluding the .git folder.

extracted-template/
├── .git         ← ❌ DO NOT copy this
├── app/         ← ✅ copy
├── config/      ← ✅ copy
├── www/         ← ✅ copy
└── ...          ← ✅ copy everything else

⚠️ If you copy the .git folder, the client repository will lose its own Git history and remote connection.

2.4 Install JavaScript Dependencies

Once the files are in place, install the JavaScript dependencies and run the development build:

npm install
npm run dev

Make sure you have Node.js installed locally before running these commands.

2.5 Push Initial State to GitLab

git add .
git commit -m "chore: initialize project from demoweb template

Set up base project structure using demoweb template source files.
Prepare JavaScript dependencies and development environment."

git push -u origin master

Phase 3 — Database Setup

3.1 Export Database from the Template

Go to Adminer at https://aja02.vas-server.cz/adminer/ and select the database corresponding to your template. Navigate to Exportar and use these settings:

Setting Value
Salida gzip
Formato SQL
Tablas DROP+CREATE
Datos INSERT

Check all tables and click Exportar. Save the .sql.gz file locally.

3.2 Create the New Client Database

Still in Adminer, create a new database for the client project if it does not exist yet:

Field Value
Database name <client_name> (e.g. nova_stavby)
Collation utf8mb4_unicode_ci

If the database already exists, skip this step and go directly to Phase 4.

3.3 Import the Exported Database

Select the new client database in Adminer, go to Importar, and upload the .sql.gz file exported in step 3.1.

Phase 4 — Configure config.neon

Open config.neon and update the database section with the new client credentials:

database:
    dsn: 'mysql:host=127.0.0.1;dbname=<client_db_name>'
    user: '<db_user>'
    password: '<db_password>'

Example — New Client "Nova Stavby"

database:
    dsn: 'mysql:host=127.0.0.1;dbname=nova_stavby'
    user: 'nova_stavby_user'
    password: 'SecurePassword123'

⚠️ Make sure config.local.neon is listed in .gitignore so credentials are never committed to the repository.

Common Mistakes

❌ Copying the .git folder from the template
   → the client repo loses its own Git history and remote connection

❌ Skipping the database import and only creating an empty DB
   → the project loads but has no structure or default data

❌ Committing config.neon with real DB credentials
   → sensitive data exposed in repository history

✅ Download ZIP → copy all files except .git → import full DB dump → update config.neon only

Additional Notes

Always use utf8mb4_unicode_ci collation when creating new databases.

If the client database already exists, go directly from Phase 2 to Phase 4.

After setup, verify the project loads correctly in the browser before making any client-specific changes.