Skip to content

GauthierWebDev/AlchemiaJS

Repository files navigation

alchemia-js

AlchemiaJS

Fast, compact and lightweight Typescript API, built with Vike (previously vite-plugin-ssr) and Prisma.

license last-commit repo-top-language repo-language-count


Table of Contents

Overview

AlchemiaJS is a fast, compact and lightweight Typescript API, built with Vike (previously vite-plugin-ssr) and Prisma.

The project is designed to provide a simple and efficient way to create and manage a web API using the Vike framework, which is a server-side rendering plugin for Vite.


Features

The AlchemiaJS project provides a number of features to help you build and manage your web API.

  • Minimalist: AlchemiaJS is designed to be lightweight and fast, with a focus on simplicity and efficiency. Combined with `fastify` instead of other NodeJS frameworks, it provides a minimalist approach to building web servers.
  • SEO Friendly: AlchemiaJS is built with Vike, a server-side rendering plugin for Vite, which allows you to create SEO-friendly web applications.
  • Prisma Integration: AlchemiaJS is integrated with Prisma, a modern database toolkit for Node.js and TypeScript. This allows you to easily manage your database schema and interact with your database.
  • Customizable: AlchemiaJS is highly customizable, allowing you to easily extend and modify the API to suit your needs.

Repository Structure

└── AlchemiaJS/
    ├── alambic
    │   ├── commands
    │   ├── core
    │   ├── data
    │   ├── functions
    │   ├── index.ts
    │   └── template
    ├── config
    │   ├── errors.ts
    │   ├── index.ts
    │   ├── security.ts
    │   └── settings.ts
    ├── loader.js
    ├── logs
    │   └── .gitkeep
    ├── nodemon.json
    ├── package.json
    ├── pnpm-lock.yaml
    ├── prisma
    │   └── schema.prisma
    ├── register.js
    ├── server
    │   ├── alchemia.d.ts
    │   ├── app
    │   ├── core
    │   ├── functions
    │   ├── index.ts
    │   ├── root.ts
    │   ├── server.ts
    │   └── services
    ├── src
    │   ├── pages
    │   └── renderer
    ├── temp
    │   └── .gitkeep
    ├── tsconfig.json
    ├── types
    │   ├── alambic.ts
    │   ├── alchemia.ts
    │   └── index.ts
    ├── utils
    │   ├── API.ts
    │   ├── Logger.ts
    │   └── index.ts
    └── vite.config.ts

Getting Started

System Requirements:

  • NodeJS: version 20.11.0 or higher
  • PostgreSQL: version 15.6 or higher

Installation

From npx

  1. Create a new AlchemiaJS project using the command below:
$ npx create-alchemiajs-app my-alchemiajs-project
  1. Change to the project directory:
$ cd my-alchemiajs-project
  1. Install the dependencies:
$ npm install

From source

  1. Clone the AlchemiaJS repository:
$ git clone https://github.com/GauthierWebDev/AlchemiaJS
  1. Change to the project directory:
$ cd AlchemiaJS
  1. Install the dependencies:
$ npm install

Configuration

  1. Copy the .env.example file to .env:
$ cp .env.example .env
  1. Update the .env file with your API configuration details.
# SETTINGS
PORT=5000
DOMAIN=localhost
PROTOCOL=http
NODE_ENV=development
LOG_LEVEL=debug

# SECURITY
JWT_SECRET=secret
JWT_EXPIRES_IN=1d
SALT_ROUNDS=10
COOKIE_DAYS_DURATION=1
SESSION_SECRET=super_secret_key_of_min_32_chars
  1. Update the .env file with your database connection details.
DATABASE_URL="postgresql://username:password@localhost:5432/database?schema=public"
  1. Update the prisma/schema.prisma file with your database schema.
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
}

model User {
  id        String   @id @default(cuid())
  email     String   @unique
  password  String
  created   DateTime @default(now())
  updated   DateTime @updatedAt
}
  1. Run the Prisma migration to create the database schema:
$ npx prisma migrate dev

Usage

Run AlchemiaJS using the command below:

$ npm run dev

Contributing

Contributions are welcome! Here are several ways you can contribute:

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/GauthierWebDev/AlchemiaJS
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


License

This project is protected under the MIT License. For more details, refer to the License file.


Return


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published