Skip to content

krafterio/fastedgy-template

Repository files navigation

FastEdgy Template

The project template for FastEdgy.

Prerequisites

Installation

  1. Clone the project:
git clone git@github.com:krafterio/fastedgy-template.git
  1. Install server dependencies:
uv sync
  1. Restart terminal or activate venv:
source .venv/bin/activate  # On macOS/Linux
# or
.venv\Scripts\activate     # On Windows
  1. Install app dependencies:
nvm install 22
nvm use 22
npm install
  1. Configure environment variables:
cp .env.tpl .env
# Edit .env file with your configurations

Database Setup

  1. Create PostgreSQL database:
kt db createdb
  1. Initialize migrations:
kt db init
kt db makemigrations -m "init project"
kt db migrate
  1. Initialize data of database:
kt db init-data

Starting the Server

Via CLI

kt serve

Via VS Code

  1. Open the project in VS Code
  2. Launch the server (Server)

Starting the App

Via CLI

npm run dev

Via VS Code

  1. Open the project in VS Code
  2. Launch the app (App) or the app and the server (All)

API Endpoints

Swagger Documentation: http://localhost:8000/docs

Usage

CLI Commands

The project use a FastEdgy CLI (fastedgy or fe or kt aliases) to facilitate common tasks.

Start the Server

kt serve

Available options:

  • --host: Server host (default: 0.0.0.0)
  • --port: Server port (default: 8000)
  • --reload/--no-reload: Enable/disable hot reload (default: enabled)

Example:

kt serve --port 8080 --no-reload

Database Management

Create a new migration:

kt db makemigrations -m "migration description"

Apply pending migrations:

kt db migrate

Revert the last migration:

kt db downgrade

View migration history:

kt db history

API Documentation

Once the server is running, you can access:

Development

Development Workflow

  1. Create a new branch for your feature:
    git checkout -b feature/feature-name
  2. Make your changes
  3. Create a migration if you modify models:
    kt db makemigrations -m "description of changes"
    kt db migrate
  4. Test your changes
  5. Create a pull request

Troubleshooting

Error JS in production but not in development

To debug a build while having access to the source code, you must run the commands:

npm run build -- --minify=false --sourcemap --debug
npm run preview -- --open

Commit message format convention

This project uses the Conventional Commits naming convention.

Basic structure of a Conventional commit

<type>(<scope>): <description>
  • type: the type of modification made (required)
  • scope: the scope (optional, but recommended)
  • description: a short explanation (imperative, no capital letters, no period)

Conventional Commits Types used

Type Description
feat New feature
fix Bug fix
docs Change in documentation
style Change of format (indentation, spaces, etc.) without functional impact
refactor Refactoring the code without adding or correcting functionality
revert Reverting a previous commit
merge Merging branches
test Adding or modifying tests
chore Miscellaneous tasks without direct impact (build, dependencies, configs, etc.)
perf Performance improvement
ci Changes to CI/CD files (Github Actions, Gitlab CI, etc.)
release Creating a new release

Conventional Commits Scopes used

Scope Description
core Core backend logic and main platform features
cli CLI commands and related functionality
orm ORM models, migrations, and related logic
auth Authentication and authorization mechanisms
api REST API endpoints, routes, and controllers
config Global configuration and environment settings
project Project structure, global files, and overall management

License

This project is licensed under Proprietary License. See the LICENSE file for details.

About

The project template for FastEdgy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published