This project is a CRUD (Create, Read, Update, Delete) server built with Firebase, Node.js, Express, and TypeScript. It provides endpoints for client applications to interact with and also includes a well-detailed Swagger documentation for easy usage.
https://firebase-be.onrender.com/api-docs
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Node.js
- npm/yarn
- Firebase account
- Clone the repository:
git clone https://github.com/todak2000/firebase_be.git
- Navigate into the project directory:
cd firebase_be
- Install the dependencies:
yarn install
- Set up your Firebase configuration in a
.env
file.
PORT=5000
HOST=localhost
HOST_URL=http://localhost:5000
#firebase config
API_KEY=<your-api-key>
AUTH_DOMAIN=<your-auth-domain>
PROJECT_ID=<your-project-id>
STORAGE_BUCKET=<your-storage-bucket>
MESSAGING_SENDER_ID=<your-messaging-sender-id>
APP_ID=<your-app-id>
- Compile the TypeScript code:
npm run build
- Start the server in development mode:
yarn dev
The server provides the following endpoints:
GET /
: Home routePOST /users
: Create a new userGET /users/:id
: Get a user by IDPUT /users/:id
: Update a user by IDDELETE /users/:id
: Delete a user by ID
The API documentation is provided by Swagger and is available at /api-docs
.
To run the tests, use the command: yarn test
- Firebase - The database used
- Node.js - The runtime used
- Express - The web framework used
- TypeScript - The language used
This project is licensed under the MIT License - see the LICENSE.md file for details