Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ladunjexa/tsnode-express-mongodb-boilerplate
well-structured boilerplate for REST API using Node.js, TypeScript, Express & MongoDB ๐ช
https://github.com/ladunjexa/tsnode-express-mongodb-boilerplate
backend-api-boilerplate best-practices expressjs mongoosejs rest-api-boilerplate typescript-nodejs
Last synced: 12 days ago
JSON representation
well-structured boilerplate for REST API using Node.js, TypeScript, Express & MongoDB ๐ช
- Host: GitHub
- URL: https://github.com/ladunjexa/tsnode-express-mongodb-boilerplate
- Owner: ladunjexa
- License: mit
- Created: 2023-04-17T02:09:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-13T18:26:17.000Z (6 months ago)
- Last Synced: 2024-10-10T23:50:57.966Z (about 1 month ago)
- Topics: backend-api-boilerplate, best-practices, expressjs, mongoosejs, rest-api-boilerplate, typescript-nodejs
- Language: TypeScript
- Homepage:
- Size: 341 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Project Banner](readme_assets/readme_banner.png#gh-dark-mode-only)
![Project Banner](readme_assets/readme_banner-light.png#gh-light-mode-only)
TSNode & MongoDB REST API
well-structured boilerplate for REST API using Node.js, TypeScript, Express & MongoDB.
View Demo
ยท
Documentation
ยท
Report Bug
ยท
Request Feature
# :notebook_with_decorative_cover: Table of Contents
- [About the Project](#star2-about-the-project)
* [Folder Structure](#bangbang-folder-structure)
* [Tech Stack](#space_invader-tech-stack)
- [Getting Started](#toolbox-getting-started)
* [Environment Variables](#key-environment_variables)
* [Installation](#gear-installation)
* [Run Locally](#running-run-locally)
- [Contributing](#wave-contributing)
- [License](#warning-license)
- [Contact](#handshake-contact)
- [Acknowledgements](#gem-acknowledgements)
## :star2: About the Project
This repository houses a well-structured REST API for ***User Management*** powered by MongoDB with cookie based authentication, with the abilities to Create, Read, Update users.
REST API built with TypeScript, Node.js, Express & MongoDB.### :bangbang: Folder Structure
Here is the folder structure of REST API.
```bash
TSNode-MongoDB-REST-API/
|- server/
|-- src/
|-- controllers/
|-- db/
|-- helpers/
|-- middlewares/
|-- router/
|-- index.ts
|-- .env
|-- nodemon.json
|-- tsconfig.json
|-- package.json
```### :space_invader: Tech Stack
[![My Skills](https://skillicons.dev/icons?i=ts,nodejs,express,mongodb)](https://skillicons.dev)
## :toolbox: Getting Started
### :key: Environment Variables
In order to use this REST API you have to add some environment variables to .env file,
##### _server-side_ [server/.env]
create `.env` file in `server/` directory & add the following environment variables:
```env
SESSION_TOKEN_NAME=
MONGODB_URL=
SECRET=
PORT= // optional, default set to 8080
```### :gear: Installation
#### Step 1:
Download or clone this repo by using the command below:```bash
https://github.com/ladunjexa/TSNode-MongoDB-REST-API.git
```#### Step 2:
This REST API using NPM (Node Package Manager), therefore, make sure that Node.js is installed by execute the following command in console: (minimum Node 14.x)
```bash
node -v
```#### Step 3:
In `server` folder execute the following command to get the required packages:
```bash
npm install
```### :running: Run Locally
#### Step 1:
Go to `server` folder and execute the following command in order to start the server:
```bash
npm start
```## :wave: Contributing
Contributions are always welcome!
See [`contributing.md`](https://contributing.md/) for ways to get started.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request## :warning: License
Distributed under the MIT License. See [LICENSE.txt](https://github.com/ladunjexa/TSNode-MongoDB-REST-API/blob/main/LICENSE) for more information.
## :handshake: Contact
Liron Abutbul - [@lironabutbul6](https://twitter.com/lironabutbul6) - [@ladunjexa](https://t.me/ladunjexa)
Project Link: [https://github.com/ladunjexa/TSNode-MongoDB-REST-API](https://github.com/ladunjexa/TSNode-MongoDB-REST-API)
## :gem: Acknowledgements
This section used to mention useful resources and libraries that used in the REST API:
#### server-side
- [Body Parser](https://www.npmjs.com/package/body-parser)
- [Compression](https://www.npmjs.com/package/compression)
- [Cookie Parser](https://www.npmjs.com/package/cookie-parser)
- [CORS](https://www.npmjs.com/package/cors)
- [dotenv](https://www.npmjs.com/package/dotenv)
- [Express.js](https://expressjs.com/)
- [lodash](https://lodash.com/)
- [mongoose.js](https://mongoosejs.com/)
- [Nodemon](https://www.npmjs.com/package/nodemon)