With this Angular and Baqend starter kit you can build blazingly fast single page applications in no time. Setup your project by following the simple steps below.
The starter is based on the official Angular CLI and uses:
- SASS as a CSS precompiler with cool features and syntax
- TypeScript for typed JavaScript, ES6 features and because it is recommended for Angular
- Bootstrap for easy modern styling
- Baqend as a fully managed backend service for backend-less development
- Make sure you have Node.js installed on your machine
- Clone the repository with
git clone https://github.com/Baqend/angular-starter.git
- Install the project with
npm install
- Start the server with
npm start
- Open the url in your browser http://localhost:4200, you should see a small sample application with signup capability
- You can build a AOT production version with
npm run build -- --prod
Your app is currently connected to a Baqend test instance called 'app-starter', which provides common backend features like data and file storage, user authentication (used in the example), queries and push notifications among others.
To develop your own application
- Launch a free Baqend instance at baqend.com
- Change the app name in your projects
src/app/db.ts
fromapp-starter
to your app name - Your Angular app will automatically connect to your app instance
- To start accessing data or backend features, simply import the
db
-object withimport {db} from 'baqend';
and see our Guide and API Docs for details
For more information: on Angular, the Angular CLI or Baqend.
Before the Baqend SDK can be used, a connection to the Baqend instance must be established. There are two options to wait for the initialization.
-
You can use the
DBReady
resolver to delay the route component rendering, orDBLoggedIn
to prevent navigation to protected routes that are only accessible by logged in users. For a live example look into thesrc/app/app-routing.modules.ts
. -
Or you can manually wait on
db.ready()
within your components and use the SDK afterwards.
import { Component, OnInit } from '@angular/core';
import { db } from 'baqend';
@Component({
selector: 'myRoute'
})
export class MyRoute implement OnInit {
ngOnInit(private router:Router) {
db.ready().then(() => {
db.MyClass.find()...
});
}
Baqend is a fully managed Backend-as-a-Service platform with a strong focus on performance and scalability (click here for details). The JavaScript API gives you access to common backend features while the dashboard lets you define data models and access rules as well as business logic to execute on the server side.
Baqend's feature set includes:
- Automated Browser and CDN Caching
- Scalable Data Storage
- Realtime Streaming Queries
- Powerful Search and Query Language
- Push Notifications
- User Authentication and OAuth
- File Storage and Hosting
- Access Control on Object and Schema Level