https://github.com/freinet12/express-vue-starter
A Full-Stack Express & Vue Project Starter
https://github.com/freinet12/express-vue-starter
Last synced: about 2 months ago
JSON representation
A Full-Stack Express & Vue Project Starter
- Host: GitHub
- URL: https://github.com/freinet12/express-vue-starter
- Owner: freinet12
- Created: 2020-01-11T20:45:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-16T07:50:06.000Z (over 2 years ago)
- Last Synced: 2025-02-14T01:45:46.712Z (3 months ago)
- Language: JavaScript
- Size: 940 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express + Vue Starter
This is a Full-Stack project starter using Express.js and Vue.js.
This is useful if you have to build similar projects. You can just clone the repo and start bulding your app without having to setup everything from scratch.
Laravel Mix is used to compile all the front-end assets.
# Getting Started
- Installation:
- Clone this repo
- runnpm install
to install all dependencies
- Open the .env-example file and copy the contents to a .env file in the root of the project.- Run
- Note: you'll need two ternimal windows open so you can run the below commands, one in each terminal
- Start the Express server by running :npm start
or if you have nodemon installed:nodemon npm start
- Runnpm run watch
to compile the front-end assets and vue components
- Go to http://localhost:3000 to see the app.- Database Setup
- MySQL is the default database server. To use PostgreSQL or another relational database, simply update the environment variables:
- DEFAULT_DB_CONNECTION=[ your default database server ie:mysql
,postgres
,sqlite
, etc.]
- mysql2 is already installed and ready to go.
- This project uses Sequelize as the ORM. Learn how to use Sequelize here
- After you have created and connected a database, go to the mainapp.js
file and uncomment this block:
models.sequelize.sync().then( () => {
console.log('Database synced successfully!');
}).catch( (err) => {
console.error(err, "Something went wrong");
});
- Express
- All express views are located inresources >> assets >> views
- All API related routes should go inroutes >> api.js
- All user specific routes should go inroutes >> users.js
- All other web routes should go inroutes >> web.js
- Vue
- All Vue components and related scripts are inresources >> assets >> js