Code Monkey home page Code Monkey logo

ms-react-mobile-shop's Introduction

项目名称:米修在线-手机商城 介绍:MERN 全栈项目

用法

ECMAScript Modules

项目的后端使用 ECMAScript 模块。确保至少具有 Node v14.6 +, 另外,在导入文件(不是包)时,请确保在末尾添加.js,否则会出现“找不到模块”错误

环境变量

在根目录中创建一个.env 文件,然后添加以下内容

NODE_ENV = development PORT = 5000 MONGO_URI = 你自己的 mongodb uri /(应用测试使用:mongodb+srv://msonline123:[email protected]/mobileshop?retryWrites=true&w=majority) JWT_SECRET = 'abc123' PAYPAL_CLIENT_ID = 你的 paypal client id

安装依赖项(前端和后端)

npm install
cd frontend
npm install

运行 RUN

# 同时启动前后端 frontend (:3000) & backend (:5000)
npm run dev

#只启动后台
npm run server

打包与部署

# Create frontend prod build
cd frontend
npm run build

PS:有一个 heroku-postbuild 脚本,如果推送到 Heroku,则无需手动打包就可以部署

数据库测试数据

可以使用以下命令创建数据库测试用的用户和产品信息,以及销毁所有数据

# 插入数据
npm run data:import
# 销毁数据
npm run data:destroy
测试用户数据

[email protected] (Admin)
123456

[email protected] (Customer)
123456

[email protected] (Customer)
123456

ms-react-mobile-shop's People

Contributors

ms-online 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.