If you’re looking to build modern real-time applications, the Feathers framework combined with Vue 2 is an excellent choice. In this blog post, we’ll explore how to set up your Feathers-Vue fullstack application with features like authentication, email verification, and more. Let’s dive in!
About Feathers-Vue
This project incorporates Feathers, an open-source web framework designed for real-time applications, along with Vue 2, which supports Server Side Rendering. Although the project is still in progress, it is capable of being used immediately if you find its current capabilities satisfactory.
Features
- SASS
- Stylus
- Pug
- ES6, ES7, and ES8
- Webpack
- Vue Stash for Redux Store
- Bootstrap
- Lodash
- jQuery
- FontAwesome
- Client-side data validation with Mongoose schemas
Getting Started
Setting up the application can be done in a few simple steps. Here are two methods: using Docker for containerization, or developing locally without Docker.
Develop with Docker
To avoid installing node_modules locally, follow these steps:
- Create
environment-dev.envandenvironment.envfiles to hold your environment variables. These files are ignored by Git. You’ll need the following variables: - Run
npm start - To see the production build locally, execute:
- To switch back to development:
DATABASE_URL=mongodb:dbfeathersvuedevelopment
COMPLAINT_EMAIL=your_email@gmail.com
GMAIL=your_email@gmail.com
GMAIL_PASSWORD=your_pass_password
For more information, see How to set an app password.
npm run build-qa
npm run qa
npm run build-dev
npm start
Please note that switching contexts between production and development requires a full Docker build with no cache.
Develop Without Docker
- Ensure you have NodeJS and npm installed.
- Install your dependencies:
- Start your app locally:
- In production run:
- To set up Gmail for email functions, add the following environment variables:
cd path/to/Feathers-Vue
npm install
mongod
npm run dev
npm run build
npm run production
export GMAIL=yourgmailaccount@gmail.com
export GMAIL_PASS=yourpassword or app-password
Refer to this guide for setting the app password.
Testing Your Application
To ensure everything is functioning properly, use the following commands:
- To run server-side unit tests:
npm test - To run client-side integration tests:
npm run integration
Using Feathers CLI for Scaffolding
The Feathers CLI provides a powerful command line interface for various tasks:
npm install -g feathers-cli– Install Feathers CLIfeathers generate service– Generate a new servicefeathers generate hook– Generate a new hookfeathers generate model– Generate a new modelfeathers help– Show all commands
GitLab Auto Deployment
For those looking to set up auto-deployment with GitLab, follow these steps:
- Create a DigitalOcean instance using one-click Docker.
- SSH into the instance and run:
- Edit
sshd_config: - Change
PasswordAuthenticationto “yes” at the bottom of the file. - Run
reload ssh - Set the following secret environment variables in GitLab:
- Update
docker-compose.autodeploy.ymlweb image. - Adjust
gitlab-ci.ymlfor specific branches. - Push changes to GitLab.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -y install python-pip
sudo pip install docker-compose
nano /etc/ssh/sshd_config
DATABASE_URL=mongodb:dbfeathersvue
DEPLOYMENT_SERVER_IP=your_ip_address
DEPLOYMENT_SERVER_PASS=your_user_password
DEPLOYMENT_SERVER_USER=your_server_user
Troubleshooting Tips
If you encounter issues while developing your Feathers-Vue application, consider the following troubleshooting steps:
- Double-check your environment variables, especially database URLs and email settings.
- Make sure your dependencies are correctly installed and up-to-date.
- Look for any syntax errors in your code.
- Refer to Feathers documentation for specific problems.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Breaking Changes
Be mindful of the following breaking changes:
- Removed Mongoose validation from the client side and replaced it with Yup.
- Reconstructed server-side rendering following updated instructions in Vue.js.
- Moved the server-entry file into the app directory.
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.
Conclusion
Building a fullstack application with Feathers and Vue is a rewarding experience, blending real-time capabilities with modern front-end technology. As you continue developing your Feathers-Vue application, remember to embrace the learning process and leverage the vibrant community around these tools. Happy coding!

