ASP.NET Core / Vue.js SPA Template App
The ASP.NET Core / Vue.js SPA Template App is a template application that combines ASP.NET Core for a REST/JSON API server and Vue.js for a web client. The server side of the app is built using ASP.NET Core and PostgresSQL as the database, and it utilizes Entity Framework Core for database migrations. JSON Web Token (JWT) authorization with OpenIddict is used for authentication. The app is containerized using Docker for development purposes. On the client side, Vue.js is used along with Webpack for asset bundling and Hot Module Replacement (HMR) for a smoother development experience. The app also includes CSS Modules for styling and uses the Fetch API for sending REST requests. Testing is done using xUnit for .NET Core on the server side and Vue.js tests on the client side. For deployment and server management, Ansible has been used to provision and deploy the app. The playbook includes tasks for setting up Nginx reverse proxy, SSL via Let’s Encrypt, PostgresSQL backups to S3, and more.
To set up the ASP.NET Core / Vue.js SPA Template App, follow these steps:
Install the following prerequisites on your machine:
Run the following command to install the dependencies:
npm install
Start the app for development by running this command:
npm start
Open your browser and navigate to http://localhost:5000 to access the app.
Additional scripts are available for specific tasks:
npm run migrate: Use this command after making changes to Entity Framework models in api/Models/ to generate and run a migration on the database.npm test: Run xUnit tests in api.test/ and Vue.js tests in client-web.test/.npm run provision:prod: Use this script to run the Ansible playbook for provisioning the production environment. Before running the script, create an ops/hosts file as instructed in the ops README.npm run deploy:prod: This script packages the app in release mode and runs the Ansible playbook to deploy it to the production environment. Before running the script, create an ops/hosts file as instructed in the ops README.The ASP.NET Core / Vue.js SPA Template App is a powerful template application that combines the functionality of ASP.NET Core and Vue.js. It provides an easy-to-use development environment with Docker and includes various features such as JWT authorization, database management with Entity Framework Core, and automated testing. The app can be easily provisioned and deployed using the provided Ansible playbooks. With its comprehensive set of features and installation guide, the ASP.NET Core / Vue.js SPA Template App is a great starting point for building modern web applications.