https://gitlab.com/mYnDstrEAm/pevn_nuxt
Free and open-source JavaScript software stack for modern websites and webapps.
This project aims to be as minimalistic as possible while featuring all functionalities, such as authentication, typically necessary in most web-projects so that it can be used to quickly build new things using this stack.
It shows how to use the latest versions of PostgreSQL, Express.js, Vue.js, Node.js and Nuxt.js in conjunction. The guide and the code will be improved later.
The naming is based upon the more popular MEAN and MEVN stacks but could be changed when this project gets moved to GitLab.
This project is under construction! As of right now it is for testing and development purposes only: you likely can't yet use its authentication as is in production.
Architectural layer/component | Software choice |
---|---|
Meta Framework | Nuxt.js |
Server | Nuxt.js + Node.js + Express.js |
Authentication middleware | Passport |
Model | PostgreSQL (ORDBMS) + node-postgres (PostgreSQL client for Node.js) + Sequelize (ORM) |
ViewModel | Vue.js |
View | Vue.js + Vuetify |
Some components of the project could be switched out later and some could be added in addition. It aims to use the most FOSS, community-governed, performant, secure and efficient components in their latest stable versions. The components that are part of the stack's acronym (PEVNN) are long-term choices and unlikely to change while e.g. Sequelize could be switched out for Sails/Waterline.
This project will be moved to GitLab in 2019.
I'm currently busy coding an app with the Quasar Framework and am uploading this now in case somebody wants to get started with this stack over the Christmas holidays. I will improve it later. You can help, too.
- Install dependencies
cd pevn_nuxt
npm install
- Setup postgres database
- Install postgres and pgAdmin
- Create a new user:
sudo su postgres
psql
CREATE USER pevnn_testuser WITH PASSWORD 'pevnn_testuser_password';
ALTER USER pevnn_testuser WITH SUPERUSER;
- node-postgres currently doesn't seem to support SCRAM-SHA-256 password encryption and restricting the user priviliges to a particular database. Hence make sure you don't have any databases containing sensitive data accessible. Using pg-native could fix this problem.
- Create the following file:
./server/api/config.json
with the following content:
{
"development": {
"username": "pevnn_testuser",
"password": "pevnn_testuser_password",
"database": "todos_dev",
"host": "127.0.0.1",
"port": 5432,
"dialect": "postgres"
},
"test": {
"username": "root",
"password": null,
"database": "database_test",
"host": "127.0.0.1",
"dialect": "postgres"
},
"production": {
"username": "root",
"password": null,
"database": "database_production",
"host": "127.0.0.1",
"dialect": "postgres"
}
}
cd pevn_nuxt
and run:
./node_modules/.bin/sequelize db:create
./node_modules/.bin/sequelize db:migrate
- Serve with hot reload at http://localhost:3000 by running
npm run dev
npm run build
npm start
npm run generate
Please improve upon the guide and the code:
- Fork the project
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Issue a pull request
You can also create issues, but note that this repo is under construction and of version 0.0.1, so it's better to (either wait for at least version 0.1.0 or) create pull-requests. I did use some code and guides on the Web, mostly guides for outdated versions of individual components such as this and this, to create this.