A highly efficient starter pack for Node.js development, featuring TypeScript. Our codebase leverages the power of Express.js, Sequelize, SWC, Docker, Jest and PostgreSQL and a variety of other tools to provide a robust, secure and scalable backend server environment.
- Express.js Implementation: Provides HTTP server with predefined
/user
routes. - Advanced Security: Integrates JWT and Bcrypt for encrypted user authentication and password storage.
- Docker Ready: Pre-configured with an alpine image for efficient, production-grade deployments.
- Sequelize ORM: Simplifies PostgreSQL database interactions.
- Zero-Config Database Setup: Includes
init.sql
file to automate database creation and setup in Docker. - Speedy Compilation: Employs SWC, the fastest TypeScript compiler available.
- Node Version Recommendation: Utilizes
.nvmrc
for suggesting Node versions. - Type-Safe Environment Variables: Uses
environment.d.ts
to specify types for environment variables. - Thorough Testing: Ensures code integrity with Jest and Supertest for comprehensive test coverage.
- express.js - Fast, unopinionated, minimalist web framework for Node.js.
- sequelize - Multi-dialect ORM for Node.js and TypeScript.
- pg - Non-blocking PostgreSQL client for Node.js.
- swc - Super-fast JavaScript/TypeScript compiler.
- bcrypt - Store passwords in a safe and reliable way.
- jsonwebtoken - Handle authentication in a securely.
- nodemon - Utility for auto-restarting Node.js applications on file changes.
- jest - Delightful JavaScript Testing Framework.
- supertest - High-level abstraction for testing HTTP.
- dotenv - Zero-dependency module that loads environment variables from
.env
file. - underscore.js - Utility-belt library for JavaScript, provides support for functional programming.
- concurrently - Utility to run multiple npm scripts concurrently.
- chokidar - An efficient and powerful file watching library.
- Node JS v18.15.0 - Install using NVM
- Yarn - Once Node is installed, run:
npm i -g yarn
- Docker (Optional) - Dowload Link
- Clone the repository:
git clone git@github.com:KaranJagtiani/QuickNode.git
- Install the dependencies:
yarn install
- Build the project:
yarn run build
- Start the application with Docker compose:
docker compose up -d
Your server will be available at http://localhost:8081
🚀
yarn run dev
Execute the Jest test suite with:
yarn run test
/user/register
: This route expects a JSON body:
{
"email": string,
"password": string
}
/user/login
: This route expects a JSON body:
{
"email": string,
"password": string
}
Returns:
{
"token": "<signed-jwt-token>"
}
/user/profile
: This route expects aBearer <token>
in theAuthorization
header.:
Returns:
{
"id": number,
"email": string
}
We welcome contributions from the community! If you wish to contribute, please follow these steps:
- Fork the project
- Create your feature branch (git checkout -b feature/AmazingFeature)
- Commit your changes (git commit -m 'Add some AmazingFeature')
- Push to the branch (git push origin feature/AmazingFeature)
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.