GithubHelp home page GithubHelp logo

create-express-app's Introduction

Node.js Project Setup with Express, TypeScript, Prisma, and MongoDB

This README outlines the usage of a PowerShell script designed to automate the setup of a Node.js project with Express, TypeScript, Prisma, dotenv, and a Dockerized MongoDB database. The project includes necessary configurations for development, including a .gitignore file, vercel.json, and a basic docker-compose.yml for MongoDB.

Prerequisites

Before running the script, make sure you have the following installed on your system:

  • Node.js (v14 or higher)
  • npm (comes with Node.js)
  • Docker Desktop (for MongoDB containerization)
  • PowerShell

Quick Start

Run the Script: Execute the script by typing ./CreateExpressApp.ps1 -projectName <project-name> in your terminal. Replace <project-name> with the name of your project.

What Does the Script Do?

Upon execution, the script will:

  • Create a new directory for your Node.js project.
  • Initialize a new npm project and install necessary dependencies, including Express, dotenv, and Prisma.
  • Set up TypeScript for development.
  • Configure Prisma to connect to MongoDB.
  • Create initial files such as index.ts for a basic Express server, .env for environment variables, and .gitignore to exclude node modules and other non-essential files.
  • Add a README.md file to your project directory with basic project information and setup instructions.
  • Create a vercel.json for deploying with Vercel if needed.
  • Set up a docker-compose.yml file to run a MongoDB database locally in a Docker container. This will use a simple username and password for authentication DO NOT USE IN PRODUCTION.
  • Create a tools directory with powershell scripts to start the server and MongoDB container and to wipe the database.

Running Your Project

After setup:

  • Run docker-compose up -d to start your MongoDB database.
  • Navigate to your project directory and run npm install to install all dependencies.
  • Use npm start to run your Express server.

Stopping the MongoDB Container

To stop and remove the MongoDB container, you can use:

docker-compose down

create-express-app's People

Contributors

codygillespie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.