Express.js Vercel Starter is a minimalistic and versatile boilerplate for web development, combining the powerful Express.js framework with the deployment capabilities of Vercel.
Express.js Vercel Starter is designed to streamline the development and deployment of web applications using Express.js and Vercel. It provides a solid foundation for building scalable and maintainable projects.
.
βββ api
β βββ index.ts
βββ LICENSE
βββ package.json
βββ package-lock.json
βββ public
β βββ favicon.ico
β βββ index.html
β βββ style.css
βββ src
β βββ controllers
β β βββ files.ts
β β βββ file.ts
β β βββ tts.ts
β βββ lib
β β βββ config
β β βββ env.ts
β β βββ multer.ts
β β βββ sanity.ts
β βββ routes
β β βββ files.ts
β β βββ file.ts
β β βββ tts.ts
β βββ server.ts
βββ tsconfig.json
βββ vercel.json
The following environment variables are utilized:
AWS_ACCESS_KEY_ID=''
AWS_SECRET_ACCESS_KEY=''
AWS_REGION=''
SANITY_SECRET_TOKEN=''
SANITY_API_VERSION=''
SANITY_PROJECT_ID=''
SANITY_DATASET=''
The project provides the following API endpoints, each serving a specific purpose:
This endpoint handles operations related to files. Users can interact with the API to upload multiples files and get URL from the files uploaded.
The file endpoint is responsible for single file uploads. It allows users to one file and get URL of the file uploaded.
The TTS endpoint provides functionality for converting text to speech. Users can send text data to this endpoint, and the server will respond with an audio file generated from the provided text.
These API endpoints collectively form the core functionality of the Express.js Vercel Starter, offering a flexible and scalable solution for file and text processing.
The project utilizes the following packages:
-
@types/cors:
- Provides TypeScript type definitions for the
cors
package, enabling type checking and editor support.
- Provides TypeScript type definitions for the
-
@types/express:
- Offers TypeScript type definitions for the Express.js framework, enhancing code quality and development experience.
-
@types/helmet:
- Provides TypeScript type definitions for the
helmet
package, ensuring type safety and code completion.
- Provides TypeScript type definitions for the
-
@types/morgan:
- Offers TypeScript type definitions for the
morgan
package, enhancing the developer experience with type-aware code.
- Offers TypeScript type definitions for the
-
@types/multer:
- Provides TypeScript type definitions for the
multer
package, enabling type-safe interactions with the file upload middleware.
- Provides TypeScript type definitions for the
-
@types/node:
- Supplies TypeScript type definitions for Node.js core modules, facilitating type-checking for Node.js-specific functionality.
-
@typescript-eslint/eslint-plugin:
- Integrates ESLint with TypeScript, enabling linting for TypeScript code and enforcing coding standards.
-
autoprefixer:
- A PostCSS plugin that automatically adds vendor prefixes to CSS properties, ensuring cross-browser compatibility.
-
eslint:
- A pluggable linting utility for JavaScript and TypeScript, enforcing code style and identifying potential issues.
-
eslint-config-standard-with-typescript:
- An ESLint configuration that combines the StandardJS style guide with TypeScript support, maintaining code consistency.
-
eslint-plugin-import:
- ESLint plugin that provides linting rules for ES6 import statements, ensuring correct usage and preventing common mistakes.
-
eslint-plugin-n:
- An ESLint plugin that enforces version-specific Node.js rules, improving compatibility and preventing usage of unsupported features.
-
eslint-plugin-promise:
- ESLint plugin that adds linting rules related to JavaScript Promises, promoting best practices and preventing common errors.
-
nodemon:
- Monitors files for changes and automatically restarts the Node.js application during development, improving the development workflow.
-
typescript:
- The TypeScript programming language compiler, enabling the use of TypeScript in the project for static typing and improved code quality.
-
aws-sdk:
- The AWS SDK for JavaScript, enabling interaction with various Amazon Web Services (AWS) from the Node.js environment.
-
cors:
- Middleware for handling Cross-Origin Resource Sharing (CORS) in Express.js applications, allowing controlled access to resources from different origins.
-
dotenv:
- A zero-dependency module that loads environment variables from a
.env
file intoprocess.env
, simplifying configuration management.
- A zero-dependency module that loads environment variables from a
-
express:
- Fast, unopinionated, minimalist web framework for Node.js, providing a robust foundation for building web applications and APIs.
-
helmet:
- A collection of middleware functions to secure Express.js applications by setting various HTTP headers, enhancing security.
-
morgan:
- HTTP request logger middleware for Node.js, providing detailed logging information during development and debugging.
-
multer:
- A middleware for handling
multipart/form-data
, primarily used for file uploads in Express.js applications.
- A middleware for handling
-
next-sanity:
- A Next.js utility for integrating with the Sanity CMS, simplifying the process of fetching data from Sanity in Next.js applications.
No configuration is needed from the user; everything has been set up automatically. Users can modify the entire codebase and add more files to the public directory. Leave the api
directory as is.
npm install
Clone the Repository
git clone https://github.com/Clogarr/expressjs-vercel-starter
Create a .env
file from .env.example
, then run the following command:
npm run dev
- Install Vercel CLI
- Click on the "Deploy with Vercel" button on your project's repository page.
- If prompted, log in to your Vercel account or create a new account.
- Select the repository that you want to deploy.
- Click on "Deploy." Vercel will automatically build and deploy your project.
Your project should now be live and accessible at the URL provided by Vercel.
- Express.js - Fast, unopinionated, minimalist web framework for Node.js.
- Vercel - The platform for serverless deployment and serverless functions.
π€ Clogarr π€ Rocky Essel
- GitHub: @Clogarr
- GitHub: @rockyessel
Give a βοΈ if this project helped you!