Express Admin Area
While developers tend to live in the command line that doesn't mean everyone on the team likes to. Whether this is a non-technical member of the team or even another fellow developer.
Express Admin Area is a GUI in the browser for Database Administration tasks, Database Administration Interface (DBAI), that lets you and your team manage your database right from the browser.
Table of Contents
Express Admin Area is extremely simple to use. All you need to do is
Install it as a dependency:
yarn add express-admin-areaor
npm install express-admin area
Create a super user from the command line:
yarn run express-admin-area <<full database url>>or
npm run express-admin-area <<full database url>>.
Require Express Admin Area in your project and pass it a reference to your server, database using Sequelize, and an object containing the models in your database.
/*** This is our connection.js file that will handle the connection of our server* layer to the database layer. Using Sequelize this is not only easily achieved* but we can rest assured that our queries are also safe*/// require our .env variablesconst Sequelize =// create a connection to our DBconst db = processenvDB_URL operatorAliases: falsemoduleexports = db
/*** Now that our server and database are connected we need to create some models*/const Sequelize =const db =// define our Electronics tableconst Electronics = dbmoduleexports = Electronics
/*** Lastly, after connecting our database and creating our Electronics model to store* information about all of our electronics, we now need to pass this information* to ExpressAdminArea through the "init" method from ExpressAdminArea*/// require our .env variables// our projects dependencies: express, express-admin-areaconst express =const ExpressAdminArea =const db =// be sure to require your Sequelize modelsconst Electronics =const app =/*** Call the 'init' method from ExpressAdminArea passing in: express, databaseURI,* and an object containing all of your apps Sequelize models that you would like* to interact with using ExpressAdminArea*/const expressAdminArea = ExpressAdminArea/*** Tell your app you would like to "use" ExpressAdminArea as a middleware* This will automatically create a new route at ""* where you can sign-in and begin interacting with your database from the browser*/app// tell your app to create your "electronics" table in the database if it does not existElectronics// give your app an open port to start accepting requests fromapp
Viola! Now visit
https://myapp.com/expressadminarea in your browser. Log in with your superuser credentials and you should be ready to manage your database from the browser.
Django's admin interface
A good explanaiton of how to contribute to Express Admin Area can be found in the Contributing.md file.