Fast, compact and lightweight Typescript API, built with Vike (previously vite-plugin-ssr) and Prisma.
Table of Contents
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.
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.
└── 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
System Requirements:
- NodeJS:
version 20.11.0 or higher
- PostgreSQL:
version 15.6 or higher
- Create a new AlchemiaJS project using the command below:
$ npx create-alchemiajs-app my-alchemiajs-project
- Change to the project directory:
$ cd my-alchemiajs-project
- Install the dependencies:
$ npm install
- Clone the AlchemiaJS repository:
$ git clone https://github.com/GauthierWebDev/AlchemiaJS
- Change to the project directory:
$ cd AlchemiaJS
- Install the dependencies:
$ npm install
- Copy the
.env.example
file to.env
:$ cp .env.example .env
- 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
- Update the
.env
file with your database connection details.DATABASE_URL="postgresql://username:password@localhost:5432/database?schema=public"
- 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 }
- Run the Prisma migration to create the database schema:
$ npx prisma migrate dev
Run AlchemiaJS using the command below:
$ npm run dev
Contributions are welcome! Here are several ways you can contribute:
- Report Issues: Submit bugs found or log feature requests for the
AlchemiaJS
project. - Submit Pull Requests: Review open PRs, and submit your own PRs.
- Join the Discussions: Share your insights, provide feedback, or ask questions.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/GauthierWebDev/AlchemiaJS
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to github: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
This project is protected under the MIT License. For more details, refer to the License file.