A SvelteKit application for survey management.
Read the project overview here.
Kanban here.
Before starting, make sure you have the following tools installed:
- Node.js Version Manager: You need either
fnmornvmto manage Node.js versions - pnpm: Package manager
- Install via:
npm install -g pnpm
- Install via:
- Turso CLI (required to create and manage the local database)
git clone [email protected]:rxtsel/encustapp.git
cd encustappThis project uses a specific Node.js version defined in .node-version.
Using fnm (recommended):
fnm useUsing nvm:
nvm useIf the Node.js version is not installed, install it first:
With fnm:
fnm install
fnm useWith nvm:
nvm install
nvm usepnpm installCopy the environment example file and configure it with your actual values:
cp .env.example .envFill in other required environment variables with your actual configuration values.
This project uses SQLite as the database.
The database file will be automatically created in the project root when you run pnpm run dev command.
First time setup:
# Option 1: Push schema directly (recommended for development)
pnpm run db:push
# Option 2: Generate and run migrations
pnpm run db:generate
pnpm run db:migratepnpm run devThe application will be available at http://localhost:5173 (or the port shown in your terminal).
This project uses Git Flow methodology with the following branches:
- main: Production-ready code
- develop: Integration branch for features
- feature/: Feature branches (e.g.,
feature/user-authentication)
-
Create feature branches from
develop:git checkout develop git pull origin develop git checkout -b feature/your-feature-name
-
Work on your feature and commit changes
-
Push your feature branch:
git push origin feature/your-feature-name
-
Create a Pull Request to merge into
develop -
After review and approval, the feature will be merged
This project uses Conventional Commits specification. We have tools to help enforce this:
This project enforces Conventional Commits specification. You have two options for making commits:
Option 1 - Using Commitizen (Recommended):
git add .
pnpm run commitThis will launch commitizen which will guide you through:
- Selecting the type of change (feat, fix, docs, etc.)
- Adding a scope (optional)
- Writing a short description
- Adding a longer description (optional)
- Noting any breaking changes (optional)
Option 2 - Manual commits:
git add .
git commit -m "feat: add user authentication"Manual commits must follow the conventional format or they will be rejected by commit hooks.
Using Git UI tools (lazygit, GitKraken, etc.):
If you use GUI tools like lazygit, write your commit messages manually following the conventional format. The commit-msg hook will validate the format automatically.
If not using git cz, follow this format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the coderefactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools
Examples:
feat: add user authentication
fix: resolve login validation issue
docs: update README with setup instructions
chore: update dependencies
The project uses lefthook to automatically run quality checks:
Pre-commit hooks:
- Linting with ESLint
- Code formatting with Prettier
- Type checking with TypeScript
Commit message hooks:
- Commit message validation with commitlint (ensures conventional format)
Pre-push hooks:
- Final type checking
- Final linting
These hooks are automatically installed when you run pnpm install thanks to the prepare script.
pnpm run dev- Start development serverpnpm run check- Run type checkingpnpm run format- Format code with Prettierpnpm run lint- Lint code with ESLintpnpm run commit- Create a commit using Commitizenpnpm run db:push- Push database schemapnpm run db:generate- Generate database migrationspnpm run db:migrate- Run database migrationspnpm run db:studio- Open database studiopnpm run db:seed- Populate database with test datapnpm run db:reset- Reset database (clear all data)
