This project serves as a simple starting point for developing a backend API using Express, MongoDB, AdminJS, TypeScript, and ESModules.
Make sure you have the following installed on your machine:
- Node.js (https://nodejs.org/)
- npm (Node Package Manager)
- MongoDB (https://www.mongodb.com/try/download/community)
git clone https://github.com/isaacpontes/adminjs7-express-mongodb-template.git
cd adminjs7-express-mongodb-template
npm install
Execute npm run dev
to start the server in development mode using tsx
for live TypeScript compilation. The server will be accessible at http://localhost:3000.
Access the AdminJS panel by navigating to http://localhost:3000/admin.
Run npm run build
.
Execute npm start
after compiling the TypeScript code into JavaScript to start the server in production mode. The server will be accessible at http://localhost:3000.
Ensure that your MongoDB server is running. The project comes with a default connection to MongoDB using the connection string "mongodb://localhost:27017/adminjs_blog". If you wish to use a different one, update the MongoDB connection string in src/app.ts
:
mongoose.connect('your-mongodb-connection-string');
Feel free to contribute to this project by submitting issues or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.